Linux  R2.6.5-7.282-sn2 FORTRAN90/SX         Rev.360        Tue Oct 11 12:33:21 2011
FILE NAME: argset.f90
PROGRAM NAME: argset
TRANSFORMATION LIST

  LINE                   FORTRAN STATEMENT

     1  != Module ArgSet
     2  !
     3  ! Authors::   ODAKA Masatsugu
     4  ! Version::   $Id: argset.f90,v 1.3 2011-06-17 19:04:00 sugiyama Exp $
     5  ! Tag Name::  $Name: arare5-20111010 $
     6  ! Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
     7  ! License::   See COPYRIGHT[link:../../COPYRIGHT]
     8  !
     9  !== Overview
    10  !
    11  !コマンドライン引数の解釈を行うモジュール
    12  !
    13  !== Error Handling
    14  !
    15  !== Known Bugs
    16  !
    17  !== Note
    18  !
    19  !== Future Plans
    20  !
    21  
    22  module argset
    23    !
    24    !
    25  
    26    !モジュール読み込み
    27    use dc_types,    only : STRING, DP
    28    use dc_string,   only : StoA
    29    use dc_args,     only : ARGS, Open, Debug, Help, Strict, Close, Option
    30    use dc_message,  only : MessageNotify
    31    use mpi_wrapper, only: myrank
    32  
    33    !暗黙の型宣言禁止
    34    implicit none
    35  
    36    !save 属性
    37    save
    38  
    39    !公開変数
    40    !-----   コマンドライン引数解析用変数    -----
    41    type(ARGS)           :: arg             ! コマンドライン引数情報
    42    logical              :: OPT_namelist    ! コマンドライン引数用論理変数
    43    character(STRING)    :: VAL_namelist    ! コマンドライン引数の値
    44  
    45  
    46  contains
    47  
    48    subroutine argset_init(namelist_filename)
    49      !
    50      !コマンドライン引数を解釈して, 引数に与えられた NAMELIST ファイル名
    51      !を返す.
    52      !
    53  
    54      !暗黙の型宣言禁止
    55      implicit none
    56  
    57      !入力変数
    58      character(*), intent(out)     :: namelist_filename
    59  
    60      !NAMELIST ファイルの取得
    61      !  gtool5 ライブラリの dc_args モジュールを利用.
    62      !  指定可能なオプションは以下の通り.
    63      !
    64      !  -N=VAL, --namelist=VAL
    65      !    specify Namelist file (default is 'arare.conf').
    66      !
    67      !  -D=VAL, --debug=VAL
    68      !    call dc_trace#SetDebug (display a lot of messages for debug).
    69      !    VAL is unit number (default is standard output)
    70      !
    71      !  -h=VAL, -H=VAL, --help=VAL
    72      !    display this help and exit. VAL is unit number (default is
    73      !    standard output)
    74      !
    75      call Open(arg)
    76      call Option(arg, StoA('-N', '--namelist'), &
    77        &         OPT_namelist, VAL_namelist, &
    78        &         help="specify Namelist file (default is 'arare.conf')." )
    79                        ! "-N/--namelist" オプションの設定
    80      call Debug(arg)   ! デバッグオプションの自動設定
    81      call Help(arg)    ! ヘルプオプションの自動設定
    82      call Strict(arg)  ! 無効なオプション指定時に警告を表示
    83  
    84      !"-N/-namelist" オプションの解釈
    85      !  与えられていない場合はデフォルト値 (arare.conf) を
    86      !  NAMLIST ファイル名とする.
    87      !
    88      if (OPT_namelist) then
    89        if (myrank == 0) then
    90          call MessageNotify( "M", "main", &
    91            &                 "Namelist file is '%c'", c1=trim(VAL_namelist) )
    92        end if
    93        namelist_filename=trim(VAL_namelist)
    94      else
    95        if (myrank == 0) then
    96          call MessageNotify( "W", "main", &
    97            &                    "Namelist file is not specified." )
    98          call MessageNotify( "M", "main", &
    99            &                 "Use default Namelist file (arare.conf)." )
   100        end if
   101        namelist_filename="arare.conf"
   102      end if
   103  
   104      call Close(arg)
   105  
   106      ! 確認
   107      if (myrank == 0) then
   108        call MessageNotify( "M",                  &
   109          &                 "argset_init",        &
   110          &                 "NAMELIST FILE = %c", &
   111          &                 c1=namelist_filename )
   112      end if
   113  
   114    end subroutine argset_init
   115  end module argset
