Go to the source code of this file.
◆ gtvarcopyattr()
subroutine gtvarcopyattr |
( |
type(gt_variable), intent(inout) |
to, |
|
|
character(len = *), intent(in) |
attrname, |
|
|
type(gt_variable), intent(in) |
from, |
|
|
logical, intent(out), optional |
err |
|
) |
| |
Definition at line 14 of file gtvarcopyattr.f90.
References dc_error::dc_noerr, dc_error::storeerror(), dc_types::string, and gtdata_internal_map::var_class().
32 use dc_trace
, only: beginsub, endsub
36 type(gt_variable),
intent(inout):: to
37 character(len = *),
intent(in):: attrname
38 type(gt_variable),
intent(in):: from
39 logical,
intent(out),
optional:: err
40 character(STRING):: svalue
41 integer:: from_class, from_cid, to_class, to_cid, stat
43 if (
present(err)) err = .false.
44 call beginsub(
'gtvarcopyattr',
'mapid to=%d from=%d name=%c', &
45 & i=(/to%mapid, from%mapid/), c1=attrname)
46 call var_class(from, from_class, from_cid)
48 if (from_class == vtb_class_netcdf .and. to_class == vtb_class_netcdf)
then 53 call get_attr(from, attrname, svalue, default=
'')
54 call put_attr(to, attrname, svalue,
'', err)
58 call endsub(
'gtvarcopyattr',
'stat = %d', i=(/stat/))
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
Provides kind type parameter values.
subroutine, public var_class(var, class, cid)
integer, parameter, public string
Character length for string.