| Class | timeset | 
| In: | 
                
                setup/timeset.f90
                
         | 
引数に与えられた NAMELIST ファイルから, 時刻に関する情報を取得し, 保管するための変数型モジュール
| Subroutine : | |
| cfgfile : | character(*), intent(in) | 
NAMELIST から必要な情報を読み取り, 時間関連の変数の設定を行う.
This procedure input/output NAMELIST#timeset_nml .
  subroutine timeset_init(cfgfile)
    !
    !NAMELIST から必要な情報を読み取り, 時間関連の変数の設定を行う. 
    !
    !暗黙の型宣言禁止
    implicit none
    !入力変数
    character(*), intent(in)      :: cfgfile
    !内部変数
    integer    :: unit
    integer    :: NumRStat = 10
    !---------------------------------------------------------------    
    ! NAMELIST から情報を取得
    !
    NAMELIST /timeset_nml/ DelTimeLong, DelTimeShort, IntegPeriod, Restarttime, DelTime, NumRStat
    
    call FileOpen(unit, file=cfgfile, mode='r')
    read(unit, NML=timeset_nml)
    close(unit)
    EndTime = RestartTime + IntegPeriod
    
    !---------------------------------------------------------------
    ! ループ回数の設定
    !
    NstepLong = nint( IntegPeriod / DelTimeLong )
    NstepShort = 2 * nint( DelTimeLong / DelTimeShort )
    NstepRStat = NstepLong / NumRStat
    !---------------------------------------------------------------
    ! 確認
    !
    if (myrank == 0) then
    
      !積分時間が長い時間ステップで割り切れない場合には警告を出す
      if(mod((IntegPeriod - Restarttime), DelTimeLong) /= 0) then 
        call MessageNotify( "W", "timeset_init", "mod((IntegPeriod - Restarttime), 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
      
      !長い時間ステップが短い時間ステップで割り切れない場合には警告を出す
      if(mod(NstepLong, NumRStat) /= 0) then 
        call MessageNotify( "W", "timeset_init", "mod(NstepLong, NumRStat) is not zero")
      end if
      
      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", "NstepShort = %d", i=(/NstepShort/) )
      call MessageNotify( "M", "timeset_init", "Restarttime = %f",  d=(/Restarttime/)  )
      call MessageNotify( "M", "timeset_init", "IntegPeriod = %f", d=(/IntegPeriod/) )
      call MessageNotify( "M", "timeset_init", "EndTime     = %f", d=(/EndTime/) )
    end if
   
  end subroutine timeset_init