Linux  R2.6.5-7.282-sn2 FORTRAN90/SX         Rev.360        Tue Oct 11 12:33:21 2011
FILE NAME: argset.f90
PROGRAM NAME: argset
FORMAT LIST

  LINE    LOOP     FORTRAN STATEMENT

     1:            != Module ArgSet
     2:            !
     3:            ! Authors::   ODAKA Masatsugu
     4:            ! Version::   $Id: argset.f90,v 1.3 2011-06-17 19:04:00 sugiyama Exp $ 
     5:            ! Tag Name::  $Name: arare5-20111010 $
     6:            ! Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
     7:            ! License::   See COPYRIGHT[link:../../COPYRIGHT]
     8:            !
     9:            !== Overview 
    10:            !
    11:            !コマンドライン引数の解釈を行うモジュール
    12:            !
    13:            !== Error Handling
    14:            !
    15:            !== Known Bugs
    16:            !
    17:            !== Note
    18:            !
    19:            !== Future Plans
    20:            !
    21:            
    22:            module argset
    23:              !
    24:              !
    25:            
    26:              !モジュール読み込み
    27:              use dc_types,    only : STRING, DP
    28:              use dc_string,   only : StoA
    29:              use dc_args,     only : ARGS, Open, Debug, Help, Strict, Close, Option
    30:              use dc_message,  only : MessageNotify
    31:              use mpi_wrapper, only: myrank
    32:            
    33:              !暗黙の型宣言禁止
    34:              implicit none
    35:            
    36:              !save 属性
    37:              save
    38:            
    39:              !公開変数
    40:              !-----   コマンドライン引数解析用変数    -----
    41:              type(ARGS)           :: arg             ! コマンドライン引数情報
    42:              logical              :: OPT_namelist    ! コマンドライン引数用論理変数
    43:              character(STRING)    :: VAL_namelist    ! コマンドライン引数の値
    44:            
    45:            
    46:            contains
    47:            
    48:              subroutine argset_init(namelist_filename)
    49:                !
    50:                !コマンドライン引数を解釈して, 引数に与えられた NAMELIST ファイル名
    51:                !を返す. 
    52:                !
    53:            
    54:                !暗黙の型宣言禁止
    55:                implicit none
    56:            
    57:                !入力変数
    58:                character(*), intent(out)     :: namelist_filename
    59:            
    60:                !NAMELIST ファイルの取得
    61:                !  gtool5 ライブラリの dc_args モジュールを利用.
    62:                !  指定可能なオプションは以下の通り.
    63:                !
    64:                !  -N=VAL, --namelist=VAL
    65:                !    specify Namelist file (default is 'arare.conf'). 
    66:                !
    67:                !  -D=VAL, --debug=VAL
    68:                !    call dc_trace#SetDebug (display a lot of messages for debug).
    69:                !    VAL is unit number (default is standard output)
    70:                !
    71:                !  -h=VAL, -H=VAL, --help=VAL
    72:                !    display this help and exit. VAL is unit number (default is
    73:                !    standard output)
    74:                !
    75:                call Open(arg)
    76:                call Option(arg, StoA('-N', '--namelist'), &
    77:                  &         OPT_namelist, VAL_namelist, &
    78:                  &         help="specify Namelist file (default is 'arare.conf')." )
    79:                                  ! "-N/--namelist" オプションの設定
    80:                call Debug(arg)   ! デバッグオプションの自動設定
    81:                call Help(arg)    ! ヘルプオプションの自動設定
    82:                call Strict(arg)  ! 無効なオプション指定時に警告を表示
    83:            
    84:                !"-N/-namelist" オプションの解釈
    85:                !  与えられていない場合はデフォルト値 (arare.conf) を 
    86:                !  NAMLIST ファイル名とする.
    87:                !
    88:                if (OPT_namelist) then
    89:                  if (myrank == 0) then
    90:                    call MessageNotify( "M", "main", &
    91:                      &                 "Namelist file is '%c'", c1=trim(VAL_namelist) )
    92:                  end if
    93:                  namelist_filename=trim(VAL_namelist)
    94:                else
    95:                  if (myrank == 0) then 
    96:                    call MessageNotify( "W", "main", &
    97:                      &                    "Namelist file is not specified." )
    98:                    call MessageNotify( "M", "main", &
    99:                      &                 "Use default Namelist file (arare.conf)." )
   100:                  end if
   101:                  namelist_filename="arare.conf"
   102:                end if
   103:            
   104:                call Close(arg)
   105:            
   106:                ! 確認
   107:                if (myrank == 0) then 
   108:                  call MessageNotify( "M",                  &
   109:                    &                 "argset_init",        &
   110:                    &                 "NAMELIST FILE = %c", &
   111:                    &                 c1=namelist_filename )
   112:                end if
   113:            
   114:              end subroutine argset_init
   115:            end module argset
