Class timeset
In: setup/timeset.f90

引数に与えられた NAMELIST ファイルから, 時刻に関する情報を取得し, 保管するための変数型モジュール

Methods

Included Modules

dc_message

Public Instance methods

DayTime()
Variable :
DayTime :real(8)
: 1 日の長さ [s]
DelTimeLong()
Variable :
DelTimeLong :real(8)
: 長いタイムステップ
DelTimeShort()
Variable :
DelTimeShort :real(8)
: 短いタイムステップ
NstepLong()
Variable :
NstepLong :integer
: 長いタイムステップのステップ数
NstepShort()
Variable :
NstepShort :integer
: 短いタイムステップのステップ数
TimeDisp()
Variable :
TimeDisp :real(8)
: ファイル出力する時間間隔
TimeInt()
Variable :
TimeInt :real(8)
: 積分時間
Subroutine :
cfgfile :character(*), intent(in)

NAMELIST から必要な情報を読み取り, 時間関連の変数の設定を行う.

This procedure input/output NAMELIST#timeset .

[Source]

  subroutine timeset_init(cfgfile)
    !
    !NAMELIST から必要な情報を読み取り, 時間関連の変数の設定を行う. 
    !

    !モジュール読み込み
    use dc_message,    only: MessageNotify

    !暗黙の型宣言禁止
    implicit none

    !入力変数
    character(*), intent(in) :: cfgfile
    
    !NAMELIST から情報を取得
    NAMELIST /timeset/ DelTimeLong, DelTimeShort, TimeInt, TimeDisp, DayTime
    
    open (10, FILE=cfgfile)
    read(10, NML=timeset)
    close(10)

    !---------------------------------------------------------------
    ! ループ回数の設定
    !---------------------------------------------------------------
    NstepLong = nint( TimeInt / DelTimeLong )
    NstepShort = 2 * nint( DelTimeLong / DelTimeShort )
    
    !積分時間が長い時間ステップで割り切れない場合には警告を出す
    if(mod(TimeInt, DelTimeLong) /= 0) then 
      call MessageNotify("Message", "timeset_init", "mod(TimeInt, DelTimeLong) is not zero")
    end if
    
    !長い時間ステップが短い時間ステップで割り切れない場合には警告を出す
    if(mod(DelTimeLong, DelTimeShort) /= 0) then 
      call MessageNotify("Message", "timeset_init", "mod(DelTimeLong, DelTimeShort) is not zero")
    end if
    
    !積分時間が出力時間間隔で割り切れない場合には警告を出す
    if(mod(TimeDisp, DelTimeLong) /= 0) then 
      call MessageNotify("Message", "timeset_init", "mod(TimeDisp, DelTimeLong) is not zero")
    end if
        
    !---------------------------------------------------------------
    ! 確認
    !---------------------------------------------------------------
    write(*,*) "timeset_init, DelTimeLong ", DelTimeLong
    write(*,*) "timeset_init, DelTimeShort", DelTimeShort
    write(*,*) "timeset_init, NstepLong   ", NstepLong
    write(*,*) "timeset_init, NstepShort  ", NstepShort
    write(*,*) "timeset_init, TimeInt     ", TimeInt
    write(*,*) "timeset_init, TimeDisp    ", TimeDisp
    write(*,*) "dataset_init, DayTime     ", DayTime
   
  end subroutine timeset_init

[Validate]