Loading...
Searching...
No Matches
hstnmlinfooutputvalid.f90
Go to the documentation of this file.
1!= 出力の有効性のチェック
2!= Checker of output validation
3!
4! Authors:: Yasuhiro MORIKAWA
5! Version:: $Id: hstnmlinfooutputvalid.f90,v 1.1 2009-05-11 15:15:14 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 hstnmlinfooutputvalid( gthstnml, &
11 & name ) result(result)
12 !
13 ! 変数 *name* の出力が有効であれば,
14 ! .true. を, そうでなければ .false. を返します.
15 ! 出力が有効であるかどうかは, 出力間隔 *interval_value* の
16 ! 正負によって判定されます. 正の場合が有効, 負の場合が無効です.
17 ! *gthstnml* が初期設定されていない場合にも .false. が返ります.
18 ! *name* に関するデータが存在しない場合にも .false. が返ります.
19 !
20 ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
21 ! されていない場合, プログラムはエラーを発生させます.
22 !
23 ! If output of a variable *name* is valid,
24 ! .true. is returned, otherwise .false. is returned.
25 ! Whether output is valid or not is judged with positive or negative
26 ! of *interval_value*. Positive is valid, and negative is invalid.
27 ! When *gthstnml* is not initialized, .false. is returned too.
28 ! When data correspond to *name* is not found, .false. is returned too.
29 !
30 ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
31 ! error is occurred.
32 !
35 use dc_string, only: putline, printf, split, strinclude, stoa, joinchar
36 use dc_present, only: present_and_not_empty, present_and_true
37 use dc_date_types, only: dc_difftime
38 use dc_types, only: dp, string, token, stdout
39 implicit none
40 type(gthst_nmlinfo), intent(in):: gthstnml
41 character(*), intent(in):: name
42 ! 変数名.
43 ! 先頭の空白は無視されます.
44 !
45 ! Variable identifier.
46 ! Blanks at the head of the name are ignored.
47
48 !-----------------------------------
49 ! 作業変数
50 ! Work variables
51 type(gthst_nmlinfo_entry), pointer:: hptr =>null()
52!!$ character(*), parameter:: subname = 'HstNmlInfoOutputValid'
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
73 !-----------------------------------------------------------------
74 ! 出力の有効性のチェック
75 ! Check validity of output
76 !-----------------------------------------------------------------
77 if ( hptr % interval_value > 0.0 ) then
78 result = .true.
79 goto 999
80 end if
81
82 !-----------------------------------------------------------------
83 ! 終了処理, 例外処理
84 ! Termination and Exception handling
85 !-----------------------------------------------------------------
86999 continue
87 nullify( hptr )
88 end function hstnmlinfooutputvalid
logical function hstnmlinfooutputvalid(gthstnml, name)
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109
integer, parameter, public string
Character length for string
Definition dc_types.f90:118
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:98
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83