1SUBROUTINE errorhint(errh, ProblemFile, VALUE, value2, valueI)
23 REAL(KIND(1D0)) ::
VALUE, value2
25 CHARACTER(len=*) :: ProblemFile
26 CHARACTER(len=150) :: text1
28 INTEGER :: errh, ValueI, ValueI2, ValueI3
29 INTEGER,
DIMENSION(80) :: ErrhCount = 0
32 CHARACTER(len=1024) :: message
34 CHARACTER(len=1024) :: Errmessage
35 CHARACTER(len=1024) :: StopMessage
40 LOGICAL :: v1, v2, v3, v4, v5, v6, v7, v8, v9
41 LOGICAL :: flag_continue_on_error
43 text1 =
'unknown problem'
49 flag_continue_on_error = .false.
68 text1 =
'Check value in SUEWS_SiteSelect.txt.'
70 ELSEIF (errh == 2)
THEN
71 text1 =
'Cannot perform disaggregation.'
73 ELSEIF (errh == 3)
THEN
74 text1 =
'Met forcing file should contain only 1 year of data.'
76 ELSEIF (errh == 4)
THEN
77 text1 =
'Rainfall in original met forcing file exceeds intensity threshold.'
79 flag_continue_on_error = .true.
81 ELSEIF (errh == 6)
THEN
82 text1 =
'Value obtained exceeds permitted range, setting to +/-9999 in output file.'
84 flag_continue_on_error = .true.
85 ELSEIF (errh == 7)
THEN
86 text1 =
'RA value obtained exceeds permitted range.'
88 flag_continue_on_error = .true.
89 ELSEIF (errh == 8)
THEN
90 text1 =
'Check values in SUEWS_WithinGridWaterDist.txt.'
92 ELSEIF (errh == 9)
THEN
93 text1 =
'Check ToRunoff and ToSoilStore values in SUEWS_WithinGridWaterDist.txt.'
95 ELSEIF (errh == 10)
THEN
96 text1 =
'Check values in SUEWS_SiteSelect.txt.'
98 ELSEIF (errh == 11)
THEN
99 text1 =
'File not found.'
102 ELSEIF (errh == 13)
THEN
103 text1 =
'Check met forcing file.'
105 ELSEIF (errh == 14)
THEN
106 text1 =
'Inappropriate value calculated.'
108 ELSEIF (errh == 15)
THEN
109 text1 =
'Check H_Bldgs, H_EveTr and H_DecTr in SUEWS_SiteSelect.txt'
111 flag_continue_on_error = .true.
113 ELSEIF (errh == 17)
THEN
114 text1 =
'Problem with (z-zd) and/or z0.'
116 ELSEIF (errh == 18)
THEN
117 text1 =
'Check soil depth relative to soil moisture and capacity.'
119 ELSEIF (errh == 19)
THEN
120 text1 =
'Caution - check range.'
122 flag_continue_on_error = .true.
123 ELSEIF (errh == 20)
THEN
124 text1 =
' skip lines, ios_out.'
126 ELSEIF (errh == 21)
THEN
127 text1 =
'Bad input for OHM/AnOHM storage heat flux calculation. Check qn, qn_Sn, qf for issues.'
129 ELSEIF (errh == 22)
THEN
130 text1 =
' QH_observed, QE_observed, QH_choice: '
132 flag_continue_on_error = .true.
133 ELSEIF (errh == 23)
THEN
134 text1 =
'CBL-sonde -need to increase size of izm:zmax,izm'
136 ELSEIF (errh == 24)
THEN
137 text1 =
'CBL file problem - opening'
139 ELSEIF (errh == 25)
THEN
140 text1 =
'CBL file problem -- reading sonde data, line:'
142 ELSEIF (errh == 26)
THEN
143 text1 =
'Check that FileCode, FileInputPath and FileOutputPath are specified correctly in RunControl.nml.'
145 ELSEIF (errh == 27)
THEN
146 text1 =
'Problems with Met data -forcing data: variable value, dectime'
148 ELSEIF (errh == 28)
THEN
149 text1 =
'Processing in subroutine indicated has a problem, variables'
150 flag_continue_on_error = .true.
152 ELSEIF (errh == 29)
THEN
153 text1 =
'Processing in subroutine indicated has a problem, time, variables'
154 flag_continue_on_error = .true.
156 ELSEIF (errh == 30)
THEN
157 text1 =
'Processing in subroutine indicated has a problem, time, variables'
160 ELSEIF (errh == 31)
THEN
161 text1 =
'Processing in subroutine indicated has a problem, time, variables'
162 flag_continue_on_error = .true.
164 ELSEIF (errh == 32)
THEN
165 text1 =
'Model applicable to local scale, z<z0d'
167 ELSEIF (errh == 33)
THEN
168 text1 =
'Number of snow layers too large.'
170 ELSEIF (errh == 34)
THEN
171 text1 =
'Air temperature > 55 C -- will keep running'
173 flag_continue_on_error = .true.
174 ELSEIF (errh == 35)
THEN
175 text1 =
'Problems with Met data -forcing data: doy, dectime'
177 ELSEIF (errh == 36)
THEN
178 text1 =
'Problem found in InitialConditions file!'
180 ELSEIF (errh == 37)
THEN
181 text1 =
'Check inputs in InitialConditions file!'
182 flag_continue_on_error = .true.
184 ELSEIF (errh == 38)
THEN
185 text1 =
'H=(qn*0.2)/(avdens*avcp)'
186 flag_continue_on_error = .true.
188 ELSEIF (errh == 39)
THEN
189 text1 =
'Different value of TSTEP needed (300 s recommended). Resolution of forcing data must match TSTEP set in RunControl.'
191 ELSEIF (errh == 40)
THEN
192 text1 =
'SOLWEIG file problem - opening'
194 ELSEIF (errh == 41)
THEN
195 text1 =
' addwaterbody= Error1-- but watersurf= Error 2'
197 ELSEIF (errh == 42)
THEN
198 text1 = .OR..OR.
'abs(rho_d)<0.001000abs(rho_v)<0.001000abs(rho_d+rho_v)<0.001000) rho_v,rho_d, T'
199 flag_continue_on_error = .true.
201 ELSEIF (errh == 43)
THEN
202 text1 =
'Switching Years - will keep running'
203 flag_continue_on_error = .true.
205 ELSEIF (errh == 44)
THEN
206 text1 =
'Initial File Name - will keep going'
207 flag_continue_on_error = .true.
209 ELSEIF (errh == 45)
THEN
210 text1 =
'Pressure < 900 hPa, Loop Number'
211 flag_continue_on_error = .true.
213 ELSEIF (errh == 46)
THEN
214 text1 =
'Pressure < 900 hPa'
215 flag_continue_on_error = .true.
217 ELSEIF (errh == 47)
THEN
218 text1 =
'File missing'
220 ELSEIF (errh == 48)
THEN
221 text1 =
'Something wrong in the rows of the file'
223 ELSEIF (errh == 49)
THEN
224 text1 =
'Problems in saving to InitialConditionsYYYY.nml'
225 ELSEIF (errh == 50)
THEN
226 text1 =
'Wrong number of lines read: nsurf, [-1 EOF; -2 EOR]'
228 ELSEIF (errh == 51)
THEN
229 text1 =
'Problems in opening the file'
230 WRITE (*, *) problemfile
231 ELSEIF (errh == 52)
THEN
232 text1 =
'Problems opening the output file.'
233 ELSEIF (errh == 53)
THEN
234 text1 = .and..and.
'AH_min=0Ah_slope=0T_Critic=0, AnthropHeatMethod='
235 flag_continue_on_error = .true.
237 ELSEIF (errh == 54)
THEN
238 text1 = .and..and.
'QF_A=0QF_B=0QF_C=0, AnthropHeatMethod='
239 flag_continue_on_error = .true.
241 ELSEIF (errh == 55)
THEN
242 text1 =
'InputmetFormat='
243 flag_continue_on_error = .true.
245 ELSEIF (errh == 56)
THEN
246 text1 =
'Check input files against manual (N.B. Case sensitive).'
248 ELSEIF (errh == 57)
THEN
249 text1 =
'not found. Check input files.'
251 ELSEIF (errh == 58)
THEN
252 text1 =
'File header not specified in model code.'
254 ELSEIF (errh == 59)
THEN
255 text1 =
'not found. Check SUEWS_SiteSelect.txt.'
257 ELSEIF (errh == 60)
THEN
258 text1 =
'non-unique code.'
260 ELSEIF (errh == 61)
THEN
261 text1 =
'Check coefficients and drainage equation specified in input files.'
263 flag_continue_on_error = .true.
264 ELSEIF (errh == 62)
THEN
265 text1 =
'Problem with soil moisture calculation.'
267 ELSEIF (errh == 63)
THEN
268 text1 =
'Problem with calculation.'
270 ELSEIF (errh == 64)
THEN
271 text1 =
'SUEWS cannot currently handle this many grids.'
273 ELSEIF (errh == 65)
THEN
274 text1 =
'Negative gs calculated! Check suitability of parameters in SUEWS_Conductance.txt.'
275 flag_continue_on_error = .true.
277 ELSEIF (errh == 66)
THEN
278 text1 =
'Different number of lines in ESTM forcing and Met forcing files.'
280 ELSEIF (errh == 67)
THEN
281 text1 =
'ESTMClass1 automatically set to 100%.'
282 flag_continue_on_error = .true.
284 ELSEIF (errh == 68)
THEN
285 text1 =
'Initial Bowen ratio automatically set to 1.'
286 flag_continue_on_error = .true.
288 ELSEIF (errh == 69)
THEN
289 text1 =
'Setting QF_traff to zero. Check input data.'
290 flag_continue_on_error = .true.
292 ELSEIF (errh == 70)
THEN
293 text1 =
'Specify profile values between 1 (night) and 2 (day).'
295 ELSEIF (errh == 71)
THEN
296 text1 =
'Check input file SUEWS_Conductance.txt.'
298 ELSEIF (errh == 72)
THEN
299 text1 =
'RunControl.nml: ResolutionFilesOut must be an integer multiple of TSTEP'
301 ELSEIF (errh == 73)
THEN
302 text1 =
'Iteration loop stopped for too stable conditions.'
305 ELSEIF (errh == 74)
THEN
306 text1 =
'Iteration loop stopped for too unstable conditions.'
309 ELSEIF (errh == 75)
THEN
310 text1 =
'Invalid value for !'
313 ELSEIF (errh == 76)
THEN
314 text1 =
'erroneous T2 by RSL!'
315 flag_continue_on_error = .false.
317 ELSEIF (errh == 77)
THEN
318 text1 =
'CFL failure in ESTM_ext!' &
319 //
' dz/k should be < 0.1; ' &
320 //
'current value dz/k for facet i of surf j in group k is '
322 flag_continue_on_error = .false.
326 errhcount(errh) = errhcount(errh) + 1
332 WRITE (errmessage,
'(a,f9.4)')
' Value: ',
VALUE
334 WRITE (errmessage,
'(a,2f9.4)')
' Values: ',
VALUE, value2
336 WRITE (errmessage,
'(a,i10)')
' Value: ', valuei
338 WRITE (errmessage,
'(a,2f12.4,i10)')
' Values: ',
VALUE, value2, valuei
340 WRITE (errmessage,
'(a,f9.4,i10)')
' Values: ',
VALUE, valuei
343 WRITE (errmessage,
'(a,2i10)')
' Values: ', valuei, valuei2
345 valuei2 = int(value2)
346 WRITE (errmessage,
'(a,f9.4,2i10)')
' Values: ',
VALUE, valuei2, valuei
352 IF (flag_continue_on_error)
THEN
355 WRITE (message, *)
'Warning: ', trim(problemfile)
356 CALL wrf_debug(100, message)
357 WRITE (message, *) trim(text1)
358 CALL wrf_debug(100, message)
359 CALL wrf_debug(100, errmessage)
360 WRITE (message,
'(a,i14)')
' Count: ', errhcount(errh)
361 CALL wrf_debug(100, message)
364 OPEN (501, file=
'warnings.txt')
365 WRITE (*, *)
'>>> See warnings.txt for possible issues in the run <<<'
368 OPEN (501, file=
'warnings.txt', position=
"append")
372 WRITE (501, *)
'Warning: ', trim(problemfile)
375 WRITE (501, *) trim(text1)
378 WRITE (501, *) trim(errmessage)
380 WRITE (501,
'(a,i14)')
' Count: ', errhcount(errh)
388 WRITE (message, *)
'Problem: ', trim(problemfile)
389 CALL wrf_debug(100, message)
390 WRITE (message, *)
'ERROR! Program stopped: ', trim(text1)
391 CALL wrf_debug(100, message)
392 CALL wrf_debug(100, errmessage)
393 WRITE (message,
'(i3)') errh
394 CALL wrf_debug(100, message)
395 WRITE (message, *)
'ERROR! SUEWS run stopped.'
396 CALL wrf_debug(100, message)
397 WRITE (message, *)
'fatal error in SUEWS:', trim(text1)
398 CALL wrf_error_fatal(message)
401 OPEN (500, file=
'problems.txt')
402 WRITE (*, *)
'>>> See problems.txt for serious issues in the run <<<'
405 OPEN (500, file=
'problems.txt', position=
"append")
409 WRITE (500, *)
'Problem: ', trim(problemfile)
411 WRITE (500, *)
'ERROR! Program stopped: ', trim(text1)
414 WRITE (500, *) trim(errmessage)
416 WRITE (500,
'(i3)') errh
417 WRITE (*, *)
'ERROR! SUEWS run stopped.'
420 WRITE (*, *)
'problem: ', trim(problemfile)
421 WRITE (*, *)
'See problems.txt for more info.'
422 WRITE (stopmessage, *)
'fatal error in SUEWS:'//new_line(
'A')//trim(text1)
423 stop
'Fatal error in SUEWS!'