Class argset
In: setup/argset.f90

Methods

Included Modules

dc_types dc_string dc_args dc_message

Public Instance methods

OPT_namelist
Variable :
OPT_namelist :logical
: コマンドライン引数用論理変数
VAL_namelist
Variable :
VAL_namelist :character(STRING)
: コマンドライン引数の値
arg
Variable :
arg :type(ARGS)
: コマンドライン引数情報
Subroutine :
cfgfile :character(*), intent(out)

コマンドライン引数を解釈して, 引数に与えられた NAMELIST ファイル名 を返す.

[Source]

  subroutine argset_init(cfgfile)
    !
    !コマンドライン引数を解釈して, 引数に与えられた NAMELIST ファイル名
    !を返す. 
    !

    !暗黙の型宣言禁止
    implicit none

    !入力変数
    character(*), intent(out)     :: cfgfile

    !NAMELIST ファイルの取得
    !  gtool5 ライブラリの dc_args モジュールを利用.
    !  指定可能なオプションは以下の通り.
    !
    !  -N=VAL, --namelist=VAL
    !    specify Namelist file (default is 'arare.conf'). 
    !
    !  -D=VAL, --debug=VAL
    !    call dc_trace#SetDebug (display a lot of messages for debug).
    !    VAL is unit number (default is standard output)
    !
    !  -h=VAL, -H=VAL, --help=VAL
    !    display this help and exit. VAL is unit number (default is
    !    standard output)
    !
    call Open(arg)
    call Option(arg, StoA('-N', '--namelist'), OPT_namelist, VAL_namelist, help="specify Namelist file (default is 'arare.conf')." )
                      ! "-N/--namelist" オプションの設定
    call Debug(arg)   ! デバッグオプションの自動設定
    call Help(arg)    ! ヘルプオプションの自動設定
    call Strict(arg)  ! 無効なオプション指定時に警告を表示

    !"-N/-namelist" オプションの解釈
    !  与えられていない場合はデフォルト値 (arare.conf) を 
    !  NAMLIST ファイル名とする.
    !
    if (OPT_namelist) then
!      call MessageNotify( "M", "main", &
!        &                 "Namelist file is '%c'", c1=trim(VAL_namelist) )
      cfgfile=trim(VAL_namelist)
    else
      call MessageNotify( "W", "main", "Namelist file is not specified." )
      call MessageNotify( "M", "main", "Use default Namelist file (arare.conf)." )
      cfgfile="arare.conf"
    end if

    call Close(arg)

!    ! 確認
!    call MessageNotify( "M",                  &
!      &                 "argset_init",        &
!      &                 "NAMELIST FILE = %c", &
!      &                 c1=cfgfile )

  end subroutine argset_init