60 logical,
intent(out),
optional:: err
78 character(STRING):: opname, opfile
84 character(STRING):: fullfilename
88 character(STRING):: cause_c
89 character(*),
parameter:: subname =
'HstNmlInfoEndDefine'
99 if ( .not. gthstnml % initialized )
then
101 cause_c =
'GTHST_NMLINFO'
105 if ( .not. gthstnml % define_mode )
then
107 cause_c =
'EndDefine'
115 hptr => gthstnml % gthstnml_list
116 if ( .not.
associated( hptr % history ) )
then
117 allocate( hptr % history )
119 wholeloop :
do while (
associated( hptr % next ) )
120 call listnext( gthstnml_list = hptr )
121 if ( trim(hptr % name) ==
'' .or. trim(hptr % file) ==
'' ) &
124 fullfilename = trim( hptr % fileprefix ) // hptr % file
134 & opname, opfile,
end )
135 if (
end ) exit searchloop
136 if ( trim(opfile) /= trim(fullfilename) ) cycle searchloop
137 hptr_prev => gthstnml % gthstnml_list
139 call listsearch( gthstnml_list = hptr_prev, &
141 if ( .not.
associated( hptr_prev ) ) cycle searchloop
142 if ( trim(hptr % name) == trim(hptr_prev % name) ) cycle searchloop
147 if ( abs(hptr % interval_value - hptr_prev % interval_value) > sp_eps )
then
148 call messagenotify(
'W', subname, &
149 &
'@interval_value=%r (var=%a) and @interval_value=%r (var=%a) are applied to a file "%a"', &
150 & r = (/hptr % interval_value, hptr_prev % interval_value/), &
151 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
153 cause_c = fullfilename
155 elseif ( hptr % interval_unit /= hptr_prev % interval_unit )
then
156 call messagenotify(
'W', subname, &
157 &
'@interval_unit=%a (var=%a) and @interval_unit=%a (var=%a) are applied to a file "%a"', &
158 & ca = stoa(hptr % interval_unit, hptr % name, &
159 & hptr_prev % interval_unit, hptr_prev % name, &
162 cause_c = fullfilename
169 if ( abs(hptr % origin_value - hptr_prev % origin_value) > sp_eps )
then
170 call messagenotify(
'W', subname, &
171 &
'@origin_value=%r (var=%a) and @origin_value=%r (var=%a) are applied to a file "%a"', &
172 & r = (/hptr % origin_value, hptr_prev % origin_value/), &
173 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
174 stat = hst_ebadorigin
175 cause_c = fullfilename
177 elseif ( hptr % origin_unit /= hptr_prev % origin_unit )
then
178 call messagenotify(
'W', subname, &
179 &
'@origin_unit=%a (var=%a) and @origin_unit=%a (var=%a) are applied to a file "%a"', &
180 & ca = stoa(hptr % origin_unit, hptr % name, &
181 & hptr_prev % origin_unit, hptr_prev % name, &
183 stat = hst_ebadorigin
184 cause_c = fullfilename
191 if ( abs(hptr % terminus_value - hptr_prev % terminus_value) > sp_eps )
then
192 call messagenotify(
'W', subname, &
193 &
'@terminus_value=%r (var=%a) and @terminus_value=%r (var=%a) are applied to a file "%a"', &
194 & r = (/hptr % terminus_value, hptr_prev % terminus_value/), &
195 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
196 stat = hst_ebadterminus
197 cause_c = fullfilename
199 elseif ( hptr % terminus_unit /= hptr_prev % terminus_unit )
then
200 call messagenotify(
'W', subname, &
201 &
'@terminus_unit=%a (var=%a) and @terminus_unit=%a (var=%a) are applied to a file "%a"', &
202 & ca = stoa(hptr % terminus_unit, hptr % name, &
203 & hptr_prev % terminus_unit, hptr_prev % name, &
205 stat = hst_ebadterminus
206 cause_c = fullfilename
213 if ( ( hptr % newfile_intvalue > 0.0 ) &
214 & .or. ( hptr_prev % newfile_intvalue > 0.0 ) )
then
215 call messagenotify(
'W', subname, &
216 &
'when @newfile_intvalue=%d (var=%a) > 0 or' // &
217 &
' @newfile_intvalue=%d (var=%a) > 0, multiple variables can not be output to one file "%a"', &
218 & i = (/hptr % newfile_intvalue, hptr_prev % newfile_intvalue/), &
219 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
220 stat = hst_ebadnewfileint
221 cause_c = fullfilename
228 if ( hptr % newfile_intvalue /= hptr_prev % newfile_intvalue )
then
229 call messagenotify(
'W', subname, &
230 &
'@newfile_intvalue=%d (var=%a) and @newfile_intvalue=%d (var=%a) are applied to a file "%a"', &
231 & i = (/hptr % newfile_intvalue, hptr_prev % newfile_intvalue/), &
232 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
233 stat = hst_ebadnewfileint
234 cause_c = fullfilename
236 elseif ( hptr % newfile_intunit /= hptr_prev % newfile_intunit )
then
237 call messagenotify(
'W', subname, &
238 &
'@newfile_intunit=%a (var=%a) and @newfile_intunit=%a (var=%a) are applied to a file "%a"', &
239 & ca = stoa(hptr % newfile_intunit, hptr % name, &
240 & hptr_prev % newfile_intunit, hptr_prev % name, &
242 stat = hst_ebadnewfileint
243 cause_c = fullfilename
251 if ( any( hptr % slice_start /= hptr_prev % slice_start ) )
then
252 call messagenotify(
'W', subname, &
253 &
'@slice_start=%*d (var=%a) and @slice_start=%*d (var=%a) are applied to a file "%a"', &
254 & i = (/hptr % slice_start(1:10), hptr_prev % slice_start(1:10)/), &
256 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
258 cause_c = fullfilename
260 elseif ( any( hptr % slice_end /= hptr_prev % slice_end ) )
then
261 call messagenotify(
'W', subname, &
262 &
'@slice_end=%*d (var=%a) and @slice_end=%*d (var=%a) are applied to a file "%a"', &
263 & i = (/hptr % slice_end(1:10), hptr_prev % slice_end(1:10)/), &
265 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
267 cause_c = fullfilename
269 elseif ( any( hptr % slice_stride /= hptr_prev % slice_stride ) )
then
270 call messagenotify(
'W', subname, &
271 &
'@slice_stride=%*d (var=%a) and @slice_stride=%*d (var=%a) are applied to a file "%a"', &
272 & i = (/hptr % slice_stride(1:10), hptr_prev % slice_stride(1:10)/), &
274 & ca = stoa(hptr % name, hptr_prev % name, fullfilename) )
276 cause_c = fullfilename
284 hptr % history => hptr_prev % history
292 if ( .not.
associated( hptr % history ) )
then
293 allocate( hptr % history )
294 hptr % history % initialized = .false.
301 call dchashput( opened_files, &
302 & hptr % name, fullfilename )
313 gthstnml % define_mode = .false.
315 call storeerror( stat, subname, err, cause_c )
316 call endsub( subname )