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

Copy all attributes. More...

Go to the source code of this file.

Functions/Subroutines

subroutine gtvarcopyattrall (to, from, err, global)
 

Detailed Description

Copy all attributes.

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 
)

Copy all attributes from one variable to another

Copies all attributes of variable from to variable to. By default, global attributes are also copied. If global is set to .false., global attributes are not copied.

Copy_Attr is a generic name for 2 subroutines; there is also a method to copy by specifying an attribute.

Parameters
[in,out]toDestination variable handle
[in,out]fromSource variable handle
[out]errError flag (optional)
[in]globalWhether to copy global attributes (optional)

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)
Procedure reference specification. Made as an external function to be replaceable in the future.
Definition dc_error.f90:592
Error handling module.
Definition dc_error.f90:454
Judge optional control parameters.
logical function, public present_and_false(arg)
logical function, public present_and_true(arg)
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:680
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
Variable URL string parser.
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: