gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
historyautoaddweight.f90 File Reference

Settings of weights of axes . More...

Go to the source code of this file.

Functions/Subroutines

subroutine historyautoaddweightreal (dim, weight, units, xtype)
subroutine historyautoaddweightdouble (dim, weight, units, xtype)
subroutine historyautoaddweightint (dim, weight, units, xtype)

Detailed Description

Settings of weights of axes

.

Author
Yasuhiro MORIKAWA

Definition in file historyautoaddweight.f90.

Function/Subroutine Documentation

◆ historyautoaddweightdouble()

subroutine historyautoaddweightdouble ( character(*), intent(in) dim,
real(dp), dimension(:), intent(in) weight,
character(*), intent(in), optional units,
character(*), intent(in), optional xtype )

Set weights of axes.

Parameters
[in]dimName of axis to which weight are set. Note that this value must be set as dims of HistoryAutoCreate.
[in]weightWeight of axis. Integer, single or double precision are acceptable as data type. Note that when this is output to a file, data type is converted into xtype or type of the axis.
[in]units(optional) Units of axis weight. If this argument is omitted, unit of the dimension is used.
[in]xtype(optional) Data type of weight of the dimension. If this argument is omitted, data type of the dimension is used.

Definition at line 231 of file historyautoaddweight.f90.

237 use gtool_history, only: historyaxisinquire, historyaxisaddattr, &
238 & historyvarinfocreate
239 use dc_trace, only: beginsub, endsub
240 use dc_error, only: storeerror, dc_noerr, &
242 use dc_types, only: string, token, dp
243
244 implicit none
245 character(*), intent(in):: dim
246 ! 座標重みを設定する座標の名称.
247 !
248 ! ただし, ここで指定するもの
249 ! は, HistoryAutoCreate の *dims*
250 ! 既に指定されていなければなりません.
251 !
252 ! Name of axis to which "weight" are set.
253 !
254 ! Note that this value must be set
255 ! as "dims" of "HistoryAutoCreate".
256 !
257 real(DP), intent(in):: weight(:)
258 ! 座標重みデータ.
259 !
260 ! データ型は整数, 単精度実数型,
261 ! 倍精度実数型のどれでもかまいません.
262 ! ただし, ファイルへ出力される際には,
263 ! xtype もしくは座標データの型へと
264 ! 変換されます.
265 !
266 ! Weight of axis.
267 !
268 ! Integer, single or double precision are
269 ! acceptable as data type.
270 ! Note that when this is output to a file,
271 ! data type is converted into "xtype" or
272 ! type of the axis.
273 !
274 character(*), intent(in), optional:: units
275 ! 座標重みの単位.
276 ! 省略した場合には, 座標の単位が
277 ! 使用されます.
278 !
279 ! Units of axis weight.
280 ! If this argument is omitted,
281 ! unit of the dimension is used.
282 !
283 character(*), intent(in), optional:: xtype
284 ! 座標重みのデータ型.
285 ! 省略した場合には, 座標のデータ型が
286 ! 使用されます.
287 !
288 ! Data type of weight of the dimension.
289 ! If this argument is omitted,
290 ! data type of the dimension is used.
291 !
292
293 character(STRING):: name, longname
294 character(TOKEN):: dim_units, dim_xtype
295 integer:: dim_size
296 integer:: stat, i
297 character(STRING):: cause_c
298 character(*), parameter:: subname = "HistoryAutoAddWeightDouble"
299 continue
300 call beginsub(subname, 'dim=<%c>', c1=trim(dim) )
301 stat = dc_noerr
302 cause_c = ""
303
304 ! 初期設定チェック
305 ! Check initialization
306 !
307 if ( .not. initialized ) then
308 stat = dc_enotinit
309 cause_c = 'gtool_historyauto'
310 goto 999
311 end if
312
313 do i = 1, numdims
314 call historyaxisinquire( &
315 & axis = gthst_axes(i), & ! (in)
316 & name = name, & ! (out)
317 & size = dim_size, & ! (out)
318 & longname = longname, & ! (out)
319 & units = dim_units, & ! (out)
320 & xtype = dim_xtype ) ! (out)
321 if ( trim(dim) == trim(name) ) then
322 if ( dim_size /= size(weight) ) then
324 cause_c = 'weight'
325 end if
326 if ( present(units) ) dim_units = units
327 if ( present(xtype) ) dim_xtype = xtype
328 call historyvarinfocreate( &
329 & varinfo = gthst_weights(numwgts + 1), & ! (out)
330 & name = trim(dim) // wgtsuf, dims = (/ dim /), & ! (in)
331 & longname = 'weight for integration or average in ' // &
332 & trim(longname), & ! (in)
333 & units = dim_units, xtype = dim_xtype ) ! (in)
334
335 call historyaxisaddattr( &
336 & axis = gthst_axes(i), & ! (inout)
337 & attrname = 'gt_calc_weight', & ! (in)
338 & value = trim(dim) // wgtsuf ) ! (in)
339
340 allocate( data_weights(numwgts + 1) % a_axis( dim_size ) )
341 data_weights(numwgts + 1) % a_axis = weight
342
343 numwgts = numwgts + 1
344 goto 999
345 end if
346 end do
347
348 stat = hst_enoaxisname
349 cause_c = dim
350
351999 continue
352 call storeerror(stat, subname, cause_c = cause_c)
353 call endsub(subname)
Error handling module.
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 or less: DC utilities errors
Definition dc_error.f90:534
integer, parameter, public hst_enoaxisname
Definition dc_error.f90:565
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
integer, parameter, public gt_eargsizemismatch
Definition dc_error.f90:515
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:128
integer, parameter, public string
Character length for string
Definition dc_types.f90:137
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92
character(*), parameter, public wgtsuf
type(gt_history_axis_data), dimension(1:nf90_max_dims), target, save, public data_weights
type(gt_history_varinfo), dimension(1:nf90_max_dims), save, public gthst_weights
type(gt_history_axis), dimension(1:nf90_max_dims), target, save, public gthst_axes

References dc_trace::beginsub(), gtool_historyauto_internal::data_weights, dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), dc_error::gt_eargsizemismatch, gtool_historyauto_internal::gthst_axes, gtool_historyauto_internal::gthst_weights, dc_error::hst_enoaxisname, gtool_historyauto_internal::initialized, gtool_historyauto_internal::numdims, gtool_historyauto_internal::numwgts, dc_error::storeerror(), dc_types::string, dc_types::token, and gtool_historyauto_internal::wgtsuf.

