Class timeset
In: setup/timeset.f90

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

Methods

Included Modules

dc_types dc_iounit dc_message DebugSet

Public Instance methods

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

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

This procedure input/output NAMELIST#timeset .

[Source]

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

    !暗黙の型宣言禁止
    implicit none

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

    !内部変数
    integer                       :: unit
    
    !NAMELIST から情報を取得
    NAMELIST /timeset/ DelTimeLong, DelTimeShort, TimeInt, TimeDisp, DayTime
    
    call FileOpen(unit, file=cfgfile, mode='r')
    read(unit, NML=timeset)
    close(unit)

    !---------------------------------------------------------------
    ! エラー処理
    !   DelTimeShort < DelTimeLong =< TimeDisp =< TimeInt でない場合, 
    !   エラーを返し終了
    !---------------------------------------------------------------
    if ( TimeDisp > TimeInt ) then
      call MessageNotify( "E", "timeset_init", "TimeInt is smaller than TimeDisp" )
    else if ( DelTimeLong > TimeDisp ) then 
      call MessageNotify( "E", "timeset_init", "TimeDisp is smaller than DelTimeLong" )
    else if ( DelTimeShort > DelTimeLong ) then 
      call MessageNotify( "E", "timeset_init", "DelTimeLong is smaller than DelTimeShort" )
    end if


    !---------------------------------------------------------------
    ! ループ回数の設定
    !---------------------------------------------------------------
    NstepLong = nint( TimeInt / DelTimeLong )
    NstepShort = 2 * nint( DelTimeLong / DelTimeShort )
    
    !積分時間が長い時間ステップで割り切れない場合には警告を出す
    if(mod(TimeInt, DelTimeLong) /= 0) then 
      call MessageNotify( "W", "timeset_init", "mod(TimeInt, DelTimeLong) is not zero")
    end if
    
    !長い時間ステップが短い時間ステップで割り切れない場合には警告を出す
    if(mod(DelTimeLong, DelTimeShort) /= 0) then 
      call MessageNotify( "W", "timeset_init", "mod(DelTimeLong, DelTimeShort) is not zero")
    end if
    
    !出力するまでのステップ数を求める
    NStepDisp = nint( TimeDisp / DelTimeLong ) 
    if(mod(TimeDisp, DelTimeLong) /= 0) then 
      call MessageNotify( "W", "timeset_init", "mod(TimeDisp, DelTimeLong) is not zero")
    end if
    if(mod(NstepLong, NstepDisp) /= 0) then 
      call MessageNotify( "W", "timeset_init", "mod(NstepLong, NstepDisp) is not zero")
    end if
       
    !---------------------------------------------------------------
    ! 確認
    !---------------------------------------------------------------
    if (cpurank == 0) then
      call MessageNotify( "M", "timeset_init", "DelTimeLong = %f", d=(/DelTimeLong/) )
      call MessageNotify( "M", "timeset_init", "DelTimeShort = %f", d=(/DelTimeShort/) )
      call MessageNotify( "M", "timeset_init", "NstepLong = %d", i=(/NstepLong/) )
      call MessageNotify( "M", "timeset_init", "NstepDisp = %d", i=(/NstepDisp/) )
      call MessageNotify( "M", "timeset_init", "NstepShort = %d", i=(/NstepShort/) )
      call MessageNotify( "M", "timeset_init", "TimeInt = %f",  d=(/TimeInt/)  )
      call MessageNotify( "M", "timeset_init", "TimeDisp= %f", d=(/TimeDisp/) )
      call MessageNotify( "M", "timeset_init", "DayTime= %f",  d=(/DayTime/)  )
    end if
   
  end subroutine timeset_init