gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Functions/Subroutines
hstnmlinfooutputstep.f90 File Reference

Checker of output timing . More...

Go to the source code of this file.

Functions/Subroutines

logical function hstnmlinfooutputstep (gthstnml, name, time)
 

Detailed Description

Checker of output timing

.

Author
Yasuhiro MORIKAWA

Definition in file hstnmlinfooutputstep.f90.

Function/Subroutine Documentation

◆ hstnmlinfooutputstep()

logical function hstnmlinfooutputstep ( type(gthst_nmlinfo), intent(in)  gthstnml,
character(*), intent(in)  name,
type(dc_difftime), intent(in)  time 
)

Check output timing of a variable

If time is the time that a variable name is output, .true. is returned, otherwise .false. is returned. When gthstnml is not initialized, .false. is returned too. When data corresponding to name is not found, .false. is returned too.

If gthstnml is not initialized by HstNmlInfoCreate yet, error is occurred.

Parameters
[in]gthstnmlgtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
[in]name変数名. 先頭の空白は無視されます. Variable identifier. Blanks at the head of the name are ignored.
[in]time現在時刻. Current time
Returns
出力タイミングであれば .true.

Definition at line 44 of file hstnmlinfooutputstep.f90.

48 use dc_date_types, only: dc_difftime
49 use dc_date_generic, only: dcdifftimecreate, mod, operator(==)
50 use dc_types, only: dp
51 implicit none
52 type(GTHST_NMLINFO), intent(in):: gthstnml
53 character(*), intent(in):: name
54 ! 変数名.
55 ! 先頭の空白は無視されます.
56 !
57 ! Variable identifier.
58 ! Blanks at the head of the name are ignored.
59 type(DC_DIFFTIME), intent(in):: time
60 ! 現在時刻. Current time
61
62 !-----------------------------------
63 ! 作業変数
64 ! Work variables
65 type(GTHST_NMLINFO_ENTRY), pointer:: hptr =>null()
66 type(DC_DIFFTIME):: interval_time
67!!$ character(*), parameter:: subname = 'HstNmlInfoOutputStep'
68 continue
69
70 result = .false.
71
72 !-----------------------------------------------------------------
73 ! 初期設定のチェック
74 ! Check initialization
75 !-----------------------------------------------------------------
76 if ( .not. gthstnml % initialized ) goto 999
77
78 !-----------------------------------------------------------------
79 ! 情報格納変数への結合
80 ! Associate a variable storing information
81 !-----------------------------------------------------------------
82 hptr => gthstnml % gthstnml_list
83 call listsearch( gthstnml_list = hptr, & ! (inout)
84 & name = name ) ! (in)
85
86 if ( .not. associated( hptr ) ) goto 999
87 if ( hptr % output_step_disable ) goto 999
88
89 !-----------------------------------------------------------------
90 ! 時刻のチェック
91 ! Check time
92 !-----------------------------------------------------------------
93 if ( .not. hptr % interval_value > 0.0 ) goto 999
94
95 call dcdifftimecreate( &
96 & diff = interval_time, & ! (out)
97 & value = real( hptr % interval_value, dp ), & ! (in)
98 & unit = hptr % interval_unit ) ! (in)
99
100 if ( mod( time, interval_time ) == 0 ) then
101 result = .true.
102 end if
103
104 !-----------------------------------------------------------------
105 ! 終了処理, 例外処理
106 ! Termination and Exception handling
107 !-----------------------------------------------------------------
108999 continue
109 nullify( hptr )
Interface declarations for procedures provided from dc_date.
Derived types and parameters for date and time.
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92

References dc_types::dp.