Class timeset
In: setup/timeset.f90

    Copyright (C) GFD Dennou Club, 2004, 2005, 2006. All rights reserved.

Module TimeSet

  * Developer: SUGIYAMA Ko-ichiro
  * Version: $Id: timeset.f90,v 1.1.1.1 2006/04/25 03:43:58 deepconv Exp $
  * Tag Name: $Name:  $
  * Change History:

Overview

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

Error Handling

Known Bugs

Note

Future Plans

Methods

Included Modules

dc_message

Public Instance methods

[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

[Validate]