Loading...
Searching...
No Matches
Functions/Subroutines
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 13 of file gtvarcopyattrall.f90.

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
27 use gtdata_generic, only: attr_rewind, attr_next, gtvarcopyattr
28 use dc_present,only:present_and_true, present_and_false
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
40continue
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)
subroutine gtvarcopyattr(to, attrname, from, err)
Provides kind type parameter values.
Definition dc_types.f90:49
integer, parameter, public string
Character length for string
Definition dc_types.f90:118
character, parameter, public gt_plus
Definition dc_url.f90:92

References dc_url::gt_plus, gtvarcopyattr(), and dc_types::string.

Here is the call graph for this function: