21 use gtool_history_internal
, only: default
22 use gtool_history_generic
, only: historyinquire
23 use gtdata_generic
, only: putline,
get_attr 24 use dc_trace
, only: beginsub, endsub
25 use dc_string
, only: putline, printf, split, strinclude, stoa, joinchar
30 type(gt_history),
intent(in),
target,
optional:: history
31 integer,
intent(in),
optional:: unit
37 character(*),
intent(in),
optional:: indent
41 logical,
intent(out),
optional:: err
59 type(gt_history),
pointer:: hst =>null()
62 character(STRING):: cause_c
65 character(STRING):: indent_str
67 character(STRING):: file, title, source, institution
68 character(STRING):: conventions, gt_version
69 character(TOKEN),
pointer:: dims(:) =>null()
70 integer,
pointer:: dimsizes(:) =>null()
71 character(STRING),
pointer:: longnames(:) =>null()
72 character(TOKEN),
pointer:: units(:) =>null()
73 character(TOKEN),
pointer:: xtypes(:) =>null()
75 real:: origin, interval, newest, oldest
76 character(*),
parameter:: subname =
'HistoryPutLine' 78 call beginsub( subname )
86 if (
present(unit) )
then 94 if (
present(indent) )
then 95 if ( len(indent) /= 0 )
then 96 indent_len = len(indent)
97 indent_str(1:indent_len) = indent
101 if (
present(history))
then 111 if ( hst % initialized )
then 112 call printf( out_unit, &
113 & indent_str(1:indent_len) // &
114 &
'#<GT_HISTORY:: @initialized=%y', &
115 & l = (/hst % initialized/) )
117 call historyinquire( history = hst, &
119 & file = file, title = title, &
120 & source = source, institution = institution, &
121 & dims = dims, dimsizes = dimsizes, &
122 & longnames = longnames, &
123 & units = units, xtypes = xtypes, &
124 & conventions = conventions, &
125 & gt_version = gt_version )
127 call printf( out_unit, &
128 & indent_str(1:indent_len) // &
129 &
' @file=%c @title=%c', &
130 & c1 = trim(file), c2 = trim(title) )
132 call printf( out_unit, &
133 & indent_str(1:indent_len) // &
134 &
' @source=%c @institution=%c', &
135 & c1 = trim(source), c2 = trim(institution) )
138 call printf( out_unit, &
139 & indent_str(1:indent_len) // &
140 &
' @dims=%c @dimsizes=%*d', &
141 & c1 = trim( joinchar(dims,
',') ), &
142 & i = dimsizes, n = (/
max/) )
143 deallocate( dims, dimsizes )
145 call printf( out_unit, &
146 & indent_str(1:indent_len) // &
147 &
' @longnames=%c', &
148 & c1 = trim( joinchar(longnames,
',') ) )
149 deallocate( longnames )
151 call printf( out_unit, &
152 & indent_str(1:indent_len) // &
153 &
' @units=%c @xtypes=%c', &
154 & c1 = trim( joinchar(units,
',') ), &
155 & c2 = trim( joinchar(xtypes,
',') ) )
156 deallocate( units, xtypes )
158 call printf( out_unit, &
159 & indent_str(1:indent_len) // &
160 &
' @conventions=%c @gt_version=%c', &
161 & c1 = trim(conventions), c2 = trim(gt_version) )
163 call printf( out_unit, &
164 & indent_str(1:indent_len) // &
165 &
' @unlimited_index=%d', &
166 & i = (/hst % unlimited_index/) )
168 max =
size( hst % dim_value_written )
169 call printf( out_unit, &
170 & indent_str(1:indent_len) // &
171 &
' @dim_value_written=%*y', &
172 & l = hst % dim_value_written, n = (/
max/) )
174 origin = hst % origin
175 interval = hst % interval
176 newest = hst % newest
177 oldest = hst % oldest
184 call printf( out_unit, &
185 & indent_str(1:indent_len) // &
186 &
' @origin=%r @interval=%r @newest=%r @oldest=%r', &
187 & r = (/origin, interval, newest, oldest/) )
189 if (
associated( hst % growable_indices ) )
then 190 max =
size( hst % growable_indices )
191 call printf( out_unit, &
192 & indent_str(1:indent_len) // &
193 &
' @growable_indices=%*d', &
194 & i = hst % growable_indices, n = (/
max/) )
196 call printf( out_unit, &
197 & indent_str(1:indent_len) // &
198 &
' @growable_indices=<null>' )
201 if (
associated( hst % count ) )
then 202 max =
size( hst % count )
203 call printf( out_unit, &
204 & indent_str(1:indent_len) // &
206 & i = hst % count, n = (/
max/) )
208 call printf( out_unit, &
209 & indent_str(1:indent_len) // &
213 if (
associated( hst % dimvars ) )
then 214 call printf( out_unit, &
215 & indent_str(1:indent_len) // &
217 max =
size( hst % dimvars )
219 call putline( hst % dimvars(i), out_unit, &
220 & indent_str(1:indent_len) //
' ', err )
223 call printf( out_unit, &
224 & indent_str(1:indent_len) // &
225 &
' @dimvars=<null>' )
228 if (
associated( hst % vars ) )
then 229 call printf( out_unit, &
230 & indent_str(1:indent_len) // &
232 max =
size( hst % vars )
234 call putline( hst % vars(i), out_unit, &
235 & indent_str(1:indent_len) //
' ', err )
238 call printf( out_unit, &
239 & indent_str(1:indent_len) // &
243 if (
associated( hst % var_avr_count ) )
then 244 max =
size( hst % var_avr_count )
245 call printf( out_unit, &
246 & indent_str(1:indent_len) // &
247 &
' @var_avr_count=%*d', &
248 & i = hst % var_avr_count, n = (/
max/) )
250 call printf( out_unit, &
251 & indent_str(1:indent_len) // &
252 &
' @var_avr_count=<null>' )
255 if (
associated( hst % var_avr_firstput ) )
then 256 max =
size( hst % var_avr_firstput )
257 call printf( out_unit, &
258 & indent_str(1:indent_len) // &
259 &
' @var_avr_firstput=%*b', &
260 & l = hst % var_avr_firstput, n = (/
max/) )
262 call printf( out_unit, &
263 & indent_str(1:indent_len) // &
264 &
' @var_avr_firstput=<null>' )
267 if (
associated( hst % var_avr_coefsum ) )
then 268 max =
size( hst % var_avr_coefsum )
269 call printf( out_unit, &
270 & indent_str(1:indent_len) // &
271 &
' @var_avr_coefsum=%*f', &
272 & d = hst % var_avr_coefsum, n = (/
max/) )
274 call printf( out_unit, &
275 & indent_str(1:indent_len) // &
276 &
' @var_avr_coefsum=<null>' )
279 call printf( out_unit, &
280 & indent_str(1:indent_len) // &
281 &
' @time_bnds=%*f, @time_bnds_output_count=%d', &
282 & i = (/hst % time_bnds_output_count/), &
283 & d = hst % time_bnds, &
284 & n = (/
size(hst % time_bnds) /) )
286 if (
associated( hst % var_avr_data ) )
then 287 call printf( out_unit, &
288 & indent_str(1:indent_len) // &
289 &
' @var_avr_data=' )
290 max =
size( hst % var_avr_data )
292 call printf( out_unit, &
293 & indent_str(1:indent_len) // &
294 &
' #<GT_HISTORY_AVRDATA:: @length=%d', &
295 & i = (/hst % var_avr_data(i) % length/) )
296 call putline( hst % var_avr_data(i) % a_DataAvr, unit = out_unit, &
297 & lbounds = lbound(hst % var_avr_data(i) % a_DataAvr), &
298 & ubounds = ubound(hst % var_avr_data(i) % a_DataAvr), &
299 & indent = indent_str(1:indent_len) // &
303 call printf( out_unit, &
304 & indent_str(1:indent_len) // &
305 &
' @var_avr_data=<null>' )
308 call printf( out_unit, &
309 & indent_str(1:indent_len) // &
312 call printf( out_unit, &
313 & indent_str(1:indent_len) // &
314 &
'#<GT_HISTORY:: @initialized=%y>', &
315 & l = (/hst % initialized/) )
323 call storeerror( stat, subname, err, cause_c )
324 call endsub( subname )
integer, parameter, public dc_enotinit
integer, parameter, public token
単語やキーワードを保持する文字型変数の種別型パラメタ
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
integer, parameter, public dp
倍精度実数型変数
integer, parameter, public stdout
標準出力の装置番号
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