gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
Functions/Subroutines
gtvarcopyattrall.f90 File Reference

全属性のコピー More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarcopyattrall (to, from, err, global)
 

Detailed Description

全属性のコピー

Author
Eizi TOYODA, Yasuhiro MORIKAWA

Definition in file gtvarcopyattrall.f90.

Function/Subroutine Documentation

◆ gtvarcopyattrall()

subroutine gtvarcopyattrall ( type(gt_variable), intent(inout)  to,
type(gt_variable), intent(inout)  from,
logical, intent(out), optional  err,
logical, intent(in), optional  global 
)

1つの変数から別の変数へ全属性をコピー

変数 from の全ての属性を変数 to へコピーします。 デフォルトでは大域属性もコピーしますが、 global に .false. を与える場合、大域属性をコピーしません。

Copy_Attr は 2 つのサブルーチンの総称名であり、 他にも属性を指定してコピーする方法もあります。

Parameters
[in,out]toコピー先の変数ハンドル
[in,out]fromコピー元の変数ハンドル
[out]errエラーフラグ (省略可能)
[in]global大域属性をコピーするか (省略可能)

Definition at line 53 of file gtvarcopyattrall.f90.

54 use gtdata_types, only: gt_variable
57 use dc_url, only: gt_plus
58 use dc_error, only: dumperror
60 use dc_types, only: string
61 type(gt_variable), intent(inout):: to
62 type(gt_variable), intent(inout):: from
63 logical, intent(out), optional:: err
64 logical, intent(in), optional:: global
65 character(len = *), parameter:: subnam = "GTVarCopyAttrAll"
66 character(len = STRING):: aname
67 logical:: end
68continue
69 if (present(err)) err = .false.
70 call beginsub(subnam)
71 call attr_rewind(from)
72 do
73 call attr_next(from, aname, end)
74 if (end) exit
75 if ( (present_and_false(global)) .and. (aname(1:1) == gt_plus) ) then
76 call dbgmessage("Ignored attr=%c", c1=aname)
77 cycle
78 end if
79 call dbgmessage("Copied attr=%c", c1=aname)
80 call gtvarcopyattr(to=to, attrname=aname, from=from, err=err)
81 if (present_and_true(err)) err = .false.
82 enddo
83 call endsub(subnam)
subroutine gtvarcopyattr(to, attrname, from, err)
手続引用仕様. いずれ差し替えられるように外部関数にしておく。
Definition dc_error.f90:592
エラー処理用モジュール
Definition dc_error.f90:454
省略可能な制御パラメータの判定
logical function, public present_and_false(arg)
logical function, public present_and_true(arg)
デバッグ時の追跡用モジュール
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:661
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
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public string
文字列を保持する 文字型変数の種別型パラメタ
Definition dc_types.f90:137
変数 URL の文字列解析
Definition dc_url.f90:61
character, parameter, public gt_plus
Definition dc_url.f90:109

References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_trace::endsub(), dc_url::gt_plus, gtvarcopyattr(), dc_present::present_and_false(), dc_present::present_and_true(), and dc_types::string.

Here is the call graph for this function: