62 & title, source, institution, &
64 & conventions, gt_version)
74 type(
gt_history),
intent(out),
target:: hist_dest
75 character(*),
intent(in):: file
76 type(
gt_history),
intent(in),
optional,
target:: hist_src
77 character(*),
intent(in),
optional:: title, source, institution
78 real,
intent(in),
optional:: origin, interval
79 character(*),
intent(in),
optional:: conventions, gt_version
82 character(STRING) :: title_src, source_src, institution_src
83 character(STRING) :: conventions_src, gt_version_src
84 character(STRING),
pointer:: dims(:) => null()
85 integer ,
pointer:: dimsizes(:) => null()
86 character(STRING),
pointer:: longnames(:) => null()
87 character(STRING),
pointer:: units(:) => null()
88 character(STRING),
pointer:: xtypes(:) => null()
89 real(DP):: originw, intervalw
92 real(DP),
pointer :: dimvalue(:) => null()
93 character(len = *),
parameter:: subname =
"HistoryCopy1"
95 call beginsub(subname,
'file=<%c>', c1=trim(file))
96 if (
present(hist_src))
then
101 numdims =
size(src % dimvars)
103 & source=source_src, institution=institution_src, &
104 & dims=dims, dimsizes=dimsizes, longnames=longnames, &
105 & units=units, xtypes=xtypes, &
106 & conventions=conventions_src, gt_version=gt_version_src)
107 if (
present(origin) )
then
108 originw = real(origin, kind(originw))
110 originw = real(src % origin, kind(originw))
113 intervalw = src % interval
115 if (
present(interval) )
then
116 if ( abs(real(interval, kind(intervalw))) >
dp_eps )
then
117 intervalw = real(interval, kind(intervalw))
123 & institution=trim(
present_select(
'', institution_src, institution)), &
124 & dims=dims, dimsizes=dimsizes, longnames=longnames, units=units, &
125 & origind=originw, intervald=intervalw, &
127 & history=hist_dest, &
128 & conventions=trim(
present_select(
'', conventions_src, conventions)), &
129 & gt_version=trim(
present_select(
'', gt_version_src, gt_version)) )
135 call copy_attr(hist_dest % dimvars(i), src % dimvars (i), global=.false.)
139 if (dimsizes(i) == 0) cycle
140 call get(src % dimvars(i), dimvalue, err)
145 deallocate(dims, dimsizes, longnames, units, xtypes)
160 & title, source, institution, &
161 & origin, interval, &
162 & conventions, gt_version)
167 type(
gt_history),
intent(out),
target:: hist_dest
168 character(*),
intent(in):: file
169 type(
gt_history),
intent(in),
optional,
target:: hist_src
170 character(*),
intent(in),
optional:: title, source, institution
171 real,
intent(in),
optional:: origin, interval
172 character(*),
intent(in),
optional:: conventions, gt_version
174 character(len = *),
parameter:: subname =
"HistoryCopy2"
176 call beginsub(subname,
'file=<%c>', c1=trim(file))
178 & title, source, institution, &
179 & origin, interval, &
180 & conventions, gt_version)
subroutine historycopy1(hist_dest, file, hist_src, title, source, institution, origin, interval, conventions, gt_version)
subroutine historycopy2(hist_dest, file, hist_src, title, source, institution, origin, interval, conventions, gt_version)
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)