Loading...
Searching...
No Matches
hstnmlinfooutputstep.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

logical function hstnmlinfooutputstep (gthstnml, name, time)

Function/Subroutine Documentation

◆ hstnmlinfooutputstep()

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

Definition at line 10 of file hstnmlinfooutputstep.f90.

12 !
13 ! *time* が変数 *name* の出力されるタイミングであれば
14 ! .true. を, そうでなければ .false. を返します.
15 ! *gthstnml* が初期設定されていない場合にも .false. が返ります.
16 ! *name* に関するデータが存在しない場合にも .false. が返ります.
17 !
18 ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
19 ! されていない場合, プログラムはエラーを発生させます.
20 !
21 ! If *time* is the time that a variable *name* is output,
22 ! .true. is returned, otherwise .false. is returned
23 ! When *gthstnml* is not initialized, .false. is returned too.
24 ! When data correspond to *name* is not found, .false. is returned too.
25 !
26 ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
27 ! error is occurred.
28 !
31 use dc_string, only: putline, printf, split, strinclude, stoa, joinchar
32 use dc_present, only: present_and_not_empty, present_and_true
33 use dc_date_types, only: dc_difftime
34 use dc_date_generic, only: dcdifftimecreate, mod, operator(==), tochar
35 use dc_types, only: dp, string, token, stdout
36 implicit none
37 type(GTHST_NMLINFO), intent(in):: gthstnml
38 character(*), intent(in):: name
39 ! 変数名.
40 ! 先頭の空白は無視されます.
41 !
42 ! Variable identifier.
43 ! Blanks at the head of the name are ignored.
44 type(DC_DIFFTIME), intent(in):: time
45 ! 現在時刻. Current time
46
47 !-----------------------------------
48 ! 作業変数
49 ! Work variables
50 type(GTHST_NMLINFO_ENTRY), pointer:: hptr =>null()
51 type(DC_DIFFTIME):: interval_time
52!!$ character(*), parameter:: subname = 'HstNmlInfoOutputStep'
53 continue
54
55 result = .false.
56
57 !-----------------------------------------------------------------
58 ! 初期設定のチェック
59 ! Check initialization
60 !-----------------------------------------------------------------
61 if ( .not. gthstnml % initialized ) goto 999
62
63 !-----------------------------------------------------------------
64 ! 情報格納変数への結合
65 ! Associate a variable storing information
66 !-----------------------------------------------------------------
67 hptr => gthstnml % gthstnml_list
68 call listsearch( gthstnml_list = hptr, & ! (inout)
69 & name = name ) ! (in)
70
71 if ( .not. associated( hptr ) ) goto 999
72 if ( hptr % output_step_disable ) goto 999
73
74 !-----------------------------------------------------------------
75 ! 時刻のチェック
76 ! Check time
77 !-----------------------------------------------------------------
78 if ( .not. hptr % interval_value > 0.0 ) goto 999
79
80 call dcdifftimecreate( &
81 & diff = interval_time, & ! (out)
82 & value = real( hptr % interval_value, dp ), & ! (in)
83 & unit = hptr % interval_unit ) ! (in)
84
85 if ( mod( time, interval_time ) == 0 ) then
86 result = .true.
87 end if
88
89 !-----------------------------------------------------------------
90 ! 終了処理, 例外処理
91 ! Termination and Exception handling
92 !-----------------------------------------------------------------
93999 continue
94 nullify( hptr )
種別型パラメタを提供します。
Definition dc_types.f90:49
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition dc_types.f90:109
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:118
integer, parameter, public stdout
標準出力の装置番号
Definition dc_types.f90:98
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:83

References dc_types::dp, dc_types::stdout, dc_types::string, and dc_types::token.