/[MITgcm]/MITgcm/pkg/cal/cal_printerror.F
ViewVC logotype

Contents of /MITgcm/pkg/cal/cal_printerror.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon May 14 22:07:27 2001 UTC (23 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint47e_post, checkpoint44e_post, checkpoint46l_post, checkpoint46g_pre, checkpoint47c_post, release1_p13_pre, checkpoint50c_post, checkpoint46f_post, checkpoint48e_post, checkpoint50c_pre, checkpoint44f_post, checkpoint46b_post, checkpoint43a-release1mods, ecco_c50_e32, ecco_c50_e33, ecco_c50_e30, ecco_c50_e31, release1_p13, checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint48i_post, checkpoint40pre9, checkpoint40pre8, checkpoint46l_pre, chkpt44d_post, checkpoint51, checkpoint50, release1_p8, release1_p9, checkpoint50d_post, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, checkpoint50b_pre, checkpoint44e_pre, checkpoint51f_post, release1_b1, ecco_c51_e34d, ecco_c51_e34e, ecco_c51_e34f, ecco_c51_e34g, ecco_c51_e34a, ecco_c51_e34b, ecco_c51_e34c, checkpoint48b_post, checkpoint43, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, release1_chkpt44d_post, checkpoint47a_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint47d_post, icebear5, icebear4, icebear3, icebear2, checkpoint46d_pre, checkpoint40pre2, checkpoint48d_post, release1-branch_tutorials, checkpoint48f_post, checkpoint45d_post, checkpoint46j_pre, chkpt44a_post, checkpoint44h_pre, checkpoint48h_post, checkpoint40pre4, ecco_c50_e29, checkpoint51b_pre, checkpoint46a_post, checkpoint47g_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, ecco_c50_e28, chkpt44c_pre, checkpoint48a_post, checkpoint45a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, ecco_c44_e19, ecco_c44_e18, ecco_c44_e17, ecco_c44_e16, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, checkpoint47j_post, ecco_c50_e33a, branch-exfmods-tag, checkpoint44g_post, branchpoint-genmake2, checkpoint46e_pre, checkpoint48c_post, checkpoint45b_post, checkpoint46b_pre, release1-branch-end, release1_final_v1, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint46, checkpoint47b_post, checkpoint44b_post, ecco_c51_e34, checkpoint46h_pre, checkpoint46m_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, ecco_ice2, ecco_ice1, checkpoint44h_post, checkpoint46g_post, release1_p12_pre, checkpoint39, ecco_c44_e22, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, ecco_c44_e25, checkpoint51i_pre, checkpoint40pre5, checkpoint47f_post, checkpoint50e_post, chkpt44a_pre, checkpoint46i_post, ecco_c44_e23, ecco_c44_e20, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, checkpoint46c_post, ecco-branch-mod1, ecco-branch-mod2, ecco-branch-mod3, ecco-branch-mod4, ecco-branch-mod5, checkpoint50d_pre, checkpoint46e_post, release1_beta1, checkpoint51e_post, checkpoint44b_pre, checkpoint42, checkpoint40, checkpoint41, checkpoint47, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint46h_post, checkpoint51f_pre, chkpt44c_post, checkpoint48g_post, checkpoint47h_post, checkpoint44f_pre, checkpoint51g_post, checkpoint46d_post, checkpoint50b_post, release1-branch_branchpoint, checkpoint51a_post
Branch point for: c24_e25_ice, branch-exfmods-curt, release1_final, release1-branch, branch-genmake2, release1, ecco-branch, release1_50yr, icebear, release1_coupled
Added calendar package.
Not currently supported by mitgcm, i.e. disabled by default.

1 C $Header: /u/gcmpack/development/heimbach/ecco_env/pkg/cal/cal_printerror.F,v 1.4 2001/02/02 16:57:22 heimbach Exp $
2
3 #include "CAL_CPPOPTIONS.h"
4
5 subroutine cal_PrintError(
6 I calerr,
7 I mythid
8 & )
9
10 c ==================================================================
11 c SUBROUTINE cal_PrintError
12 c ==================================================================
13 c
14 c Purpose: Use the MITgcmuv's print routines to document errors that
15 c occured during the execution of the calendar tool.
16 c
17 c o Calling this routine allows to print out an error message for
18 c several errors that might occur.
19 c
20 c The error codes for the calendar tool are specified by a four
21 c digit integer:
22 c RRCC
23 c
24 c The RR digits identify the routine that detected the error.
25 c The CC digits identify the specific error in the routine that
26 c detected the error.
27 c
28 c RR translates to routines in the following way:
29 c
30 c cal_Init 0
31 c cal_Set 1
32 c cal_GetDate 2
33 c cal_FullDate 3
34 c cal_IsLeap 4
35 c cal_TimePassed 5
36 c cal_AddTime 6
37 c cal_TimeInterval 7
38 c cal_SubDates 8
39 c cal_ConvDate 9
40 c cal_ToSeconds 10
41 c cal_StepsPerDay 11
42 c cal_DaysPerMonth 12
43 c cal_MonthsPerYear 13
44 c cal_IntYears 14
45 c cal_IntMonths 15
46 c cal_IntDays 16
47 c cal_nStepDay 17
48 c cal_CheckDate 18
49 c cal_PrintError 19
50 c cal_PrintDate 20
51 c cal_NumInts 25
52 c
53 c
54 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
55 c
56 c changed: Christian Eckert eckert@mit.edu 29-Dec-1999
57 c
58 c Christian Eckert eckert@mit.edu 10-Jan-2000
59 c
60 c - Corrected the print statement for error code 104.
61 c It contained more than 72 characters in one line.
62 c
63 c Christian Eckert eckert@mit.edu 03-Feb-2000
64 c
65 c - Introduced new routine and function names, cal_<NAME>,
66 c for verion 0.1.3.
67 c
68 c Christian Eckert eckert@mit.edu 24-Feb-2000
69 c
70 c - Included cal_NumInts error code.
71 c
72 c ==================================================================
73 c SUBROUTINE cal_PrintError
74 c ==================================================================
75
76 implicit none
77
78 c == global variables ==
79
80 #include "EEPARAMS.h"
81
82 c == routine arguments ==
83
84 c mythid - thread number for this instance of the routine.
85 c calerr - error code
86
87 integer mythid
88 integer calerr
89
90 c == local variables ==
91
92 integer nroutine
93 integer nerrcode
94 logical missingerrcode
95
96 c == end of interface ==
97
98 nerrcode = mod(calerr,100)
99 nroutine = (calerr - nerrcode)/100
100 missingerrcode = .false.
101
102 if (nroutine .eq. 0) then
103 c Error in cal_Init
104
105 if (nerrcode .eq. 1) then
106 print*,
107 & ' cal_Init: Unable to open calendar parameter file'
108 print*,
109 & ' file "data.calendar".'
110 endif
111
112 else if (nroutine .eq. 1) then
113 c Error in cal_Set
114
115 if (nerrcode .eq. 1) then
116 print*,
117 & ' cal_Set: No appropriate calendar has been specified.'
118 else if (nerrcode .eq. 2) then
119 print*,
120 & ' cal_Set: The time step specified is not valid.'
121 else if (nerrcode .eq. 3) then
122 print*,
123 & ' cal_Set: The time step is less than a second.'
124 else if (nerrcode .eq. 4) then
125 print*,
126 & ' cal_Set: The time step contains fractions of a',
127 & ' second.'
128 else if (nerrcode .eq. 5) then
129 print*,
130 & ' cal_Set: Less than one time step per calendar day.'
131 else if (nerrcode .eq. 6) then
132 print*,
133 & ' cal_Set: The specifications are incomplete. Please'
134 print*,
135 & ' refer to the documentation.'
136 else if (nerrcode .eq. 7) then
137 print*,
138 & ' cal_Set: The final date of integration is before its'
139 print*,
140 & ' start date.'
141 else if (nerrcode .eq. 10) then
142 print*,
143 & ' cal_Set: The Julian Calendar is not implemented yet.'
144 else if (nerrcode .eq. 11) then
145 print*,
146 & ' cal_Set: The No Calendar case is not implemented yet.'
147 else if ( nerrcode .eq. 12) then
148 print*,
149 & ' cal_Set: modelstart .ne. startTime ... please check.'
150 else if ( nerrcode .eq. 13 ) then
151 print*,
152 & ' cal_Set: modelend .ne. endTime ... please check.'
153 else if ( nerrcode .eq. 14 ) then
154 print*,
155 & ' cal_Set: modelstep .ne. deltaTclock ... please check.'
156 else if ( nerrcode .eq. 15 ) then
157 print*,
158 & ' cal_Set: modeliter0 .ne. nIter0 ... please check.'
159 else if ( nerrcode .eq. 16 ) then
160 print*,
161 & ' cal_Set: modeliterend .ne. nEndIter ... please check.'
162 else if ( nerrcode .eq. 17 ) then
163 print*,
164 & ' cal_Set: modelintsteps .ne. nTimeSteps',
165 & ' ... please check.'
166 else
167 missingerrcode = .true.
168 endif
169
170 else if (nroutine .eq. 2) then
171 c Error in cal_GetDate
172
173 missingerrcode = .true.
174
175 else if (nroutine .eq. 3) then
176 c Error in cal_FullDate
177
178 missingerrcode = .true.
179
180 else if (nroutine .eq. 4) then
181 c Error in cal_IsLeap
182
183 missingerrcode = .true.
184
185 else if (nroutine .eq. 5) then
186 c Error in cal_TimePassed
187
188 if (nerrcode .eq. 1) then
189 print*,
190 & ' cal_TimePassed: calendar and timeinterval cannot',
191 & ' be compared.'
192 else
193 missingerrcode = .true.
194 endif
195
196 else if (nroutine .eq. 6) then
197 c Error in cal_AddTime
198
199 if (nerrcode .eq. 1) then
200 print*,
201 & ' cal_AddTime: not a valid time interval.'
202 else
203 missingerrcode = .true.
204 endif
205
206 else if (nroutine .eq. 7) then
207 c Error in cal_TimeInterval
208
209 if (nerrcode .eq. 1) then
210 print*,
211 & ' cal_TimeInterval: not a valid time unit.'
212 else
213 missingerrcode = .true.
214 endif
215
216 else if (nroutine .eq. 8) then
217 c Error in cal_SubDates
218
219 if (nerrcode .eq. 1) then
220 print*,
221 & ' cal_SubDates: Not a valid combination of calendar dates'
222 print*,
223 & ' or time intervals.'
224 else
225 missingerrcode = .true.
226 endif
227
228 else if (nroutine .eq. 9) then
229 c Error in cal_ConvDate
230
231 if (nerrcode .eq. 1) then
232 print*,
233 & ' cal_ConvDate: date specification has mixed signs.'
234 else
235 missingerrcode = .true.
236 endif
237
238 else if (nroutine .eq. 10) then
239 c Error in cal_ToSeconds
240
241 if (nerrcode .eq. 1) then
242 print*,
243 & ' cal_ToSeconds: input not a time interval array.'
244 else
245 missingerrcode = .true.
246 endif
247
248 else if (nroutine .eq. 11) then
249 c Error in cal_StepsPerDay
250
251 if (nerrcode .eq. 1) then
252 print*,
253 & ' cal_StepsPerDay: nothing else to do.'
254 else
255 missingerrcode = .true.
256 endif
257
258 else if (nroutine .eq. 12) then
259 c Error in cal_DaysPerMonth
260
261 if (nerrcode .eq. 1) then
262 print*,
263 & ' cal_DaysPerMonth: current year after final year.'
264 else
265 missingerrcode = .true.
266 endif
267
268 else if (nroutine .eq. 13) then
269 c Error in cal_MonthsPerYear
270
271 missingerrcode = .true.
272
273 else if (nroutine .eq. 14) then
274 c Error in cal_IntYears
275
276 missingerrcode = .true.
277
278 else if (nroutine .eq. 15) then
279 c Error in cal_IntMonths
280
281 missingerrcode = .true.
282
283 else if (nroutine .eq. 16) then
284 c Error in cal_IntDays
285
286 missingerrcode = .true.
287
288 else if (nroutine .eq. 17) then
289 c Error in cal_nStepDay
290
291 missingerrcode = .true.
292
293 else if (nroutine .eq. 18) then
294 c Error in cal_CheckDate
295
296 if (nerrcode .eq. 0) then
297 print*,
298 & ' cal_CheckDate: A valid date specification!'
299 print*,
300 & ' --> This only means that the format is ok!'
301 else if (nerrcode .eq. 1) then
302 print*,
303 & ' cal_CheckDate: Last component of array not valid!'
304 else if (nerrcode .eq. 2) then
305 print*,
306 & ' cal_CheckDate: Third component of interval array',
307 & ' not zero!'
308 else if (nerrcode .eq. 3) then
309 print*,
310 & ' cal_CheckDate: Signs of first two components unequal!'
311 else if (nerrcode .eq. 4) then
312 print*,
313 & ' cal_CheckDate: Second component not in hhmmss format!'
314 else if (nerrcode .eq. 5) then
315 print*,
316 & ' cal_CheckDate: Weekday indentifier not correct!'
317 else if (nerrcode .eq. 6) then
318 print*,
319 & ' cal_CheckDate: Leap year identifier not correct!'
320 else if (nerrcode .eq. 7) then
321 print*,
322 & ' cal_CheckDate: Calendar date before predefined reference',
323 & ' date!'
324 else if (nerrcode .eq. 8) then
325 print*,
326 & ' cal_CheckDate: First component not in yymmdd format!'
327 else
328 missingerrcode = .true.
329 endif
330
331 else if (nroutine .eq. 19) then
332 c Error in cal_PrintError
333
334 missingerrcode = .true.
335
336 else if (nroutine .eq. 20) then
337 c Error in cal_PrintDate
338
339 if (nerrcode .eq. 1) then
340 print*,
341 & ' cal_PrintDate: date not a legal calendar array.'
342 else
343 missingerrcode = .true.
344 endif
345
346 else if (nroutine .eq. 21) then
347 c Error in cal_PrintError
348
349 missingerrcode = .true.
350
351 else if (nroutine .eq. 25) then
352 c Error in cal_NumInts
353
354 if (nerrcode .eq. 1) then
355 print*,
356 & ' cal_NumInts: Expected a time interval as third argument.'
357 else
358 missingerrcode = .true.
359 endif
360
361 else
362 missingerrcode = .true.
363 endif
364
365 if (missingerrcode) then
366 print*,' cal_PrintError: routine called by an undefined'
367 print*,' error code.'
368 print*,' cal_PrintError: error code = ',calerr
369 stop ' stopped in cal_PrintError.'
370 endif
371
372 return
373 end
374

  ViewVC Help
Powered by ViewVC 1.1.22