Class time_mod
In: src/shared/time/time.f90

Methods

time_init  

Included Modules

type_mod nmlfile_mod dc_trace dc_message

Public Instance methods

((< nmlfile_init >)) で指定されることが想定されているが、 もしもこの初期化ルーチンより以前に指定されていなければ、 ((< nmlfile_init >)) のデフォルトで指定される NAMELIST ファイルを 読む。

[Source]

  subroutine time_init
  !==== Dependency

                                                                 !=end
    implicit none
                                                                 !=begin
    !
    !==== NAMELIST
    !
    !InitTime に与えられた数値に DelTime を加えた値が、
    !CurrentTime に代入される。
    !
    namelist /time_nml/     InitTime      ,  DelTime       ,  StepInterval  ,  OutputStep    ,  tvar          ,  ttype         ,  tname         ,  tunit               ! 時刻の単位
                                                                 !=end

    !----- 作業用内部変数 -----
    integer(INTKIND)            :: nmlstat, nmlunit
    logical                     :: nmlreadable
    character(STRING), parameter:: subname = "time_init"

  continue

    !----------------------------------------------------------------
    !   Check Initialization
    !----------------------------------------------------------------
    call BeginSub(subname)
    if (time_initialized) then
       call EndSub( subname, '%c is already called', c1=trim(subname) )
       return
    else
       time_initialized = .true.
    endif

    !----------------------------------------------------------------
    !   Version identifier
    !----------------------------------------------------------------
    call DbgMessage('%c :: %c', c1=trim(version), c2=trim(tagname))

    !----------------------------------------------------------------
    !   read time_nml
    !----------------------------------------------------------------
    call nmlfile_init
    call nmlfile_open(nmlunit, nmlreadable)
    if (nmlreadable) then
       read(nmlunit, nml=time_nml, iostat=nmlstat)
       call DbgMessage('Stat of NAMELIST time_nml Input is <%d>',            i=(/nmlstat/))
       write(0, nml=time_nml)
    else
       call DbgMessage('Not Read NAMELIST time_nml')
       call MessageNotify('W', subname,  'Can not Read NAMELIST time_nml. Force Use Default Value.')
    end if
    call nmlfile_close

    !----------------------------------------------------------------
    !   Set CurrentTime
    !----------------------------------------------------------------
    CurrentTime = InitTime + DelTime

    call EndSub(subname)
  end subroutine time_init

[Validate]