Class time_mod
In: shared/time.f90

begin

Dependency

Methods

Included Modules

type_mod nmlfile_mod dc_trace dc_message

Public Instance methods

CurrentLoop()
Variable :
CurrentLoop = 1 :integer(INTKIND) , save
: 現在のループ回数 =end
CurrentTime()
Variable :
CurrentTime = 0.0 :real(DBKIND) , save
: 現在時刻
DelTime()
Variable :
DelTime = 300 :real(DBKIND) , save
: 時間ステップ
InitTime()
Variable :
InitTime = 0.0 :real(DBKIND) , save
: 時間ステップ
OutputStep()
Variable :
OutputStep = 1 :integer(INTKIND) , save
: 出力回数
StepInterval()
Variable :
StepInterval = 1 :integer(INTKIND) , save
: 出力回数
Subroutine :

Dependency

[Source]

  subroutine time_end
  !==== Dependency
    use type_mod,    only : STRING
    use dc_trace,    only : BeginSub, EndSub, DbgMessage
                                                                 !=end
    implicit none

    !-----------------------------------------------------------------
    !   変数定義
    !-----------------------------------------------------------------
    !----- 作業用内部変数 -----
    character(STRING),  parameter:: subname = "time_end"
  continue

    !-----------------------------------------------------------------
    !   Check Initialization
    !-----------------------------------------------------------------
    call BeginSub(subname)
    if ( .not. time_initialized) then
       call EndSub( subname, 'time_init was not called', c1=trim(subname) )
       return
    else
       time_initialized = .false.
    endif

    !----------------------------------------------------------------
    !   Reset to default value
    !----------------------------------------------------------------
    InitTime = 0.0      ! 積分開始時刻
    DelTime  = 300      ! 時間ステップ

    StepInterval = 1    ! 出力ステップ間隔
    OutputStep   = 1    ! 出力回数

    tvar  = 'time'      ! 時刻変数名
    ttype = 'float'     ! 時刻変数の型
    tname = 'time'      ! 時刻の名称
    tunit = 'seconds'   ! 時刻の単位

    CurrentTime = 0.0   ! 現在時刻
    CurrentLoop = 1     ! 現在のループ回数


    call EndSub(subname)
  end subroutine time_end
Subroutine :

Dependency

This procedure input/output NAMELIST#time_nml .

[Source]

  subroutine time_init
  !==== Dependency
    use type_mod,    only : REKIND, DBKIND, INTKIND, TOKEN, STRING
    use nmlfile_mod, only : nmlfile_init, nmlfile_open, nmlfile_close
    use dc_trace,    only : BeginSub, EndSub, DbgMessage
    use dc_message,  only : MessageNotify
                                                                 !=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
Subroutine :

Dependency

[Source]

  subroutine time_progress
  !==== Dependency
    use type_mod,    only : STRING
    use dc_trace,    only : BeginSub, EndSub, DbgMessage
                                                                 !=end
    implicit none

    !-----------------------------------------------------------------
    !   変数定義
    !-----------------------------------------------------------------
    !----- 作業用内部変数 -----
    character(STRING),  parameter:: subname = "time_progress"
  continue

    !-----------------------------------------------------------------
    !   Check Initialization
    !-----------------------------------------------------------------
    call BeginSub(subname)
    if (.not. time_initialized) then
       call EndSub( subname, 'Call time_init before call %c', c1=trim(subname) )
       return
    endif

    !----------------------------------------------------------------
    !   Set CurrentTime and CurrentLoop
    !----------------------------------------------------------------
    CurrentTime = CurrentTime + DelTime
    CurrentLoop = CurrentLoop + 1

    call EndSub(subname, 'CurrentLoop=<%d>, CurrentTime=<%f>', i=(/CurrentLoop/), d=(/CurrentTime/))
  end subroutine time_progress
tname()
Variable :
tname = ‘time’ :character(STRING), save
: 時刻の単位

現在の時刻やループ回数を保持してある変数。 ((< time_init >)) で初期設定され、((< time_progress >)) で更新される。

ttype()
Variable :
ttype = ‘float’ :character(STRING), save
: 時刻の単位

現在の時刻やループ回数を保持してある変数。 ((< time_init >)) で初期設定され、((< time_progress >)) で更新される。

tunit()
Variable :
tunit = ‘seconds’ :character(STRING), save
: 時刻の単位

現在の時刻やループ回数を保持してある変数。 ((< time_init >)) で初期設定され、((< time_progress >)) で更新される。

tvar()
Variable :
tvar = ‘time’ :character(STRING), save
: 時刻の単位

現在の時刻やループ回数を保持してある変数。 ((< time_init >)) で初期設定され、((< time_progress >)) で更新される。

[Validate]