Loading...
Searching...
No Matches
hstnmlinfoinquire.f90
Go to the documentation of this file.
1!= "GTHST_NMLINFO" 変数の出力情報を問い合わせ
2!= Inquire output information of a "GTHST_NMLINFO" variable
3!
4! Authors:: Yasuhiro MORIKAWA
5! Version:: $Id: hstnmlinfoinquire.f90,v 1.2 2009-10-10 10:59:00 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 subroutine hstnmlinfoinquire( gthstnml, &
11 & name, &
12 & file, &
13 & interval_value, &
14 & interval_unit, &
15 & precision, &
16 & time_average, average, &
17 & fileprefix, &
18 & origin_value, origin_unit, &
19 & terminus_value, terminus_unit, &
20 & slice_start, slice_end, slice_stride, &
21 & space_average, &
22 & newfile_intvalue, newfile_intunit, &
23 & err )
24 !
25 ! 変数の出力情報を問い合わせます.
26 !
27 ! デフォルト値を取得するには, *name* を与えないか, または
28 ! *name* に空白を与えてください.
29 !
30 ! *name* に関するデータが存在しない場合, エラーを発生させます.
31 !
32 ! なお, 与えられた *gthstnml* が HstNmlInfoCreate によって初期設定
33 ! されていない場合, プログラムはエラーを発生させます.
34 !
35 ! Inquire output information of a variable.
36 !
37 ! If data correspond to *name* is not found,
38 ! error is occurred.
39 !
40 ! If *gthstnml* is not initialized by "HstNmlInfoCreate" yet,
41 ! error is occurred.
42 !
45 use dc_trace, only: beginsub, endsub
46 use dc_string, only: putline, printf, split, strinclude, stoa, joinchar
47 use dc_present, only: present_and_not_empty, present_and_true
48 use dc_types, only: dp, string, token, stdout
50 implicit none
51 type(gthst_nmlinfo), intent(in):: gthstnml
52 character(*), intent(in), optional:: name
53 ! 変数名.
54 ! 先頭の空白は無視されます.
55 !
56 ! Variable identifier.
57 ! Blanks at the head of the name are ignored.
58 character(*), intent(out), optional:: file
59 ! ヒストリデータのファイル名.
60 ! History data filenames
61 real(DP), intent(out), optional:: interval_value
62 ! ヒストリデータの出力間隔の数値.
63 ! 負の値を与えると, 出力を抑止します.
64 !
65 ! Numerical value for interval of history data output.
66 ! Negative values suppresses output.
67 character(*), intent(out), optional:: interval_unit
68 ! ヒストリデータの出力間隔の単位.
69 ! Unit for interval of history data output
70 character(*), intent(out), optional:: precision
71 ! ヒストリデータの精度.
72 ! Precision of history data
73 logical, intent(out), optional:: time_average
74 ! 出力データの時間平均化フラグ.
75 ! Flag for time average of output data.
76 logical, intent(out), optional:: average
77 ! time_average の旧版.
78 ! Old version of "time_average"
79 character(*), intent(out), optional:: fileprefix
80 ! ヒストリデータのファイル名の接頭詞.
81 ! Prefixes of history data filenames
82 real(DP), intent(out), optional:: origin_value
83 ! 出力開始時刻.
84 ! Start time of output.
85 character(*), intent(out), optional:: origin_unit
86 ! 出力開始時刻の単位.
87 ! Unit of start time of output.
88 real(DP), intent(out), optional:: terminus_value
89 ! 出力終了時刻.
90 ! End time of output.
91 character(*), intent(out), optional:: terminus_unit
92 ! 出力終了時刻の単位.
93 ! Unit of end time of output.
94 integer, intent(out), optional:: slice_start(:)
95 ! 空間方向の開始点.
96 ! Start points of spaces.
97 integer, intent(out), optional:: slice_end(:)
98 ! 空間方向の終了点.
99 ! End points of spaces.
100 integer, intent(out), optional:: slice_stride(:)
101 ! 空間方向の刻み幅.
102 ! Strides of spaces.
103 logical, intent(out), optional:: space_average(:)
104 ! 平均化のフラグ.
105 ! Flag of average.
106 integer, intent(out), optional:: newfile_intvalue
107 ! ファイル分割時間間隔.
108 ! Interval of time of separation of a file.
109 character(*), intent(out), optional:: newfile_intunit
110 ! ファイル分割時間間隔の単位.
111 ! Unit of interval of time of separation of a file.
112
113 logical, intent(out), optional:: err
114 ! 例外処理用フラグ.
115 ! デフォルトでは, この手続き内でエラーが
116 ! 生じた場合, プログラムは強制終了します.
117 ! 引数 *err* が与えられる場合,
118 ! プログラムは強制終了せず, 代わりに
119 ! *err* に .true. が代入されます.
120 !
121 ! Exception handling flag.
122 ! By default, when error occur in
123 ! this procedure, the program aborts.
124 ! If this *err* argument is given,
125 ! .true. is substituted to *err* and
126 ! the program does not abort.
127
128 !-----------------------------------
129 ! 作業変数
130 ! Work variables
131 type(gthst_nmlinfo_entry), pointer:: hptr =>null()
132 character(STRING):: name_work
133 integer:: stat, ary_size
134 character(STRING):: cause_c
135 character(*), parameter:: subname = 'HstNmlInfoInquire'
136 continue
137 call beginsub( subname )
138 stat = dc_noerr
139 cause_c = ''
140
141 !-----------------------------------------------------------------
142 ! 初期設定のチェック
143 ! Check initialization
144 !-----------------------------------------------------------------
145 if ( .not. gthstnml % initialized ) then
146 stat = dc_enotinit
147 cause_c = 'GTHST_NMLINFO'
148 goto 999
149 end if
150
151 !-----------------------------------------------------------------
152 ! *gthstnml* 内から, *name* に関する情報を探査.
153 ! Search information correspond to *name* in *gthstnml*
154 !-----------------------------------------------------------------
155 if ( present(name) ) then
156 name_work = name
157 else
158 name_work = ''
159 end if
160 hptr => gthstnml % gthstnml_list
161 call listsearch( gthstnml_list = hptr, & ! (inout)
162 & name = name_work ) ! (in)
163
164 if ( .not. associated( hptr ) ) then
165 stat = dc_enoentry
166 cause_c = adjustl( name_work )
167 goto 999
168 end if
169
170 if ( hptr % name == '' ) then
171 if ( present(file) ) file = ''
172 else
173 if ( present(file) ) file = trim( hptr % fileprefix ) // hptr % file
174 end if
175 if ( present(interval_value) ) interval_value = hptr % interval_value
176 if ( present(interval_unit) ) interval_unit = hptr % interval_unit
177 if ( present(precision) ) precision = hptr % precision
178 if ( present(average) ) average = hptr % time_average
179 if ( present(time_average) ) time_average = hptr % time_average
180 if ( present(fileprefix) ) fileprefix = hptr % fileprefix
181
182 if ( present(origin_value ) ) origin_value = hptr % origin_value
183 if ( present(origin_unit ) ) origin_unit = hptr % origin_unit
184 if ( present(terminus_value ) ) terminus_value = hptr % terminus_value
185 if ( present(terminus_unit ) ) terminus_unit = hptr % terminus_unit
186 if ( present(slice_start ) ) then
187 ary_size = size(slice_start)
188 slice_start = hptr % slice_start(1:ary_size)
189 end if
190 if ( present(slice_end ) ) then
191 ary_size = size(slice_end)
192 slice_end = hptr % slice_end(1:ary_size)
193 end if
194 if ( present(slice_stride ) ) then
195 ary_size = size(slice_stride)
196 slice_stride = hptr % slice_stride(1:ary_size)
197 end if
198 if ( present(space_average ) ) then
199 ary_size = size(space_average)
200 space_average = hptr % space_average(1:ary_size)
201 end if
202 if ( present(newfile_intvalue) ) newfile_intvalue = hptr % newfile_intvalue
203 if ( present(newfile_intunit ) ) newfile_intunit = hptr % newfile_intunit
204
205 nullify( hptr )
206
207 !-----------------------------------------------------------------
208 ! 終了処理, 例外処理
209 ! Termination and Exception handling
210 !-----------------------------------------------------------------
211999 continue
212 call storeerror( stat, subname, err, cause_c )
213 call endsub( subname )
214 end subroutine hstnmlinfoinquire
subroutine hstnmlinfoinquire(gthstnml, name, file, interval_value, interval_unit, precision, time_average, average, fileprefix, origin_value, origin_unit, terminus_value, terminus_unit, slice_start, slice_end, slice_stride, space_average, newfile_intvalue, newfile_intunit, err)
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:830
integer, parameter, public dc_enotinit
Definition dc_error.f90:557
integer, parameter, public dc_earglack
Definition dc_error.f90:569
integer, parameter, public dc_noerr
Definition dc_error.f90:509
integer, parameter, public dc_enoentry
Definition dc_error.f90:571
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:98
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:109
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:83
integer, parameter, public string
Character length for string
Definition dc_types.f90:118