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

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

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

revision 1.4 by mlosch, Mon Apr 19 23:25:15 2004 UTC revision 1.5 by heimbach, Thu Oct 26 01:22:00 2006 UTC
# Line 79  c     ================================== Line 79  c     ==================================
79  c     == global variables ==  c     == global variables ==
80    
81  #include "EEPARAMS.h"  #include "EEPARAMS.h"
82    #include "SIZE.h"
83    #include "PARAMS.h"
84    
85  c     == routine arguments ==  c     == routine arguments ==
86    
# Line 93  c     == local variables == Line 95  c     == local variables ==
95        integer nroutine        integer nroutine
96        integer nerrcode        integer nerrcode
97        logical missingerrcode        logical missingerrcode
98          CHARACTER*(MAX_LEN_MBUF) msgBuf
99    
100  c     == end of interface ==  c     == end of interface ==
101    
# Line 104  c     == end of interface == Line 107  c     == end of interface ==
107  c     Error in cal_Init  c     Error in cal_Init
108    
109          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
110            print*,           WRITE(msgBuf,'(A)')
111       &    '  cal_Init: Unable to open calendar parameter file'       &    '  cal_Init: Unable to open calendar parameter file'
112            print*,           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
113             CALL PRINT_ERROR( msgBuf , 1)
114             WRITE(msgBuf,'(A)')
115       &    '            file "data.calendar".'       &    '            file "data.calendar".'
116             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
117             CALL PRINT_ERROR( msgBuf , 1)
118          endif          endif
119    
120        else if (nroutine .eq. 1) then        else if (nroutine .eq. 1) then
121  c     Error in cal_Set  c     Error in cal_Set
122    
123          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
124            print*,           WRITE(msgBuf,'(A)')
125       &    '  cal_Set: No appropriate calendar has been specified.'       &    '  cal_Set: No appropriate calendar has been specified.'
126             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
127             CALL PRINT_ERROR( msgBuf , 1)
128          else if (nerrcode .eq. 2) then          else if (nerrcode .eq. 2) then
129            print*,           WRITE(msgBuf,'(A)')
130       &    '  cal_Set: The time step specified is not valid.'       &    '  cal_Set: The time step specified is not valid.'
131             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
132             CALL PRINT_ERROR( msgBuf , 1)
133          else if (nerrcode .eq. 3) then          else if (nerrcode .eq. 3) then
134            print*,           WRITE(msgBuf,'(A)')
135       &    '  cal_Set: The time step is less than a second.'       &    '  cal_Set: The time step is less than a second.'
136             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
137             CALL PRINT_ERROR( msgBuf , 1)
138          else if (nerrcode .eq. 4) then          else if (nerrcode .eq. 4) then
139            print*,           WRITE(msgBuf,'(A)')
140       &    '  cal_Set: The time step contains fractions of a',       &    '  cal_Set: The time step contains fractions of a second.'
141       &                   ' second.'           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
142             CALL PRINT_ERROR( msgBuf , 1)
143          else if (nerrcode .eq. 5) then          else if (nerrcode .eq. 5) then
144            print*,           WRITE(msgBuf,'(A)')
145       &    '  cal_Set: Less than one time step per calendar day.'       &    '  cal_Set: Less than one time step per calendar day.'
146             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
147             CALL PRINT_ERROR( msgBuf , 1)
148          else if (nerrcode .eq. 6) then          else if (nerrcode .eq. 6) then
149            print*,           WRITE(msgBuf,'(A)')
150       &    '  cal_Set: The specifications are incomplete. Please'       &    '  cal_Set: The specifications are incomplete. Please'
151            print*,           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
152             CALL PRINT_ERROR( msgBuf , 1)
153             WRITE(msgBuf,'(A)')
154       &    '                refer to the documentation.'       &    '                refer to the documentation.'
155             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
156             CALL PRINT_ERROR( msgBuf , 1)
157          else if (nerrcode .eq. 7) then          else if (nerrcode .eq. 7) then
158            print*,           WRITE(msgBuf,'(A)')
159       &    '  cal_Set: The final date of integration is before its'       &    '  cal_Set: The final date of integration is before its'
160            print*,           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
161             CALL PRINT_ERROR( msgBuf , 1)
162             WRITE(msgBuf,'(A)')
163       &    '                start date.'       &    '                start date.'
164             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
165             CALL PRINT_ERROR( msgBuf , 1)
166          else if (nerrcode .eq. 10) then          else if (nerrcode .eq. 10) then
167            print*,           WRITE(msgBuf,'(A)')
168       &    '  cal_Set: The Julian Calendar is not implemented yet.'       &    '  cal_Set: The Julian Calendar is not implemented yet.'
169             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
170             CALL PRINT_ERROR( msgBuf , 1)
171          else if (nerrcode .eq. 11) then          else if (nerrcode .eq. 11) then
172            print*,           WRITE(msgBuf,'(A)')
173       &    '  cal_Set: The No Calendar case is not implemented yet.'       &    '  cal_Set: The No Calendar case is not implemented yet.'
174             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
175             CALL PRINT_ERROR( msgBuf , 1)
176          else if ( nerrcode .eq. 12) then          else if ( nerrcode .eq. 12) then
177            print*,           WRITE(msgBuf,'(A)')
178       &    '  cal_Set: modelstart .ne. startTime ... please check.'       &    '  cal_Set: modelstart .ne. startTime ... please check.'
179             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
180             CALL PRINT_ERROR( msgBuf , 1)
181          else if ( nerrcode .eq. 13 ) then          else if ( nerrcode .eq. 13 ) then
182            print*,           WRITE(msgBuf,'(A)')
183       &    '  cal_Set: modelend .ne. endTime ... please check.'       &    '  cal_Set: modelend .ne. endTime ... please check.'
184             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
185             CALL PRINT_ERROR( msgBuf , 1)
186          else if ( nerrcode .eq. 14 ) then          else if ( nerrcode .eq. 14 ) then
187            print*,           WRITE(msgBuf,'(A)')
188       &    '  cal_Set: modelstep .ne. deltaTclock ... please check.'       &    '  cal_Set: modelstep .ne. deltaTclock ... please check.'
189             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
190             CALL PRINT_ERROR( msgBuf , 1)
191          else if ( nerrcode .eq. 15 ) then          else if ( nerrcode .eq. 15 ) then
192            print*,           WRITE(msgBuf,'(A)')
193       &    '  cal_Set: modeliter0 .ne. nIter0 ... please check.'       &    '  cal_Set: modeliter0 .ne. nIter0 ... please check.'
194          else if ( nerrcode .eq. 16 ) then          else if ( nerrcode .eq. 16 ) then
195            print*,           WRITE(msgBuf,'(A)')
196       &    '  cal_Set: modeliterend .ne. nEndIter ... please check.'       &    '  cal_Set: modeliterend .ne. nEndIter ... please check.'
197             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
198             CALL PRINT_ERROR( msgBuf , 1)
199          else if ( nerrcode .eq. 17 ) then          else if ( nerrcode .eq. 17 ) then
200            print*,           WRITE(msgBuf,'(A)')
201       &    '  cal_Set: modelintsteps .ne. nTimeSteps',       &    '  cal_Set: modelintsteps .ne. nTimeSteps'
202       &    ' ... please check.'           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
203             CALL PRINT_ERROR( msgBuf , 1)
204          else          else
205            missingerrcode = .true.            missingerrcode = .true.
206          endif          endif
# Line 187  c     Error in cal_IsLeap Line 224  c     Error in cal_IsLeap
224  c     Error in cal_TimePassed  c     Error in cal_TimePassed
225    
226          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
227            print*,           WRITE(msgBuf,'(A)')
228       &    '  cal_TimePassed: calendar and timeinterval cannot',       &    'cal_TimePassed: cal and timeinterval cannot be compared'
229       &    ' be compared.'           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
230             CALL PRINT_ERROR( msgBuf , 1)
231          else          else
232            missingerrcode = .true.            missingerrcode = .true.
233          endif          endif
# Line 198  c     Error in cal_TimePassed Line 236  c     Error in cal_TimePassed
236  c     Error in cal_AddTime  c     Error in cal_AddTime
237    
238          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
239            print*,           WRITE(msgBuf,'(A)')
240       &    '  cal_AddTime: not a valid time interval.'       &    '  cal_AddTime: not a valid time interval.'
241             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
242             CALL PRINT_ERROR( msgBuf , 1)
243          else          else
244            missingerrcode = .true.            missingerrcode = .true.
245          endif          endif
# Line 208  c     Error in cal_AddTime Line 248  c     Error in cal_AddTime
248  c     Error in cal_TimeInterval  c     Error in cal_TimeInterval
249    
250          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
251            print*,           WRITE(msgBuf,'(A)')
252       &    '  cal_TimeInterval: not a valid time unit.'       &    '  cal_TimeInterval: not a valid time unit.'
253             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
254             CALL PRINT_ERROR( msgBuf , 1)
255          else          else
256            missingerrcode = .true.            missingerrcode = .true.
257          endif          endif
# Line 218  c     Error in cal_TimeInterval Line 260  c     Error in cal_TimeInterval
260  c     Error in cal_SubDates  c     Error in cal_SubDates
261    
262          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
263            print*,           WRITE(msgBuf,'(A)')
264       &    '  cal_SubDates: Not a valid combination of calendar dates'       &    '  cal_SubDates: Not a valid combination of calendar dates'
265            print*,           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
266             CALL PRINT_ERROR( msgBuf , 1)
267             WRITE(msgBuf,'(A)')
268       &    '             or time intervals.'       &    '             or time intervals.'
269             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
270             CALL PRINT_ERROR( msgBuf , 1)
271          else          else
272            missingerrcode = .true.            missingerrcode = .true.
273          endif          endif
# Line 230  c     Error in cal_SubDates Line 276  c     Error in cal_SubDates
276  c     Error in cal_ConvDate  c     Error in cal_ConvDate
277    
278          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
279            print*,           WRITE(msgBuf,'(A)')
280       &    '  cal_ConvDate: date specification has mixed signs.'       &    '  cal_ConvDate: date specification has mixed signs.'
281             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
282             CALL PRINT_ERROR( msgBuf , 1)
283          else          else
284            missingerrcode = .true.            missingerrcode = .true.
285          endif          endif
# Line 240  c     Error in cal_ConvDate Line 288  c     Error in cal_ConvDate
288  c     Error in cal_ToSeconds  c     Error in cal_ToSeconds
289    
290          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
291            print*,           WRITE(msgBuf,'(A)')
292       &    '  cal_ToSeconds: input not a time interval array.'       &    '  cal_ToSeconds: input not a time interval array.'
293             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
294             CALL PRINT_ERROR( msgBuf , 1)
295          else          else
296            missingerrcode = .true.            missingerrcode = .true.
297          endif          endif
# Line 250  c     Error in cal_ToSeconds Line 300  c     Error in cal_ToSeconds
300  c     Error in cal_StepsPerDay  c     Error in cal_StepsPerDay
301    
302          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
303            print*,           WRITE(msgBuf,'(A)')
304       &    '  cal_StepsPerDay: nothing else to do.'       &    '  cal_StepsPerDay: nothing else to do.'
305             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
306             CALL PRINT_ERROR( msgBuf , 1)
307          else          else
308            missingerrcode = .true.            missingerrcode = .true.
309          endif          endif
# Line 260  c     Error in cal_StepsPerDay Line 312  c     Error in cal_StepsPerDay
312  c     Error in cal_DaysPerMonth  c     Error in cal_DaysPerMonth
313    
314          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
315            print*,           WRITE(msgBuf,'(A)')
316       &    '  cal_DaysPerMonth: current year after final year.'       &    '  cal_DaysPerMonth: current year after final year.'
317             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
318             CALL PRINT_ERROR( msgBuf , 1)
319          else          else
320            missingerrcode = .true.            missingerrcode = .true.
321          endif          endif
# Line 295  c     Error in cal_nStepDay Line 349  c     Error in cal_nStepDay
349  c     Error in cal_CheckDate  c     Error in cal_CheckDate
350    
351          if (nerrcode .eq. 0) then          if (nerrcode .eq. 0) then
352            print*,           WRITE(msgBuf,'(A)')
353       &    '   cal_CheckDate: A valid date specification!'       &    '   cal_CheckDate: A valid date specification!'
354            print*,           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
355             CALL PRINT_ERROR( msgBuf , 1)
356             WRITE(msgBuf,'(A)')
357       &    '               --> This only means that the format is ok!'       &    '               --> This only means that the format is ok!'
358             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
359             CALL PRINT_ERROR( msgBuf , 1)
360          else if (nerrcode .eq. 1) then          else if (nerrcode .eq. 1) then
361            print*,           WRITE(msgBuf,'(A)')
362       &    '   cal_CheckDate: Last component of array not valid!'       &    '   cal_CheckDate: Last component of array not valid!'
363             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
364             CALL PRINT_ERROR( msgBuf , 1)
365          else if (nerrcode .eq. 2) then          else if (nerrcode .eq. 2) then
366            print*,           WRITE(msgBuf,'(A)')
367       &    '   cal_CheckDate: Third component of interval array',       &    '   cal_CheckDate: Third component of interval array not 0'
368       &    '  not zero!'           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
369             CALL PRINT_ERROR( msgBuf , 1)
370          else if (nerrcode .eq. 3) then          else if (nerrcode .eq. 3) then
371            print*,           WRITE(msgBuf,'(A)')
372       &    '   cal_CheckDate: Signs of first two components unequal!'       &    '   cal_CheckDate: Signs of first two components unequal!'
373             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
374             CALL PRINT_ERROR( msgBuf , 1)
375          else if (nerrcode .eq. 4) then          else if (nerrcode .eq. 4) then
376            print*,           WRITE(msgBuf,'(A)')
377       &    '   cal_CheckDate: Second component not in hhmmss format!'       &    '   cal_CheckDate: Second component not in hhmmss format!'
378             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
379             CALL PRINT_ERROR( msgBuf , 1)
380          else if (nerrcode .eq. 5) then          else if (nerrcode .eq. 5) then
381            print*,           WRITE(msgBuf,'(A)')
382       &    '   cal_CheckDate: Weekday indentifier not correct!'       &    '   cal_CheckDate: Weekday indentifier not correct!'
383             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
384             CALL PRINT_ERROR( msgBuf , 1)
385          else if (nerrcode .eq. 6) then          else if (nerrcode .eq. 6) then
386            print*,           WRITE(msgBuf,'(A)')
387       &    '   cal_CheckDate: Leap year identifier not correct!'       &    '   cal_CheckDate: Leap year identifier not correct!'
388             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
389             CALL PRINT_ERROR( msgBuf , 1)
390          else if (nerrcode .eq. 7) then          else if (nerrcode .eq. 7) then
391            print*,           WRITE(msgBuf,'(A)')
392       &    '   cal_CheckDate: Calendar date before predefined reference'       &    'cal_CheckDate: Calendar date before predef. reference date'
393       &    //' date!'           CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
394             CALL PRINT_ERROR( msgBuf , 1)
395          else if (nerrcode .eq. 8) then          else if (nerrcode .eq. 8) then
396            print*,           WRITE(msgBuf,'(A)')
397       &    '   cal_CheckDate: First component not in yymmdd format!'       &    '   cal_CheckDate: First component not in yymmdd format!'
398             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
399             CALL PRINT_ERROR( msgBuf , 1)
400          else          else
401            missingerrcode = .true.            missingerrcode = .true.
402          endif          endif
# Line 338  c     Error in cal_PrintError Line 410  c     Error in cal_PrintError
410  c     Error in cal_PrintDate  c     Error in cal_PrintDate
411    
412          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
413            print*,           WRITE(msgBuf,'(A)')
414       &    '  cal_PrintDate: date not a legal calendar array.'       &    '  cal_PrintDate: date not a legal calendar array.'
415             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
416             CALL PRINT_ERROR( msgBuf , 1)
417          else          else
418            missingerrcode = .true.            missingerrcode = .true.
419          endif          endif
# Line 353  c     Error in cal_PrintError Line 427  c     Error in cal_PrintError
427  c     Error in cal_NumInts  c     Error in cal_NumInts
428    
429          if (nerrcode .eq. 1) then          if (nerrcode .eq. 1) then
430            print*,           WRITE(msgBuf,'(A)')
431       &    '  cal_NumInts: Expected a time interval as third argument.'       &    '  cal_NumInts: Expected a time interval as third argument.'
432             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
433             CALL PRINT_ERROR( msgBuf , 1)
434          else          else
435            missingerrcode = .true.            missingerrcode = .true.
436          endif          endif

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22