Here is the call graph for this function:

◆ historyautoaddweightint()

subroutine historyautoaddweightint ( character(*), intent(in) dim,
integer, dimension(:), intent(in) weight,
character(*), intent(in), optional units,
character(*), intent(in), optional xtype )

Set weights of axes.

Parameters
[in]dimName of axis to which weight are set. Note that this value must be set as dims of HistoryAutoCreate.
[in]weightWeight of axis. Integer, single or double precision are acceptable as data type. Note that when this is output to a file, data type is converted into xtype or type of the axis.
[in]units(optional) Units of axis weight. If this argument is omitted, unit of the dimension is used.
[in]xtype(optional) Data type of weight of the dimension. If this argument is omitted, data type of the dimension is used.

Definition at line 394 of file historyautoaddweight.f90.

400 use gtool_history, only: historyaxisinquire, historyaxisaddattr, &
401 & historyvarinfocreate
402 use dc_trace, only: beginsub, endsub
403 use dc_error, only: storeerror, dc_noerr, &
405 use dc_types, only: string, token
406
407 implicit none
408 character(*), intent(in):: dim
409 ! 座標重みを設定する座標の名称.
410 !
411 ! ただし, ここで指定するもの
412 ! は, HistoryAutoCreate の *dims*
413 ! 既に指定されていなければなりません.
414 !
415 ! Name of axis to which "weight" are set.
416 !
417 ! Note that this value must be set
418 ! as "dims" of "HistoryAutoCreate".
419 !
420 integer, intent(in):: weight(:)
421 ! 座標重みデータ.
422 !
423 ! データ型は整数, 単精度実数型,
424 ! 倍精度実数型のどれでもかまいません.
425 ! ただし, ファイルへ出力される際には,
426 ! xtype もしくは座標データの型へと
427 ! 変換されます.
428 !
429 ! Weight of axis.
430 !
431 ! Integer, single or double precision are
432 ! acceptable as data type.
433 ! Note that when this is output to a file,
434 ! data type is converted into "xtype" or
435 ! type of the axis.
436 !
437 character(*), intent(in), optional:: units
438 ! 座標重みの単位.
439 ! 省略した場合には, 座標の単位が
440 ! 使用されます.
441 !
442 ! Units of axis weight.
443 ! If this argument is omitted,
444 ! unit of the dimension is used.
445 !
446 character(*), intent(in), optional:: xtype
447 ! 座標重みのデータ型.
448 ! 省略した場合には, 座標のデータ型が
449 ! 使用されます.
450 !
451 ! Data type of weight of the dimension.
452 ! If this argument is omitted,
453 ! data type of the dimension is used.
454 !
455
456 character(STRING):: name, longname
457 character(TOKEN):: dim_units, dim_xtype
458 integer:: dim_size
459 integer:: stat, i
460 character(STRING):: cause_c
461 character(*), parameter:: subname = "HistoryAutoAddWeightInt"
462 continue
463 call beginsub(subname, 'dim=<%c>', c1=trim(dim) )
464 stat = dc_noerr
465 cause_c = ""
466
467 ! 初期設定チェック
468 ! Check initialization
469 !
470 if ( .not. initialized ) then
471 stat = dc_enotinit
472 cause_c = 'gtool_historyauto'
473 goto 999
474 end if
475
476 do i = 1, numdims
477 call historyaxisinquire( &
478 & axis = gthst_axes(i), & ! (in)
479 & name = name, & ! (out)
480 & size = dim_size, & ! (out)
481 & longname = longname, & ! (out)
482 & units = dim_units, & ! (out)
483 & xtype = dim_xtype ) ! (out)
484 if ( trim(dim) == trim(name) ) then
485 if ( dim_size /= size(weight) ) then
487 cause_c = 'weight'
488 end if
489 if ( present(units) ) dim_units = units
490 if ( present(xtype) ) dim_xtype = xtype
491 call historyvarinfocreate( &
492 & varinfo = gthst_weights(numwgts + 1), & ! (out)
493 & name = trim(dim) // wgtsuf, dims = (/ dim /), & ! (in)
494 & longname = 'weight for integration or average in ' // &
495 & trim(longname), & ! (in)
496 & units = dim_units, xtype = dim_xtype ) ! (in)
497
498 call historyaxisaddattr( &
499 & axis = gthst_axes(i), & ! (inout)
500 & attrname = 'gt_calc_weight', & ! (in)
501 & value = trim(dim) // wgtsuf ) ! (in)
502
503 allocate( data_weights(numwgts + 1) % a_axis( dim_size ) )
504 data_weights(numwgts + 1) % a_axis = weight
505
506 numwgts = numwgts + 1
507 goto 999
508 end if
509 end do
510
511 stat = hst_enoaxisname
512 cause_c = dim
513
514999 continue
515 call storeerror(stat, subname, cause_c = cause_c)
516 call endsub(subname)

References dc_trace::beginsub(), gtool_historyauto_internal::data_weights, dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), dc_error::gt_eargsizemismatch, gtool_historyauto_internal::gthst_axes, gtool_historyauto_internal::gthst_weights, dc_error::hst_enoaxisname, gtool_historyauto_internal::initialized, gtool_historyauto_internal::numdims, gtool_historyauto_internal::numwgts, dc_error::storeerror(), dc_types::string, dc_types::token, and gtool_historyauto_internal::wgtsuf.

Here is the call graph for this function:

◆ historyautoaddweightreal()

subroutine historyautoaddweightreal ( character(*), intent(in) dim,
real, dimension(:), intent(in) weight,
character(*), intent(in), optional units,
character(*), intent(in), optional xtype )

Set weights of axes.

Parameters
[in]dimName of axis to which weight are set. Note that this value must be set as dims of HistoryAutoCreate.
[in]weightWeight of axis. Integer, single or double precision are acceptable as data type. Note that when this is output to a file, data type is converted into xtype or type of the axis.
[in]units(optional) Units of axis weight. If this argument is omitted, unit of the dimension is used.
[in]xtype(optional) Data type of weight of the dimension. If this argument is omitted, data type of the dimension is used.

Definition at line 68 of file historyautoaddweight.f90.

74 use gtool_history, only: historyaxisinquire, historyaxisaddattr, &
75 & historyvarinfocreate
76 use dc_trace, only: beginsub, endsub
77 use dc_error, only: storeerror, dc_noerr, &
79 use dc_types, only: string, token
80
81 implicit none
82 character(*), intent(in):: dim
83 ! 座標重みを設定する座標の名称.
84 !
85 ! ただし, ここで指定するもの
86 ! は, HistoryAutoCreate の *dims*
87 ! 既に指定されていなければなりません.
88 !
89 ! Name of axis to which "weight" are set.
90 !
91 ! Note that this value must be set
92 ! as "dims" of "HistoryAutoCreate".
93 !
94 real, intent(in):: weight(:)
95 ! 座標重みデータ.
96 !
97 ! データ型は整数, 単精度実数型,
98 ! 倍精度実数型のどれでもかまいません.
99 ! ただし, ファイルへ出力される際には,
100 ! xtype もしくは座標データの型へと
101 ! 変換されます.
102 !
103 ! Weight of axis.
104 !
105 ! Integer, single or double precision are
106 ! acceptable as data type.
107 ! Note that when this is output to a file,
108 ! data type is converted into "xtype" or
109 ! type of the axis.
110 !
111 character(*), intent(in), optional:: units
112 ! 座標重みの単位.
113 ! 省略した場合には, 座標の単位が
114 ! 使用されます.
115 !
116 ! Units of axis weight.
117 ! If this argument is omitted,
118 ! unit of the dimension is used.
119 !
120 character(*), intent(in), optional:: xtype
121 ! 座標重みのデータ型.
122 ! 省略した場合には, 座標のデータ型が
123 ! 使用されます.
124 !
125 ! Data type of weight of the dimension.
126 ! If this argument is omitted,
127 ! data type of the dimension is used.
128 !
129
130 character(STRING):: name, longname
131 character(TOKEN):: dim_units, dim_xtype
132 integer:: dim_size
133 integer:: stat, i
134 character(STRING):: cause_c
135 character(*), parameter:: subname = "HistoryAutoAddWeightReal"
136 continue
137 call beginsub(subname, 'dim=<%c>', c1=trim(dim) )
138 stat = dc_noerr
139 cause_c = ""
140
141 ! 初期設定チェック
142 ! Check initialization
143 !
144 if ( .not. initialized ) then
145 stat = dc_enotinit
146 cause_c = 'gtool_historyauto'
147 goto 999
148 end if
149
150 do i = 1, numdims
151 call historyaxisinquire( &
152 & axis = gthst_axes(i), & ! (in)
153 & name = name, & ! (out)
154 & size = dim_size, & ! (out)
155 & longname = longname, & ! (out)
156 & units = dim_units, & ! (out)
157 & xtype = dim_xtype ) ! (out)
158 if ( trim(dim) == trim(name) ) then
159 if ( dim_size /= size(weight) ) then
161 cause_c = 'weight'
162 end if
163 if ( present(units) ) dim_units = units
164 if ( present(xtype) ) dim_xtype = xtype
165 call historyvarinfocreate( &
166 & varinfo = gthst_weights(numwgts + 1), & ! (out)
167 & name = trim(dim) // wgtsuf, dims = (/ dim /), & ! (in)
168 & longname = 'weight for integration or average in ' // &
169 & trim(longname), & ! (in)
170 & units = dim_units, xtype = dim_xtype ) ! (in)
171
172 call historyaxisaddattr( &
173 & axis = gthst_axes(i), & ! (inout)
174 & attrname = 'gt_calc_weight', & ! (in)
175 & value = trim(dim) // wgtsuf ) ! (in)
176
177 allocate( data_weights(numwgts + 1) % a_axis( dim_size ) )
178 data_weights(numwgts + 1) % a_axis = weight
179
180 numwgts = numwgts + 1
181 goto 999
182 end if
183 end do
184
185 stat = hst_enoaxisname
186 cause_c = dim
187
188999 continue
189 call storeerror(stat, subname, cause_c = cause_c)
190 call endsub(subname)

References dc_trace::beginsub(), gtool_historyauto_internal::data_weights, dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), dc_error::gt_eargsizemismatch, gtool_historyauto_internal::gthst_axes, gtool_historyauto_internal::gthst_weights, dc_error::hst_enoaxisname, gtool_historyauto_internal::initialized, gtool_historyauto_internal::numdims, gtool_historyauto_internal::numwgts, dc_error::storeerror(), dc_types::string, dc_types::token, and gtool_historyauto_internal::wgtsuf.

Here is the call graph for this function: