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

Add attributes . More...

Go to the source code of this file.

Functions/Subroutines

subroutine historyautoaddattrchar0 (varname, attrname, value)
 
subroutine historyautoaddattrlogical0 (varname, attrname, value)
 
subroutine historyautoaddattrint0 (varname, attrname, value)
 
subroutine historyautoaddattrint1 (varname, attrname, value)
 
subroutine historyautoaddattrreal0 (varname, attrname, value)
 
subroutine historyautoaddattrreal1 (varname, attrname, value)
 
subroutine historyautoaddattrdouble0 (varname, attrname, value)
 
subroutine historyautoaddattrdouble1 (varname, attrname, value)
 

Detailed Description

Add attributes

.

Author
Yasuhiro MORIKAWA

Definition in file historyautoaddattr.f90.

Function/Subroutine Documentation

◆ historyautoaddattrchar0()

subroutine historyautoaddattrchar0 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
character(*), intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 75 of file historyautoaddattr.f90.

78 !
79 !
80 ! 座標変数および座標重み変数に属性を付加します.
81 ! このサブルーチンを用いる前に, HistoryAutoCreate による初期設定が
82 ! 必要です.
83 !
84 ! * 座標変数については, HistoryAutoCreate の "dims" に与えられた
85 ! もののみ指定可能です.
86 !
87 ! * 座標重み変数については, HistoryAutoAddWeight で与えられた
88 ! もののみ指定可能です.
89 !
90 ! * *HistoryAutoAddAttr* は複数のサブルーチンの総称名です. *value*
91 ! にはいくつかの型を与えることが可能です.
92 ! 下記のサブルーチンを参照ください.
93 !
94 ! Add attributes axes or weights of axes.
95 ! Initialization by "HistoryAutoCreate" is needed
96 ! before use of this subroutine.
97 !
98 ! * About axes, "dims" specified by "HistoryAutoCreate" can be
99 ! specified.
100 !
101 ! * About weights of axes, "dims" specified by "HistoryAutoAddWeight"
102 ! can be specified.
103 !
104 ! * "HistoryAutoAddAttr" is a generic name of multiple subroutines.
105 ! Then some data type can be specified to "value".
106 !
107
108 !
111 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
112 & historyvarinfoaddattr, historyvarinfoinquire
113 use dc_trace, only: beginsub, endsub
115 use dc_string, only: tochar
116 use dc_types, only: string
117 implicit none
118 character(*), intent(in):: varname
119 ! 変数の名前.
120 !
121 ! ここで指定するものは,
122 ! HistoryAutoCreate の *dims* ,
123 ! または HistoryAutoAddWeight の
124 ! *varname* で既に指定されてい
125 ! なければなりません.
126 !
127 ! Name of a variable.
128 !
129 ! This must be specified with *dims*
130 ! in HistoryAutoCreate, or
131 ! *varname* in "HistoryAutoAddWeight".
132 !
133
134 character(*), intent(in):: attrname
135 ! 属性の名前.
136 ! Name of an attribute.
137
138 character(*), intent(in):: value
139 ! 属性の値.
140 ! Value of an attribute.
141
142
143 character(STRING):: name
144 integer:: stat, i
145 character(STRING):: cause_c
146 character(*), parameter:: subname = "HistoryAutoAddAttrChar0"
147 continue
148 call beginsub(subname, &
149 & 'varname=<%c> attrname=<%c>, value=<%c>', &
150 & c1=trim(varname), c2=trim(attrname), c3=trim(value))
151 stat = dc_noerr
152 cause_c = ""
153
154 ! 初期設定チェック
155 ! Check initialization
156 !
157 if ( .not. initialized ) then
158 stat = dc_enotinit
159 cause_c = 'gtool_historyauto'
160 goto 999
161 end if
162
163 do i = 1, numdims
164 call historyaxisinquire( &
165 & axis = gthst_axes(i), & ! (in)
166 & name = name ) ! (out)
167 if ( trim(varname) == trim(name) ) then
168 call historyaxisaddattr( &
169 & axis = gthst_axes(i), & ! (inout)
170 & attrname = attrname, value = value ) ! (in)
171 goto 999
172 end if
173 end do
174
175 do i = 1, numwgts
176 call historyvarinfoinquire( &
177 & varinfo = gthst_weights(i), & ! (in)
178 & name = name ) ! (out)
179 if ( trim(varname) == trim(name) ) then
180 call historyvarinfoaddattr( &
181 & varinfo = gthst_weights(i), & ! (inout)
182 & attrname = attrname, value = value ) ! (in)
183 goto 999
184 end if
185 end do
186
187 stat = hst_enoaxisname
188 cause_c = varname
189
190999 continue
191 call storeerror(stat, subname, cause_c = cause_c)
192 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_noerr
Error storage variables
Definition dc_error.f90:468
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
Handling character types.
Definition dc_string.f90:83
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:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public string
Character length for string
Definition dc_types.f90:137
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(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrdouble0()

subroutine historyautoaddattrdouble0 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real(dp), intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 835 of file historyautoaddattr.f90.

838 !
839
840 !
843 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
844 & historyvarinfoaddattr, historyvarinfoinquire
845 use dc_trace, only: beginsub, endsub
847 use dc_string, only: tochar
848 use dc_types, only: string, dp
849 implicit none
850 character(*), intent(in):: varname
851
852 character(*), intent(in):: attrname
853
854 real(DP), intent(in):: value
855
856
857 character(STRING):: name
858 integer:: stat, i
859 character(STRING):: cause_c
860 character(*), parameter:: subname = "HistoryAutoAddAttrDouble0"
861 continue
862 call beginsub(subname, &
863 & 'varname=<%c> attrname=<%c>, value=<%c>', &
864 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
865 stat = dc_noerr
866 cause_c = ""
867
868 ! 初期設定チェック
869 ! Check initialization
870 !
871 if ( .not. initialized ) then
872 stat = dc_enotinit
873 cause_c = 'gtool_historyauto'
874 goto 999
875 end if
876
877 do i = 1, numdims
878 call historyaxisinquire( &
879 & axis = gthst_axes(i), & ! (in)
880 & name = name ) ! (out)
881 if ( trim(varname) == trim(name) ) then
882 call historyaxisaddattr( &
883 & axis = gthst_axes(i), & ! (inout)
884 & attrname = attrname, value = value ) ! (in)
885 goto 999
886 end if
887 end do
888
889 do i = 1, numwgts
890 call historyvarinfoinquire( &
891 & varinfo = gthst_weights(i), & ! (in)
892 & name = name ) ! (out)
893 if ( trim(varname) == trim(name) ) then
894 call historyvarinfoaddattr( &
895 & varinfo = gthst_weights(i), & ! (inout)
896 & attrname = attrname, value = value ) ! (in)
897 goto 999
898 end if
899 end do
900
901 stat = hst_enoaxisname
902 cause_c = varname
903
904999 continue
905 call storeerror(stat, subname, cause_c = cause_c)
906 call endsub(subname)
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrdouble1()

subroutine historyautoaddattrdouble1 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real(dp), dimension(:), intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 954 of file historyautoaddattr.f90.

957 !
958
959 !
962 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
963 & historyvarinfoaddattr, historyvarinfoinquire
964 use dc_trace, only: beginsub, endsub
966 use dc_string, only: tochar
967 use dc_types, only: string, dp
968 implicit none
969 character(*), intent(in):: varname
970
971 character(*), intent(in):: attrname
972
973 real(DP), intent(in):: value(:)
974
975
976 character(STRING):: name
977 integer:: stat, i
978 character(STRING):: cause_c
979 character(*), parameter:: subname = "HistoryAutoAddAttrDouble1"
980 continue
981 call beginsub(subname, &
982 & 'varname=<%c> attrname=<%c>, value=<%c>', &
983 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
984 stat = dc_noerr
985 cause_c = ""
986
987 ! 初期設定チェック
988 ! Check initialization
989 !
990 if ( .not. initialized ) then
991 stat = dc_enotinit
992 cause_c = 'gtool_historyauto'
993 goto 999
994 end if
995
996 do i = 1, numdims
997 call historyaxisinquire( &
998 & axis = gthst_axes(i), & ! (in)
999 & name = name ) ! (out)
1000 if ( trim(varname) == trim(name) ) then
1001 call historyaxisaddattr( &
1002 & axis = gthst_axes(i), & ! (inout)
1003 & attrname = attrname, value = value ) ! (in)
1004 goto 999
1005 end if
1006 end do
1007
1008 do i = 1, numwgts
1009 call historyvarinfoinquire( &
1010 & varinfo = gthst_weights(i), & ! (in)
1011 & name = name ) ! (out)
1012 if ( trim(varname) == trim(name) ) then
1013 call historyvarinfoaddattr( &
1014 & varinfo = gthst_weights(i), & ! (inout)
1015 & attrname = attrname, value = value ) ! (in)
1016 goto 999
1017 end if
1018 end do
1019
1020 stat = hst_enoaxisname
1021 cause_c = varname
1022
1023999 continue
1024 call storeerror(stat, subname, cause_c = cause_c)
1025 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrint0()

subroutine historyautoaddattrint0 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
integer, intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 359 of file historyautoaddattr.f90.

362 !
363
364 !
367 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
368 & historyvarinfoaddattr, historyvarinfoinquire
369 use dc_trace, only: beginsub, endsub
371 use dc_string, only: tochar
372 use dc_types, only: string
373 implicit none
374 character(*), intent(in):: varname
375
376 character(*), intent(in):: attrname
377
378 integer, intent(in):: value
379
380
381 character(STRING):: name
382 integer:: stat, i
383 character(STRING):: cause_c
384 character(*), parameter:: subname = "HistoryAutoAddAttrInt0"
385 continue
386 call beginsub(subname, &
387 & 'varname=<%c> attrname=<%c>, value=<%c>', &
388 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
389 stat = dc_noerr
390 cause_c = ""
391
392 ! 初期設定チェック
393 ! Check initialization
394 !
395 if ( .not. initialized ) then
396 stat = dc_enotinit
397 cause_c = 'gtool_historyauto'
398 goto 999
399 end if
400
401 do i = 1, numdims
402 call historyaxisinquire( &
403 & axis = gthst_axes(i), & ! (in)
404 & name = name ) ! (out)
405 if ( trim(varname) == trim(name) ) then
406 call historyaxisaddattr( &
407 & axis = gthst_axes(i), & ! (inout)
408 & attrname = attrname, value = value ) ! (in)
409 goto 999
410 end if
411 end do
412
413 do i = 1, numwgts
414 call historyvarinfoinquire( &
415 & varinfo = gthst_weights(i), & ! (in)
416 & name = name ) ! (out)
417 if ( trim(varname) == trim(name) ) then
418 call historyvarinfoaddattr( &
419 & varinfo = gthst_weights(i), & ! (inout)
420 & attrname = attrname, value = value ) ! (in)
421 goto 999
422 end if
423 end do
424
425 stat = hst_enoaxisname
426 cause_c = varname
427
428999 continue
429 call storeerror(stat, subname, cause_c = cause_c)
430 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrint1()

subroutine historyautoaddattrint1 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
integer, dimension(:), intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 478 of file historyautoaddattr.f90.

481 !
482
483 !
486 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
487 & historyvarinfoaddattr, historyvarinfoinquire
488 use dc_trace, only: beginsub, endsub
490 use dc_string, only: tochar
491 use dc_types, only: string
492 implicit none
493 character(*), intent(in):: varname
494
495 character(*), intent(in):: attrname
496
497 integer, intent(in):: value(:)
498
499
500 character(STRING):: name
501 integer:: stat, i
502 character(STRING):: cause_c
503 character(*), parameter:: subname = "HistoryAutoAddAttrInt1"
504 continue
505 call beginsub(subname, &
506 & 'varname=<%c> attrname=<%c>, value=<%c>', &
507 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
508 stat = dc_noerr
509 cause_c = ""
510
511 ! 初期設定チェック
512 ! Check initialization
513 !
514 if ( .not. initialized ) then
515 stat = dc_enotinit
516 cause_c = 'gtool_historyauto'
517 goto 999
518 end if
519
520 do i = 1, numdims
521 call historyaxisinquire( &
522 & axis = gthst_axes(i), & ! (in)
523 & name = name ) ! (out)
524 if ( trim(varname) == trim(name) ) then
525 call historyaxisaddattr( &
526 & axis = gthst_axes(i), & ! (inout)
527 & attrname = attrname, value = value ) ! (in)
528 goto 999
529 end if
530 end do
531
532 do i = 1, numwgts
533 call historyvarinfoinquire( &
534 & varinfo = gthst_weights(i), & ! (in)
535 & name = name ) ! (out)
536 if ( trim(varname) == trim(name) ) then
537 call historyvarinfoaddattr( &
538 & varinfo = gthst_weights(i), & ! (inout)
539 & attrname = attrname, value = value ) ! (in)
540 goto 999
541 end if
542 end do
543
544 stat = hst_enoaxisname
545 cause_c = varname
546
547999 continue
548 call storeerror(stat, subname, cause_c = cause_c)
549 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrlogical0()

subroutine historyautoaddattrlogical0 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
logical, intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 240 of file historyautoaddattr.f90.

243 !
244
245 !
248 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
249 & historyvarinfoaddattr, historyvarinfoinquire
250 use dc_trace, only: beginsub, endsub
252 use dc_string, only: tochar
253 use dc_types, only: string
254 implicit none
255 character(*), intent(in):: varname
256
257 character(*), intent(in):: attrname
258
259 logical, intent(in):: value
260
261
262 character(STRING):: name
263 integer:: stat, i
264 character(STRING):: cause_c
265 character(*), parameter:: subname = "HistoryAutoAddAttrLogical0"
266 continue
267 call beginsub(subname, &
268 & 'varname=<%c> attrname=<%c>, value=<%c>', &
269 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
270 stat = dc_noerr
271 cause_c = ""
272
273 ! 初期設定チェック
274 ! Check initialization
275 !
276 if ( .not. initialized ) then
277 stat = dc_enotinit
278 cause_c = 'gtool_historyauto'
279 goto 999
280 end if
281
282 do i = 1, numdims
283 call historyaxisinquire( &
284 & axis = gthst_axes(i), & ! (in)
285 & name = name ) ! (out)
286 if ( trim(varname) == trim(name) ) then
287 call historyaxisaddattr( &
288 & axis = gthst_axes(i), & ! (inout)
289 & attrname = attrname, value = value ) ! (in)
290 goto 999
291 end if
292 end do
293
294 do i = 1, numwgts
295 call historyvarinfoinquire( &
296 & varinfo = gthst_weights(i), & ! (in)
297 & name = name ) ! (out)
298 if ( trim(varname) == trim(name) ) then
299 call historyvarinfoaddattr( &
300 & varinfo = gthst_weights(i), & ! (inout)
301 & attrname = attrname, value = value ) ! (in)
302 goto 999
303 end if
304 end do
305
306 stat = hst_enoaxisname
307 cause_c = varname
308
309999 continue
310 call storeerror(stat, subname, cause_c = cause_c)
311 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrreal0()

subroutine historyautoaddattrreal0 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real, intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 597 of file historyautoaddattr.f90.

600 !
601
602 !
605 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
606 & historyvarinfoaddattr, historyvarinfoinquire
607 use dc_trace, only: beginsub, endsub
609 use dc_string, only: tochar
610 use dc_types, only: string
611 implicit none
612 character(*), intent(in):: varname
613
614 character(*), intent(in):: attrname
615
616 real, intent(in):: value
617
618
619 character(STRING):: name
620 integer:: stat, i
621 character(STRING):: cause_c
622 character(*), parameter:: subname = "HistoryAutoAddAttrReal0"
623 continue
624 call beginsub(subname, &
625 & 'varname=<%c> attrname=<%c>, value=<%c>', &
626 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
627 stat = dc_noerr
628 cause_c = ""
629
630 ! 初期設定チェック
631 ! Check initialization
632 !
633 if ( .not. initialized ) then
634 stat = dc_enotinit
635 cause_c = 'gtool_historyauto'
636 goto 999
637 end if
638
639 do i = 1, numdims
640 call historyaxisinquire( &
641 & axis = gthst_axes(i), & ! (in)
642 & name = name ) ! (out)
643 if ( trim(varname) == trim(name) ) then
644 call historyaxisaddattr( &
645 & axis = gthst_axes(i), & ! (inout)
646 & attrname = attrname, value = value ) ! (in)
647 goto 999
648 end if
649 end do
650
651 do i = 1, numwgts
652 call historyvarinfoinquire( &
653 & varinfo = gthst_weights(i), & ! (in)
654 & name = name ) ! (out)
655 if ( trim(varname) == trim(name) ) then
656 call historyvarinfoaddattr( &
657 & varinfo = gthst_weights(i), & ! (inout)
658 & attrname = attrname, value = value ) ! (in)
659 goto 999
660 end if
661 end do
662
663 stat = hst_enoaxisname
664 cause_c = varname
665
666999 continue
667 call storeerror(stat, subname, cause_c = cause_c)
668 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function:

◆ historyautoaddattrreal1()

subroutine historyautoaddattrreal1 ( character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real, dimension(:), intent(in)  value 
)

Add attributes to axes or weights of axes.

Add attributes to axes or weights of axes. Initialization by HistoryAutoCreate is needed before use of this subroutine.

  • About axes, dims specified by HistoryAutoCreate can be specified.
  • About weights of axes, dims specified by HistoryAutoAddWeight can be specified.
  • HistoryAutoAddAttr is a generic name of multiple subroutines. Then some data type can be specified to value.
Parameters
[in]varnameName of a variable. This must be specified with dims in HistoryAutoCreate, or varname in HistoryAutoAddWeight.
[in]attrnameName of an attribute.
[in]valueValue of an attribute.

Definition at line 716 of file historyautoaddattr.f90.

719 !
720
721 !
724 use gtool_history, only: historyaxisaddattr, historyaxisinquire, &
725 & historyvarinfoaddattr, historyvarinfoinquire
726 use dc_trace, only: beginsub, endsub
728 use dc_string, only: tochar
729 use dc_types, only: string
730 implicit none
731 character(*), intent(in):: varname
732
733 character(*), intent(in):: attrname
734
735 real, intent(in):: value(:)
736
737
738 character(STRING):: name
739 integer:: stat, i
740 character(STRING):: cause_c
741 character(*), parameter:: subname = "HistoryAutoAddAttrReal1"
742 continue
743 call beginsub(subname, &
744 & 'varname=<%c> attrname=<%c>, value=<%c>', &
745 & c1=trim(varname), c2=trim(attrname), c3=trim(tochar(value)))
746 stat = dc_noerr
747 cause_c = ""
748
749 ! 初期設定チェック
750 ! Check initialization
751 !
752 if ( .not. initialized ) then
753 stat = dc_enotinit
754 cause_c = 'gtool_historyauto'
755 goto 999
756 end if
757
758 do i = 1, numdims
759 call historyaxisinquire( &
760 & axis = gthst_axes(i), & ! (in)
761 & name = name ) ! (out)
762 if ( trim(varname) == trim(name) ) then
763 call historyaxisaddattr( &
764 & axis = gthst_axes(i), & ! (inout)
765 & attrname = attrname, value = value ) ! (in)
766 goto 999
767 end if
768 end do
769
770 do i = 1, numwgts
771 call historyvarinfoinquire( &
772 & varinfo = gthst_weights(i), & ! (in)
773 & name = name ) ! (out)
774 if ( trim(varname) == trim(name) ) then
775 call historyvarinfoaddattr( &
776 & varinfo = gthst_weights(i), & ! (inout)
777 & attrname = attrname, value = value ) ! (in)
778 goto 999
779 end if
780 end do
781
782 stat = hst_enoaxisname
783 cause_c = varname
784
785999 continue
786 call storeerror(stat, subname, cause_c = cause_c)
787 call endsub(subname)

References dc_trace::beginsub(), dc_error::dc_enotinit, dc_error::dc_noerr, dc_trace::endsub(), 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(), and dc_types::string.

Here is the call graph for this function: