52 type(
gt_history),
intent(inout),
optional,
target:: history
60 logical,
intent(in),
optional:: quiet
67 logical,
intent(out),
optional:: err
82 character(STRING):: url, file
85 character(STRING):: cause_c
86 character(len = *),
parameter:: subname =
"HistoryClose"
91 if (
present(history))
then
100 if ( .not. hst % initialized )
then
102 cause_c =
'GT_HISTORY'
110 call inquire( hst % dimvars(1), &
119 v_size =
size(hst % dimvars)
121 if (.not. hst % dim_value_written(i)) &
123 call close(hst % dimvars(i))
125 v_size =
size(hst % vars)
127 call close(hst % vars(i))
129 deallocate(hst % dimvars)
130 v_size =
size(hst % vars)
135 hst % unlimited_index = 0
136 hst % unlimited_units =
''
138 if (
associated(hst % dim_value_written))
deallocate(hst % dim_value_written)
139 if (
associated(hst % vars))
deallocate(hst % vars)
140 if (
associated(hst % growable_indices))
deallocate(hst % growable_indices)
141 if (
associated(hst % count))
deallocate(hst % count)
142 if (
associated(hst % var_avr_count))
deallocate(hst % var_avr_count)
144 if (
associated(hst % var_avr_data(i) % a_DataAvr))
deallocate(hst % var_avr_data(i) % a_DataAvr)
146 if (
associated(hst % var_avr_data))
deallocate(hst % var_avr_data)
147 if (
associated(hst % var_avr_firstput))
deallocate(hst % var_avr_firstput)
148 if (
associated(hst % var_avr_coefsum))
deallocate(hst % var_avr_coefsum)
149 if (
associated(hst % var_avr_baseint))
deallocate(hst % var_avr_baseint)
150 if (
associated(hst % var_avr_prevtime))
deallocate(hst % var_avr_prevtime)
151 hst % time_bnds = 0.0_dp
152 hst % time_bnds_output_count = 0
153 hst % time_nv_index = 0
154 hst % origin_setting = .false.
161 &
'"%c" is closed', &
162 & c1 = trim( file ), rank_mpi = -1 )
168 hst % initialized = .false.
170 call storeerror( stat, subname, err, cause_c )
subroutine historyclose(history, quiet, err)
Derived types and parameters for date and time.
integer, parameter, public unit_symbol_err
Symbol for invalid unit
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
Error storage variables
integer, parameter, public dc_enotinit
-400 or less: DC utilities errors
Judge optional control parameters.
logical function, public present_and_true(arg)
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
integer, parameter, public string
Character length for string
Variable URL string parser.
type(gt_history), target, save, public default