gtvarcopyattrall.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarcopyattrall (to, from, err, global)
 

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 
)

Definition at line 14 of file gtvarcopyattrall.f90.

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

14  !
15  !== 属性のコピー
16  !
17  ! 変数 *from* の全ての属性を変数 *to* へコピーします。
18  !
19  ! デフォルトでは大域属性もコピーしますが、
20  ! *global* に .false. を与える場合、大域属性をコピーしません。
21  !
22  ! *Copy_Attr* は 2 つのサブルーチンの総称名であり、
23  ! 他にも属性を指定してコピーする方法もあります。
24  ! 上記のサブルーチンを参照ください。
25  !
26  use gtdata_types, only: gt_variable
29  use dc_url, only: gt_plus
30  use dc_error, only: dumperror
31  use dc_trace, only: beginsub, endsub, dbgmessage
32  use dc_types, only: string
33  type(gt_variable), intent(inout):: to
34  type(gt_variable), intent(inout):: from
35  logical, intent(out), optional:: err
36  logical, intent(in), optional:: global
37  character(len = *), parameter:: subnam = "GTVarCopyAttrAll"
38  character(len = STRING):: aname
39  logical:: end
40 continue
41  if (present(err)) err = .false.
42  call beginsub(subnam)
43  call attr_rewind(from)
44  do
45  call attr_next(from, aname, end)
46  if (end) exit
47  if ( (present_and_false(global)) .and. (aname(1:1) == gt_plus) ) then
48  call dbgmessage("Ignored attr=%c", c1=aname)
49  cycle
50  end if
51  call dbgmessage("Copied attr=%c", c1=aname)
52  call gtvarcopyattr(to=to, attrname=aname, from=from, err=err)
53  if (present_and_true(err)) err = .false.
54  enddo
55  call endsub(subnam)
logical function, public present_and_true(arg)
Definition: dc_present.f90:80
character, parameter, public gt_plus
Definition: dc_url.f90:92
logical function, public present_and_false(arg)
Definition: dc_present.f90:99
subroutine gtvarcopyattr(to, attrname, from, err)
subroutine, public dbgmessage(fmt, i, r, d, L, n, c1, c2, c3, ca)
Definition: dc_trace.f90:509
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
Definition: dc_trace.f90:351
種別型パラメタを提供します。
Definition: dc_types.f90:49
subroutine dumperror()
Definition: dc_error.f90:942
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: