hstnmlinfooutputstep.f90
Go to the documentation of this file.
1 != 出力タイミングのチェック
2 != Checker of output timing
3 !
4 ! Authors:: Yasuhiro MORIKAWA
5 ! Version:: $Id: hstnmlinfooutputstep.f90,v 1.2 2009-05-31 12:08:02 morikawa Exp $
6 ! Tag Name:: $Name: $
7 ! Copyright:: Copyright (C) GFD Dennou Club, 2007-2009. All rights reserved.
8 ! License:: See COPYRIGHT[link:../../../COPYRIGHT]
9 !
10  logical function hstnmlinfooutputstep( gthstnml, &
11  & name, time ) result(result)
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  !
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  !-----------------------------------------------------------------
93 999 continue
94  nullify( hptr )
95  end function hstnmlinfooutputstep
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
Definition: dc_types.f90:109
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
logical function hstnmlinfooutputstep(gthstnml, name, time)
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
logical function, public present_and_not_empty(arg)
Definition: dc_present.f90:276
integer, parameter, public stdout
標準出力の装置番号
Definition: dc_types.f90:98
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118