gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
hstnmlinfoinquire.f90
Go to the documentation of this file.
1!> @file hstnmlinfoinquire.f90
2!>
3!> @author Yasuhiro MORIKAWA
4!> @copyright Copyright (C) GFD Dennou Club, 2007-2026. All rights reserved. <br/>
5!> License is BSD-2-Clause. See [COPYRIGHT](@ref COPYRIGHT) in detail
6!>
7!> @en
8!> @brief Inquire output information of a gtool_history_nmlinfo_types::GTHST_NMLINFO variable
9!> @enden
10!>
11!> @ja
12!> @brief gtool_history_nmlinfo_types::GTHST_NMLINFO 変数の出力情報を問い合わせ
13!> @endja
14
15 !> @en
16 !> @brief Inquire output information of a variable
17 !>
18 !> Inquire output information of a variable.
19 !>
20 !> If data corresponding to @p name is not found,
21 !> error is occurred.
22 !>
23 !> If @p gthstnml is not initialized by HstNmlInfoCreate yet,
24 !> error is occurred.
25 !> @enden
26 !>
27 !> @ja
28 !> @brief 変数の出力情報を問い合わせる
29 !>
30 !> 変数の出力情報を問い合わせます.
31 !>
32 !> デフォルト値を取得するには, @p name を与えないか, または
33 !> @p name に空白を与えてください.
34 !>
35 !> @p name に関するデータが存在しない場合, エラーを発生させます.
36 !>
37 !> なお, 与えられた @p gthstnml が HstNmlInfoCreate によって初期設定
38 !> されていない場合, プログラムはエラーを発生させます.
39 !> @endja
40 !>
41 !> @param[in] gthstnml gtool_history_nmlinfo_types::GTHST_NMLINFO 型変数
42 !> @param[in] name 変数名 (optional). Variable identifier.
43 !> @param[out] file ヒストリデータのファイル名 (optional). History data filename.
44 !> @param[out] interval_value 出力間隔の数値 (optional). Numerical value for interval.
45 !> @param[out] interval_unit 出力間隔の単位 (optional). Unit for interval.
46 !> @param[out] precision 精度 (optional). Precision.
47 !> @param[out] time_average 時間平均化フラグ (optional). Flag for time average.
48 !> @param[out] average time_average の旧版 (optional). Old version of time_average.
49 !> @param[out] fileprefix ファイル名の接頭詞 (optional). Prefixes of filenames.
50 !> @param[out] origin_value 出力開始時刻 (optional). Start time of output.
51 !> @param[out] origin_unit 出力開始時刻の単位 (optional). Unit of start time.
52 !> @param[out] terminus_value 出力終了時刻 (optional). End time of output.
53 !> @param[out] terminus_unit 出力終了時刻の単位 (optional). Unit of end time.
54 !> @param[out] slice_start 空間方向の開始点 (optional). Start points of spaces.
55 !> @param[out] slice_end 空間方向の終了点 (optional). End points of spaces.
56 !> @param[out] slice_stride 空間方向の刻み幅 (optional). Strides of spaces.
57 !> @param[out] space_average 平均化のフラグ (optional). Flag of average.
58 !> @param[out] newfile_intvalue ファイル分割時間間隔 (optional). Interval of file separation.
59 !> @param[out] newfile_intunit ファイル分割時間間隔の単位 (optional). Unit of file separation interval.
60 !> @param[out] err 例外処理用フラグ. Exception handling flag.
61 subroutine hstnmlinfoinquire( gthstnml, &
62 & name, &
63 & file, &
64 & interval_value, &
65 & interval_unit, &
66 & precision, &
67 & time_average, average, &
68 & fileprefix, &
69 & origin_value, origin_unit, &
70 & terminus_value, terminus_unit, &
71 & slice_start, slice_end, slice_stride, &
72 & space_average, &
73 & newfile_intvalue, newfile_intunit, &
74 & err )
77 use dc_trace, only: beginsub, endsub
78 use dc_types, only: dp, string
80 implicit none
81 type(gthst_nmlinfo), intent(in):: gthstnml
82 character(*), intent(in), optional:: name
83 ! 変数名.
84 ! 先頭の空白は無視されます.
85 !
86 ! Variable identifier.
87 ! Blanks at the head of the name are ignored.
88 character(*), intent(out), optional:: file
89 ! ヒストリデータのファイル名.
90 ! History data filenames
91 real(DP), intent(out), optional:: interval_value
92 ! ヒストリデータの出力間隔の数値.
93 ! 負の値を与えると, 出力を抑止します.
94 !
95 ! Numerical value for interval of history data output.
96 ! Negative values suppresses output.
97 character(*), intent(out), optional:: interval_unit
98 ! ヒストリデータの出力間隔の単位.
99 ! Unit for interval of history data output
100 character(*), intent(out), optional:: precision
101 ! ヒストリデータの精度.
102 ! Precision of history data
103 logical, intent(out), optional:: time_average
104 ! 出力データの時間平均化フラグ.
105 ! Flag for time average of output data.
106 logical, intent(out), optional:: average
107 ! time_average の旧版.
108 ! Old version of "time_average"
109 character(*), intent(out), optional:: fileprefix
110 ! ヒストリデータのファイル名の接頭詞.
111 ! Prefixes of history data filenames
112 real(DP), intent(out), optional:: origin_value
113 ! 出力開始時刻.
114 ! Start time of output.
115 character(*), intent(out), optional:: origin_unit
116 ! 出力開始時刻の単位.
117 ! Unit of start time of output.
118 real(DP), intent(out), optional:: terminus_value
119 ! 出力終了時刻.
120 ! End time of output.
121 character(*), intent(out), optional:: terminus_unit
122 ! 出力終了時刻の単位.
123 ! Unit of end time of output.
124 integer, intent(out), optional:: slice_start(:)
125 ! 空間方向の開始点.
126 ! Start points of spaces.
127 integer, intent(out), optional:: slice_end(:)
128 ! 空間方向の終了点.
129 ! End points of spaces.
130 integer, intent(out), optional:: slice_stride(:)
131 ! 空間方向の刻み幅.
132 ! Strides of spaces.
133 logical, intent(out), optional:: space_average(:)
134 ! 平均化のフラグ.
135 ! Flag of average.
136 integer, intent(out), optional:: newfile_intvalue
137 ! ファイル分割時間間隔.
138 ! Interval of time of separation of a file.
139 character(*), intent(out), optional:: newfile_intunit
140 ! ファイル分割時間間隔の単位.
141 ! Unit of interval of time of separation of a file.
142
143 logical, intent(out), optional:: err
144 ! 例外処理用フラグ.
145 ! デフォルトでは, この手続き内でエラーが
146 ! 生じた場合, プログラムは強制終了します.
147 ! 引数 *err* が与えられる場合,
148 ! プログラムは強制終了せず, 代わりに
149 ! *err* に .true. が代入されます.
150 !
151 ! Exception handling flag.
152 ! By default, when error occur in
153 ! this procedure, the program aborts.
154 ! If this *err* argument is given,
155 ! .true. is substituted to *err* and
156 ! the program does not abort.
157
158 !-----------------------------------
159 ! 作業変数
160 ! Work variables
161 type(gthst_nmlinfo_entry), pointer:: hptr =>null()
162 character(STRING):: name_work
163 integer:: stat, ary_size
164 character(STRING):: cause_c
165 character(*), parameter:: subname = 'HstNmlInfoInquire'
166 continue
167 call beginsub( subname )
168 stat = dc_noerr
169 cause_c = ''
170
171 !-----------------------------------------------------------------
172 ! 初期設定のチェック
173 ! Check initialization
174 !-----------------------------------------------------------------
175 if ( .not. gthstnml % initialized ) then
176 stat = dc_enotinit
177 cause_c = 'GTHST_NMLINFO'
178 goto 999
179 end if
180
181 !-----------------------------------------------------------------
182 ! *gthstnml* 内から, *name* に関する情報を探査.
183 ! Search information correspond to *name* in *gthstnml*
184 !-----------------------------------------------------------------
185 if ( present(name) ) then
186 name_work = name
187 else
188 name_work = ''
189 end if
190 hptr => gthstnml % gthstnml_list
191 call listsearch( gthstnml_list = hptr, & ! (inout)
192 & name = name_work ) ! (in)
193
194 if ( .not. associated( hptr ) ) then
195 stat = dc_enoentry
196 cause_c = adjustl( name_work )
197 goto 999
198 end if
199
200 if ( hptr % name == '' ) then
201 if ( present(file) ) file = ''
202 else
203 if ( present(file) ) file = trim( hptr % fileprefix ) // hptr % file
204 end if
205 if ( present(interval_value) ) interval_value = hptr % interval_value
206 if ( present(interval_unit) ) interval_unit = hptr % interval_unit
207 if ( present(precision) ) precision = hptr % precision
208 if ( present(average) ) average = hptr % time_average
209 if ( present(time_average) ) time_average = hptr % time_average
210 if ( present(fileprefix) ) fileprefix = hptr % fileprefix
211
212 if ( present(origin_value ) ) origin_value = hptr % origin_value
213 if ( present(origin_unit ) ) origin_unit = hptr % origin_unit
214 if ( present(terminus_value ) ) terminus_value = hptr % terminus_value
215 if ( present(terminus_unit ) ) terminus_unit = hptr % terminus_unit
216 if ( present(slice_start ) ) then
217 ary_size = size(slice_start)
218 slice_start = hptr % slice_start(1:ary_size)
219 end if
220 if ( present(slice_end ) ) then
221 ary_size = size(slice_end)
222 slice_end = hptr % slice_end(1:ary_size)
223 end if
224 if ( present(slice_stride ) ) then
225 ary_size = size(slice_stride)
226 slice_stride = hptr % slice_stride(1:ary_size)
227 end if
228 if ( present(space_average ) ) then
229 ary_size = size(space_average)
230 space_average = hptr % space_average(1:ary_size)
231 end if
232 if ( present(newfile_intvalue) ) newfile_intvalue = hptr % newfile_intvalue
233 if ( present(newfile_intunit ) ) newfile_intunit = hptr % newfile_intunit
234
235 nullify( hptr )
236
237 !-----------------------------------------------------------------
238 ! 終了処理, 例外処理
239 ! Termination and Exception handling
240 !-----------------------------------------------------------------
241999 continue
242 call storeerror( stat, subname, err, cause_c )
243 call endsub( subname )
244 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)
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_enotinit
-400 以下: dc ユーティリティのエラー
Definition dc_error.f90:534
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
integer, parameter, public dc_enoentry
Definition dc_error.f90:548
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92