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

Go to the source code of this file.

Functions/Subroutines

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)

Function/Subroutine Documentation

◆ hstnmlinfoinquire()

subroutine hstnmlinfoinquire ( type(gthst_nmlinfo), intent(in) gthstnml,
character(*), intent(in), optional name,
character(*), intent(out), optional file,
real(dp), intent(out), optional interval_value,
character(*), intent(out), optional interval_unit,
character(*), intent(out), optional precision,
logical, intent(out), optional time_average,
logical, intent(out), optional average,
character(*), intent(out), optional fileprefix,
real(dp), intent(out), optional origin_value,
character(*), intent(out), optional origin_unit,
real(dp), intent(out), optional terminus_value,
character(*), intent(out), optional terminus_unit,
integer, dimension(:), intent(out), optional slice_start,
integer, dimension(:), intent(out), optional slice_end,
integer, dimension(:), intent(out), optional slice_stride,
logical, dimension(:), intent(out), optional space_average,
integer, intent(out), optional newfile_intvalue,
character(*), intent(out), optional newfile_intunit,
logical, intent(out), optional err )

Definition at line 10 of file hstnmlinfoinquire.f90.

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 )
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
種別型パラメタを提供します。
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_error::dc_earglack, dc_error::dc_enoentry, dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_types::stdout, dc_error::storeerror(), dc_types::string, and dc_types::token.

Here is the call graph for this function: