[MITgcm-devel] calendar checkdate
Jean-Michel Campin
jmc at ocean.mit.edu
Sun Apr 8 16:52:09 EDT 2012
Hi,
I made some changes in the way CAL_CHECKDATE works:
- in cal_fulldate.F (currently the only routine which calls CAL_CHECKDATE)
always stop if CAL_CHECKDATE returns valid=F (fatal error).
- and only the most serious errors in CAL_CHECKDATE switch "valid" to F.
I also added a stop for invalid month index (this was a frequent
source of access to out-of-bounds array), change the valid weekday
to be less or equal to 7 (was 8 before), and (with warning only) check
separately for validity of the 3 pieces of date(2) (=hhmmss).
I would like also change the warning to a stop when date(1) < refDate(1)
(i.e., date before the reference date), since this causes a problem
when finding the day of the week (in cal_fulldate.F, I disabled this part).
And have 2 questions:
1) Does someone knows why the stop (in cal_fulldate.F) was commented out
in v.1.3 (Apr 19, 2004), to just give a warning when CAL_CHECKDATE detects
an error ? Martin made this modification (but it's not very recent).
2) negative date seems to be a problem (equivalent to a date before
reference date when TheCalendar='model'), e.g. in cal_timepassed.F.
So if we decide not to stop when date(1) < refDate(1), I would propose
at least to stop when the date is negative.
Cheers,
Jean-Michel
More information about the MITgcm-devel
mailing list