| Class | time_mod |
| In: |
shared/time.f90
|
| Subroutine : |
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 : |
This procedure input/output NAMELIST#time_nml .
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 : |
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
| Variable : | |||
| tname = ‘time’ : | character(STRING), save
|
| Variable : | |||
| ttype = ‘float’ : | character(STRING), save
|
| Variable : | |||
| tunit = ‘seconds’ : | character(STRING), save
|
| Variable : | |||
| tvar = ‘time’ : | character(STRING), save
|