53 real,
intent(in),
optional:: time
63 type(
gt_history),
intent(inout),
optional,
target:: history
81 real(DP),
intent(in),
optional:: timed
93 real,
pointer:: buffer(:) =>null()
97 logical:: err, dbg_mode
98 character(*),
parameter:: subname =
"HistorySetTime"
103 if (
present(history))
then
108 call debug( dbg_mode )
110 if (
present(difftime) )
then
111 timew =
evalbyunit( difftime,
'', hst % unlimited_units_symbol )
113 elseif (
present(timed) )
then
115 elseif (
present(time) )
then
119 if (hst % unlimited_index == 0)
then
122 var = hst % dimvars(hst % unlimited_index)
123 hst % dim_value_written(hst % unlimited_index) = .true.
124 if (
present(difftime) )
then
125 dt =
evalbyunit( difftime,
'', hst % unlimited_units_symbol )
127 elseif (
present(timed) )
then
132 elseif (
present(time) )
then
138 if ( dt < hst % oldest &
139 & .or. dt > hst % newest &
140 & .or. hst % count(2) == 0 )
then
141 hst % count(:) = maxval(hst % count(:)) + 1
142 hst % newest =
max(hst % newest, dt)
143 hst % oldest =
min(hst % oldest, dt)
144 call slice(var, 1, start=hst % count(1), count=1)
147 call put(var, (/timew/), 1, err)
148 if (err)
call dumperror()
151 call slice(var, 1, start=1, count=hst % count(2))
152 call get(var, buffer, err)
153 hst % count(1:1) = minloc(abs(buffer - timew))
subroutine historysettime(time, history, difftime, timed)
Interface declarations for procedures provided from dc_date.
Derived types and parameters for date and time.
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
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)
Provides kind type parameter values.
integer, parameter, public dp
Double Precision Real number
type(gt_history), target, save, public default