historygetattr.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine historygettattrchar0 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrint0 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrint1 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrreal0 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrreal1 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrdouble0 (file, varname, attrname, value, flag_mpi_split, err)
 
subroutine historygettattrdouble1 (file, varname, attrname, value, flag_mpi_split, err)
 

Function/Subroutine Documentation

◆ historygettattrchar0()

subroutine historygettattrchar0 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
character(*), intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 39 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

39  !
40  !
41  !== gtool4 データ内の変数の属性の取得
42  !
43  ! gtool4 データおよびそのデータ内の変数に設定されている属性を取得します。
44  !
45  ! 属性名 *attrname* の先頭にプラス "<b><tt>+</tt></b>" を付加する
46  ! 場合は、gtool4 データ自体の属性 (大域属性) として属性が取得されます。
47  ! この場合、*varname* は無視されますが、
48  ! その場合でも *varname* へはデータ内に存在する変数名を与えてください。
49  !
50  ! 取得する属性が存在しない場合、以下の値が返ります。
51  !
52  ! character :: "" (空文字)
53  ! real :: netcdf_f77#NF_FILL_FLOAT
54  ! real(DP) :: netcdf_f77#NF_FILL_DOUBLE
55  ! integer :: netcdf_f77#NF_FILL_INT
56  !
57  ! *HistoryGetAttr* は複数のサブルーチンの総称名です。*value* には
58  ! いくつかの型を与えることが可能です。
59  ! 下記のサブルーチンを参照ください。
60  !
61  !
62  use gtdata_types, only: gt_variable
63  use gtdata_generic, only: get_attr, open, close
64  use dc_types, only: string, dp
65  use dc_string, only: tochar, joinchar
67  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
68  use dc_message, only: messagenotify
69  use dc_trace, only: beginsub, endsub
70  use dc_present, only: present_and_true
72  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
73  implicit none
74  character(*), intent(in):: file
75  ! netCDF ファイル名.
76  character(*), intent(in):: varname
77  ! 変数名.
78  character(*), intent(in):: attrname
79  ! 属性の名称.
80  !
81  ! "<b><tt>+</tt></b>" (プラス)
82  ! を属性名の先頭につける場合には,
83  ! 大域属性を取得します.
84  character(*), intent(out):: value
85  ! 属性の値.
86  !
87  logical, intent(in), optional:: flag_mpi_split
88  ! MPI 使用時にこの引数に .true. を与えると,
89  ! *file* 引数に "_rankXXXXXX"
90  ! (X は [0-9] の数値で, ノード番号を指す)
91  ! を付加したファイル名を各ノードで読み込みます.
92  ! 例えば, *file* に "input.nc" を与えた場合.
93  ! ノード 0 では "input_rank000000.nc",
94  ! ノード 12 では "input_rank000012.nc"
95  ! を読み込みます.
96  ! デフォルトは .false. です.
97  !
98  ! When MPI is used, if ".true." is given,
99  ! a filename that "_rankXXXXXX"
100  ! (X is [0-9] that indicates node number)
101  ! is added to *file* argument is loaded
102  ! on each node.
103  ! For example, "input.nc" is given to *file*,
104  ! "input_rank000000.nc", "input_rank000012.nc"
105  ! are loaded on node 0 and node 12.
106  ! Default value is ".false.".
107  !
108  logical, intent(out), optional:: err
109  ! 例外処理用フラグ.
110  ! デフォルトでは, この手続き内でエラーが
111  ! 生じた場合, プログラムは強制終了します.
112  ! 引数 *err* が与えられる場合,
113  ! プログラムは強制終了せず, 代わりに
114  ! *err* に .true. が代入されます.
115  !
116  ! Exception handling flag.
117  ! By default, when error occur in
118  ! this procedure, the program aborts.
119  ! If this *err* argument is given,
120  ! .true. is substituted to *err* and
121  ! the program does not abort.
122  type(gt_variable):: var
123  character(STRING):: file_work, url
124  integer:: stat
125  character(STRING):: cause_c
126  character(len = *), parameter:: subname = "HistoryGetAttrChar0"
127  !--
128  interface ! historyget.rb2f90 で定義されているものを使用
129  function file_rename_mpi( file ) result(result)
130  use dc_types, only: string
131  character(*), intent(in):: file
132  character(STRING):: result
133  end function file_rename_mpi
134  end interface
135  !++
136  continue
137  call beginsub(subname, &
138  & 'file=<%c> varname=<%c> attrname=<%c>', &
139  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
140  stat = dc_noerr
141  cause_c = ''
142  ! ファイル名の変更 (MPI 用)
143  ! Change filename (for MPI)
144  !
145  file_work = file
146  if ( present_and_true( flag_mpi_split ) ) &
147  & file_work = file_rename_mpi( file_work )
148  ! 変数 URL の作成
149  ! Create variable URL
150  !
151  url = urlmerge( file_work, varname )
152  ! ファイルオープン
153  ! File open
154  !
155  call open( var, url, err = err )
156  if ( present_and_true(err) ) then
157  stat = gt_enoturl
158  cause_c = url
159  goto 999
160  end if
161  ! デフォルト値の設定
162  ! Set default value
163  !
164  ! 属性の取得
165  ! Get an attribute
166  !
167  call get_attr( var, attrname, value &
168  & )
169  ! ファイルオープン
170  ! File open
171  !
172  call close( var )
173 999 continue
174  call storeerror(stat, subname, err, cause_c=cause_c)
175  call endsub(subname)
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrdouble0()

subroutine historygettattrdouble0 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real(dp), intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 513 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

513  !
514  !
515  use gtdata_types, only: gt_variable
516  use gtdata_generic, only: get_attr, open, close
517  use dc_types, only: string, dp
518  use dc_string, only: tochar, joinchar
520  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
521  use dc_message, only: messagenotify
522  use dc_trace, only: beginsub, endsub
523  use dc_present, only: present_and_true
525  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
526  implicit none
527  character(*), intent(in):: file
528  character(*), intent(in):: varname
529  character(*), intent(in):: attrname
530  real(DP), intent(out):: value
531  logical, intent(in), optional:: flag_mpi_split
532  logical, intent(out), optional:: err
533  type(gt_variable):: var
534  character(STRING):: file_work, url
535  integer:: stat
536  character(STRING):: cause_c
537  character(len = *), parameter:: subname = "HistoryGetAttrDouble0"
538  !--
539  interface ! historyget.rb2f90 で定義されているものを使用
540  function file_rename_mpi( file ) result(result)
541  use dc_types, only: string
542  character(*), intent(in):: file
543  character(STRING):: result
544  end function file_rename_mpi
545  end interface
546  !++
547  continue
548  call beginsub(subname, &
549  & 'file=<%c> varname=<%c> attrname=<%c>', &
550  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
551  stat = dc_noerr
552  cause_c = ''
553  ! ファイル名の変更 (MPI 用)
554  ! Change filename (for MPI)
555  !
556  file_work = file
557  if ( present_and_true( flag_mpi_split ) ) &
558  & file_work = file_rename_mpi( file_work )
559  ! 変数 URL の作成
560  ! Create variable URL
561  !
562  url = urlmerge( file_work, varname )
563  ! ファイルオープン
564  ! File open
565  !
566  call open( var, url, err = err )
567  if ( present_and_true(err) ) then
568  stat = gt_enoturl
569  cause_c = url
570  goto 999
571  end if
572  ! デフォルト値の設定
573  ! Set default value
574  !
575  ! 属性の取得
576  ! Get an attribute
577  !
578  call get_attr( var, attrname, value &
579  & )
580  ! ファイルオープン
581  ! File open
582  !
583  call close( var )
584 999 continue
585  call storeerror(stat, subname, err, cause_c=cause_c)
586  call endsub(subname)
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrdouble1()

subroutine historygettattrdouble1 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real(dp), dimension(:), intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 594 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

594  !
595  !
596  use gtdata_types, only: gt_variable
597  use gtdata_generic, only: get_attr, open, close
598  use dc_types, only: string, dp
599  use dc_string, only: tochar, joinchar
601  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
602  use dc_message, only: messagenotify
603  use dc_trace, only: beginsub, endsub
604  use dc_present, only: present_and_true
606  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
607  implicit none
608  character(*), intent(in):: file
609  character(*), intent(in):: varname
610  character(*), intent(in):: attrname
611  real(DP), intent(out):: value(:)
612  logical, intent(in), optional:: flag_mpi_split
613  logical, intent(out), optional:: err
614  type(gt_variable):: var
615  real(DP):: default
616  character(STRING):: file_work, url
617  integer:: stat
618  character(STRING):: cause_c
619  character(len = *), parameter:: subname = "HistoryGetAttrDouble1"
620  !--
621  interface ! historyget.rb2f90 で定義されているものを使用
622  function file_rename_mpi( file ) result(result)
623  use dc_types, only: string
624  character(*), intent(in):: file
625  character(STRING):: result
626  end function file_rename_mpi
627  end interface
628  !++
629  continue
630  call beginsub(subname, &
631  & 'file=<%c> varname=<%c> attrname=<%c>', &
632  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
633  stat = dc_noerr
634  cause_c = ''
635  ! ファイル名の変更 (MPI 用)
636  ! Change filename (for MPI)
637  !
638  file_work = file
639  if ( present_and_true( flag_mpi_split ) ) &
640  & file_work = file_rename_mpi( file_work )
641  ! 変数 URL の作成
642  ! Create variable URL
643  !
644  url = urlmerge( file_work, varname )
645  ! ファイルオープン
646  ! File open
647  !
648  call open( var, url, err = err )
649  if ( present_and_true(err) ) then
650  stat = gt_enoturl
651  cause_c = url
652  goto 999
653  end if
654  ! デフォルト値の設定
655  ! Set default value
656  !
657  default = nf90_fill_double
658  ! 属性の取得
659  ! Get an attribute
660  !
661  call get_attr( var, attrname, value &
662  & , default &
663  & )
664  ! ファイルオープン
665  ! File open
666  !
667  call close( var )
668 999 continue
669  call storeerror(stat, subname, err, cause_c=cause_c)
670  call endsub(subname)
type(gt_history), target, save, public default
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrint0()

subroutine historygettattrint0 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
integer, intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 183 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

183  !
184  !
185  use gtdata_types, only: gt_variable
186  use gtdata_generic, only: get_attr, open, close
187  use dc_types, only: string, dp
188  use dc_string, only: tochar, joinchar
190  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
191  use dc_message, only: messagenotify
192  use dc_trace, only: beginsub, endsub
193  use dc_present, only: present_and_true
195  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
196  implicit none
197  character(*), intent(in):: file
198  character(*), intent(in):: varname
199  character(*), intent(in):: attrname
200  integer, intent(out):: value
201  logical, intent(in), optional:: flag_mpi_split
202  logical, intent(out), optional:: err
203  type(gt_variable):: var
204  character(STRING):: file_work, url
205  integer:: stat
206  character(STRING):: cause_c
207  character(len = *), parameter:: subname = "HistoryGetAttrInt0"
208  !--
209  interface ! historyget.rb2f90 で定義されているものを使用
210  function file_rename_mpi( file ) result(result)
211  use dc_types, only: string
212  character(*), intent(in):: file
213  character(STRING):: result
214  end function file_rename_mpi
215  end interface
216  !++
217  continue
218  call beginsub(subname, &
219  & 'file=<%c> varname=<%c> attrname=<%c>', &
220  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
221  stat = dc_noerr
222  cause_c = ''
223  ! ファイル名の変更 (MPI 用)
224  ! Change filename (for MPI)
225  !
226  file_work = file
227  if ( present_and_true( flag_mpi_split ) ) &
228  & file_work = file_rename_mpi( file_work )
229  ! 変数 URL の作成
230  ! Create variable URL
231  !
232  url = urlmerge( file_work, varname )
233  ! ファイルオープン
234  ! File open
235  !
236  call open( var, url, err = err )
237  if ( present_and_true(err) ) then
238  stat = gt_enoturl
239  cause_c = url
240  goto 999
241  end if
242  ! デフォルト値の設定
243  ! Set default value
244  !
245  ! 属性の取得
246  ! Get an attribute
247  !
248  call get_attr( var, attrname, value &
249  & )
250  ! ファイルオープン
251  ! File open
252  !
253  call close( var )
254 999 continue
255  call storeerror(stat, subname, err, cause_c=cause_c)
256  call endsub(subname)
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrint1()

subroutine historygettattrint1 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
integer, dimension(:), intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 264 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

264  !
265  !
266  use gtdata_types, only: gt_variable
267  use gtdata_generic, only: get_attr, open, close
268  use dc_types, only: string, dp
269  use dc_string, only: tochar, joinchar
271  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
272  use dc_message, only: messagenotify
273  use dc_trace, only: beginsub, endsub
274  use dc_present, only: present_and_true
276  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
277  implicit none
278  character(*), intent(in):: file
279  character(*), intent(in):: varname
280  character(*), intent(in):: attrname
281  integer, intent(out):: value(:)
282  logical, intent(in), optional:: flag_mpi_split
283  logical, intent(out), optional:: err
284  type(gt_variable):: var
285  integer:: default
286  character(STRING):: file_work, url
287  integer:: stat
288  character(STRING):: cause_c
289  character(len = *), parameter:: subname = "HistoryGetAttrInt1"
290  !--
291  interface ! historyget.rb2f90 で定義されているものを使用
292  function file_rename_mpi( file ) result(result)
293  use dc_types, only: string
294  character(*), intent(in):: file
295  character(STRING):: result
296  end function file_rename_mpi
297  end interface
298  !++
299  continue
300  call beginsub(subname, &
301  & 'file=<%c> varname=<%c> attrname=<%c>', &
302  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
303  stat = dc_noerr
304  cause_c = ''
305  ! ファイル名の変更 (MPI 用)
306  ! Change filename (for MPI)
307  !
308  file_work = file
309  if ( present_and_true( flag_mpi_split ) ) &
310  & file_work = file_rename_mpi( file_work )
311  ! 変数 URL の作成
312  ! Create variable URL
313  !
314  url = urlmerge( file_work, varname )
315  ! ファイルオープン
316  ! File open
317  !
318  call open( var, url, err = err )
319  if ( present_and_true(err) ) then
320  stat = gt_enoturl
321  cause_c = url
322  goto 999
323  end if
324  ! デフォルト値の設定
325  ! Set default value
326  !
327  default = nf90_fill_int
328  ! 属性の取得
329  ! Get an attribute
330  !
331  call get_attr( var, attrname, value &
332  & , default &
333  & )
334  ! ファイルオープン
335  ! File open
336  !
337  call close( var )
338 999 continue
339  call storeerror(stat, subname, err, cause_c=cause_c)
340  call endsub(subname)
type(gt_history), target, save, public default
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrreal0()

subroutine historygettattrreal0 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real, intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 348 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

348  !
349  !
350  use gtdata_types, only: gt_variable
351  use gtdata_generic, only: get_attr, open, close
352  use dc_types, only: string, dp
353  use dc_string, only: tochar, joinchar
355  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
356  use dc_message, only: messagenotify
357  use dc_trace, only: beginsub, endsub
358  use dc_present, only: present_and_true
360  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
361  implicit none
362  character(*), intent(in):: file
363  character(*), intent(in):: varname
364  character(*), intent(in):: attrname
365  real, intent(out):: value
366  logical, intent(in), optional:: flag_mpi_split
367  logical, intent(out), optional:: err
368  type(gt_variable):: var
369  character(STRING):: file_work, url
370  integer:: stat
371  character(STRING):: cause_c
372  character(len = *), parameter:: subname = "HistoryGetAttrReal0"
373  !--
374  interface ! historyget.rb2f90 で定義されているものを使用
375  function file_rename_mpi( file ) result(result)
376  use dc_types, only: string
377  character(*), intent(in):: file
378  character(STRING):: result
379  end function file_rename_mpi
380  end interface
381  !++
382  continue
383  call beginsub(subname, &
384  & 'file=<%c> varname=<%c> attrname=<%c>', &
385  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
386  stat = dc_noerr
387  cause_c = ''
388  ! ファイル名の変更 (MPI 用)
389  ! Change filename (for MPI)
390  !
391  file_work = file
392  if ( present_and_true( flag_mpi_split ) ) &
393  & file_work = file_rename_mpi( file_work )
394  ! 変数 URL の作成
395  ! Create variable URL
396  !
397  url = urlmerge( file_work, varname )
398  ! ファイルオープン
399  ! File open
400  !
401  call open( var, url, err = err )
402  if ( present_and_true(err) ) then
403  stat = gt_enoturl
404  cause_c = url
405  goto 999
406  end if
407  ! デフォルト値の設定
408  ! Set default value
409  !
410  ! 属性の取得
411  ! Get an attribute
412  !
413  call get_attr( var, attrname, value &
414  & )
415  ! ファイルオープン
416  ! File open
417  !
418  call close( var )
419 999 continue
420  call storeerror(stat, subname, err, cause_c=cause_c)
421  call endsub(subname)
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function:

◆ historygettattrreal1()

subroutine historygettattrreal1 ( character(*), intent(in)  file,
character(*), intent(in)  varname,
character(*), intent(in)  attrname,
real, dimension(:), intent(out)  value,
logical, intent(in), optional  flag_mpi_split,
logical, intent(out), optional  err 
)

Definition at line 429 of file historygetattr.f90.

References dc_trace::beginsub(), dc_error::dc_noerr, dc_types::dp, dc_trace::endsub(), file_rename_mpi(), dc_url::gt_atmark, dc_url::gt_comma, dc_error::gt_enoturl, dc_url::gt_equal, dc_url::gt_plus, dc_error::hst_empinoaxisdata, dc_string::joinchar(), dc_present::present_and_true(), dc_error::storeerror(), and dc_types::string.

429  !
430  !
431  use gtdata_types, only: gt_variable
432  use gtdata_generic, only: get_attr, open, close
433  use dc_types, only: string, dp
434  use dc_string, only: tochar, joinchar
436  use dc_error, only: storeerror, dc_noerr, nf90_enotvar, hst_empinoaxisdata
437  use dc_message, only: messagenotify
438  use dc_trace, only: beginsub, endsub
439  use dc_present, only: present_and_true
441  use netcdf, only: nf90_fill_float, nf90_fill_double, nf90_fill_int
442  implicit none
443  character(*), intent(in):: file
444  character(*), intent(in):: varname
445  character(*), intent(in):: attrname
446  real, intent(out):: value(:)
447  logical, intent(in), optional:: flag_mpi_split
448  logical, intent(out), optional:: err
449  type(gt_variable):: var
450  real:: default
451  character(STRING):: file_work, url
452  integer:: stat
453  character(STRING):: cause_c
454  character(len = *), parameter:: subname = "HistoryGetAttrReal1"
455  !--
456  interface ! historyget.rb2f90 で定義されているものを使用
457  function file_rename_mpi( file ) result(result)
458  use dc_types, only: string
459  character(*), intent(in):: file
460  character(STRING):: result
461  end function file_rename_mpi
462  end interface
463  !++
464  continue
465  call beginsub(subname, &
466  & 'file=<%c> varname=<%c> attrname=<%c>', &
467  & c1=trim(file), c2=trim(varname), c3=trim(attrname) )
468  stat = dc_noerr
469  cause_c = ''
470  ! ファイル名の変更 (MPI 用)
471  ! Change filename (for MPI)
472  !
473  file_work = file
474  if ( present_and_true( flag_mpi_split ) ) &
475  & file_work = file_rename_mpi( file_work )
476  ! 変数 URL の作成
477  ! Create variable URL
478  !
479  url = urlmerge( file_work, varname )
480  ! ファイルオープン
481  ! File open
482  !
483  call open( var, url, err = err )
484  if ( present_and_true(err) ) then
485  stat = gt_enoturl
486  cause_c = url
487  goto 999
488  end if
489  ! デフォルト値の設定
490  ! Set default value
491  !
492  default = nf90_fill_float
493  ! 属性の取得
494  ! Get an attribute
495  !
496  call get_attr( var, attrname, value &
497  & , default &
498  & )
499  ! ファイルオープン
500  ! File open
501  !
502  call close( var )
503 999 continue
504  call storeerror(stat, subname, err, cause_c=cause_c)
505  call endsub(subname)
type(gt_history), target, save, public default
character, parameter, public gt_comma
Definition: dc_url.f90:85
character, parameter, public gt_equal
Definition: dc_url.f90:87
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
character, parameter, public gt_atmark
Definition: dc_url.f90:79
integer, parameter, public hst_empinoaxisdata
Definition: dc_error.f90:598
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition: dc_error.f90:830
integer, parameter, public dc_noerr
Definition: dc_error.f90:509
integer, parameter, public gt_enoturl
Definition: dc_error.f90:546
character(string) function, public joinchar(carray, expr)
Definition: dc_string.f90:861
integer, parameter, public dp
倍精度実数型変数
Definition: dc_types.f90:83
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
文字型変数の操作.
Definition: dc_string.f90:24
種別型パラメタを提供します。
Definition: dc_types.f90:49
character(string) function file_rename_mpi(file)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:446
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition: dc_types.f90:118
Here is the call graph for this function: