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 if ( .not. src % mpi_gather &
102 & .or. ( src % mpi_gather .and. src % mpi_myrank == 0 ) )
then
103 numdims =
size(src % dimvars)
105 & source=source_src, institution=institution_src, &
106 & dims=dims, dimsizes=dimsizes, longnames=longnames, &
107 & units=units, xtypes=xtypes, &
108 & conventions=conventions_src, gt_version=gt_version_src)
109 if (
present(origin) )
then
110 originw = real(origin, kind(originw))
112 originw = real(src % origin, kind(originw))
115 intervalw = src % interval
117 if (
present(interval) )
then
118 if ( abs(real(interval, kind(intervalw))) >
dp_eps )
then
119 intervalw = real(interval, kind(intervalw))
125 & institution=trim(
present_select(
'', institution_src, institution)), &
126 & dims=dims, dimsizes=dimsizes, longnames=longnames, units=units, &
127 & origind=originw, intervald=intervalw, &
129 & history=hist_dest, &
130 & conventions=trim(
present_select(
'', conventions_src, conventions)), &
131 & gt_version=trim(
present_select(
'', gt_version_src, gt_version)) )
137 call copy_attr(hist_dest % dimvars(i), src % dimvars (i), global=.false.)
141 if (dimsizes(i) == 0) cycle
142 call get(src % dimvars(i), dimvalue, err)
147 deallocate(dims, dimsizes, longnames, units, xtypes)
163 & title, source, institution, &
164 & origin, interval, &
165 & conventions, gt_version)
170 type(
gt_history),
intent(out),
target:: hist_dest
171 character(*),
intent(in):: file
172 type(
gt_history),
intent(in),
optional,
target:: hist_src
173 character(*),
intent(in),
optional:: title, source, institution
174 real,
intent(in),
optional:: origin, interval
175 character(*),
intent(in),
optional:: conventions, gt_version
177 character(len = *),
parameter:: subname =
"HistoryCopy2"
179 call beginsub(subname,
'file=<%c>', c1=trim(file))
181 & title, source, institution, &
182 & origin, interval, &
183 & 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)