36 use dc_trace
, only: beginsub, endsub
37 use dc_string
, only: putline, printf, split, strinclude, stoa, joinchar
39 use dc_hash, only: hash, dchashput, dchashget, dchashrewind, dchashnext, dchashnumber
43 use dc_message
, only: messagenotify
46 logical,
intent(out),
optional:: err
64 character(STRING):: opname, opfile
70 character(STRING):: fullfilename
74 character(STRING):: cause_c
75 character(*),
parameter:: subname =
'HstNmlInfoEndDefine' 77 call beginsub( subname )
85 if ( .not. gthstnml % initialized )
then 87 cause_c =
'GTHST_NMLINFO' 91 if ( .not. gthstnml % define_mode )
then 101 hptr => gthstnml % gthstnml_list
102 if ( .not.
associated( hptr % history ) )
then 103 allocate( hptr % history )
105 wholeloop :
do while (
associated( hptr % next ) )
106 call listnext( gthstnml_list = hptr )
107 if ( trim(hptr % name) ==
'' .or. trim(hptr % file) ==
'' ) &
110 fullfilename = trim( hptr % fileprefix ) // hptr % file
120 & opname, opfile, end )
121 if ( end )
exit searchloop
122 if ( trim(opfile) /= trim(fullfilename) ) cycle searchloop
123 hptr_prev => gthstnml % gthstnml_list
125 call listsearch( gthstnml_list = hptr_prev, &
127 if ( .not.
associated( hptr_prev ) ) cycle searchloop
128 if ( trim(hptr % name) == trim(hptr_prev % name) ) cycle searchloop
133 if ( hptr % interval_value /= hptr_prev % interval_value )
then 134 call messagenotify(
'W', subname, &
135 &
'@interval_value=%r (var=%a) and @interval_value=%r (var=%a) are applied to a file "%a"', &
136 & r = (/hptr % interval_value, hptr_prev % interval_value/), &
137 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
139 cause_c = fullfilename
141 elseif ( hptr % interval_unit /= hptr_prev % interval_unit )
then 142 call messagenotify(
'W', subname, &
143 &
'@interval_unit=%a (var=%a) and @interval_unit=%a (var=%a) are applied to a file "%a"', &
144 & ca = stoa(hptr % interval_unit, hptr % name, &
145 & hptr_prev % interval_unit, hptr_prev % name, &
148 cause_c = fullfilename
155 if ( hptr % origin_value /= hptr_prev % origin_value )
then 156 call messagenotify(
'W', subname, &
157 &
'@origin_value=%r (var=%a) and @origin_value=%r (var=%a) are applied to a file "%a"', &
158 & r = (/hptr % origin_value, hptr_prev % origin_value/), &
159 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
161 cause_c = fullfilename
163 elseif ( hptr % origin_unit /= hptr_prev % origin_unit )
then 164 call messagenotify(
'W', subname, &
165 &
'@origin_unit=%a (var=%a) and @origin_unit=%a (var=%a) are applied to a file "%a"', &
166 & ca = stoa(hptr % origin_unit, hptr % name, &
167 & hptr_prev % origin_unit, hptr_prev % name, &
170 cause_c = fullfilename
177 if ( hptr % terminus_value /= hptr_prev % terminus_value )
then 178 call messagenotify(
'W', subname, &
179 &
'@terminus_value=%r (var=%a) and @terminus_value=%r (var=%a) are applied to a file "%a"', &
180 & r = (/hptr % terminus_value, hptr_prev % terminus_value/), &
181 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
183 cause_c = fullfilename
185 elseif ( hptr % terminus_unit /= hptr_prev % terminus_unit )
then 186 call messagenotify(
'W', subname, &
187 &
'@terminus_unit=%a (var=%a) and @terminus_unit=%a (var=%a) are applied to a file "%a"', &
188 & ca = stoa(hptr % terminus_unit, hptr % name, &
189 & hptr_prev % terminus_unit, hptr_prev % name, &
192 cause_c = fullfilename
199 if ( ( hptr % newfile_intvalue > 0.0 ) &
200 & .or. ( hptr_prev % newfile_intvalue > 0.0 ) )
then 201 call messagenotify(
'W', subname, &
202 &
'when @newfile_intvalue=%d (var=%a) > 0 or' // &
203 &
' @newfile_intvalue=%d (var=%a) > 0, multiple variables can not be output to one file "%a"', &
204 & i = (/hptr % newfile_intvalue, hptr_prev % newfile_intvalue/), &
205 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
207 cause_c = fullfilename
214 if ( hptr % newfile_intvalue /= hptr_prev % newfile_intvalue )
then 215 call messagenotify(
'W', subname, &
216 &
'@newfile_intvalue=%d (var=%a) and @newfile_intvalue=%d (var=%a) are applied to a file "%a"', &
217 & i = (/hptr % newfile_intvalue, hptr_prev % newfile_intvalue/), &
218 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
220 cause_c = fullfilename
222 elseif ( hptr % newfile_intunit /= hptr_prev % newfile_intunit )
then 223 call messagenotify(
'W', subname, &
224 &
'@newfile_intunit=%a (var=%a) and @newfile_intunit=%a (var=%a) are applied to a file "%a"', &
225 & ca = stoa(hptr % newfile_intunit, hptr % name, &
226 & hptr_prev % newfile_intunit, hptr_prev % name, &
229 cause_c = fullfilename
237 if ( any( hptr % slice_start /= hptr_prev % slice_start ) )
then 238 call messagenotify(
'W', subname, &
239 &
'@slice_start=%*d (var=%a) and @slice_start=%*d (var=%a) are applied to a file "%a"', &
240 & i = (/hptr % slice_start(1:10), hptr_prev % slice_start(1:10)/), &
242 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
244 cause_c = fullfilename
246 elseif ( any( hptr % slice_end /= hptr_prev % slice_end ) )
then 247 call messagenotify(
'W', subname, &
248 &
'@slice_end=%*d (var=%a) and @slice_end=%*d (var=%a) are applied to a file "%a"', &
249 & i = (/hptr % slice_end(1:10), hptr_prev % slice_end(1:10)/), &
251 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
253 cause_c = fullfilename
255 elseif ( any( hptr % slice_stride /= hptr_prev % slice_stride ) )
then 256 call messagenotify(
'W', subname, &
257 &
'@slice_stride=%*d (var=%a) and @slice_stride=%*d (var=%a) are applied to a file "%a"', &
258 & i = (/hptr % slice_stride(1:10), hptr_prev % slice_stride(1:10)/), &
260 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
262 cause_c = fullfilename
270 hptr % history => hptr_prev % history
278 if ( .not.
associated( hptr % history ) )
then 279 allocate( hptr % history )
280 hptr % history % initialized = .false.
288 & hptr % name, fullfilename )
299 gthstnml % define_mode = .false.
301 call storeerror( stat, subname, err, cause_c )
302 call endsub( subname )
integer, parameter, public hst_enotindefine
integer, parameter, public dc_enotinit
integer, parameter, public token
Character length for word, token.
type(hash), save, public opened_files
integer, parameter, public hst_eintfile
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
subroutine hstnmlinfoenddefine(gthstnml, err)
integer, parameter, public hst_ebadterminus
integer, parameter, public hst_ebadslice
integer, parameter, public hst_ebadnewfileint
integer, parameter, public dp
Double Precision Real number.
integer, parameter, public stdout
Unit number for Standard OUTPUT.
Provides kind type parameter values.
integer, parameter, public hst_ebadorigin
integer, parameter, public string
Character length for string.