Dates and Time Conventions

Throughout the EDSS and Models-3 systems -- and particularly in the I/O API -- dates and times represent Greenwich Mean Time. Dates and times (and time-increments) are stored as integers, using the coding formats
    HHMMSS  = 10000 * hour  +  100 * minutes  +  seconds
    YYYYDDD =  1000 * year  +  day
where the year is 4-digits (1994, say, rather than just 94), and the day is the Julian day-number (1,...,365 or 366).

A time step sequence is a sequence of dates and times

    { [date(0),time(0)], [date(1),time(1)], ... [date[N],time[N] }
having a starting date and time [date(0),time(0)], a time increment dT, and such that each [date(K),time(K)] is exactly dT away from [date(K-1),time(K-1)]. Note that each file has a time step sequence (where by convention, time increment dT=0 means that the data in the file is time-independent, and routines like READ3() and WRITE3() which deal with time-independent files ignore the date-and-time arguments.

There are a number of utility routines available for manipulating dates and times, in addition to programs gregdate and juldate for converting back and forth between model-convention Julian dates and ordinary calendar dates. Note that for these utility routines, time increments may perfectly well be negative -- just make sure you keep the parts all positive or all negative; a time increment of -33000 means to step three and a half hours into the past, for example; the hours part is -3, the minutes part is -30, and the seconds part is 0. This way of representing dates and times is easy to understand and manipulate when you are watching code in the debugger (you don't have to turn the UNIXism "seconds since Jan. 1, 1970" into something meaningful for your model run, nor do you have to remember whether April has 30 days or 31 when your model run crosses over from April to May). The utility routines for manipulating dates and times are the following:

CURRSTEP: find start of <timestep> containing <time>
DAYMON: find month and day-of-month for <jdate>
DT2STR: Construct string for <jdate> and <time>
GETDTTIME: get current wall-clock date and time
HHMMSS: construct string "HHMMSS" for <time>
ISDSTIME: Is Daylight Savings Time in effect for the indicated date?
JSTEP3: find record number (Fortran-style 1,2,3,...) for <jdate:jtime> within the time step sequence <sdate:stime:tstep> (or return -1 if not on the sequence.
JULIAN: find Julian day number for <month > <day> &lt;year>
MMDDYY: construct string "Month DD, YYYY" for <jdate>
NEXTIME: update <jdate>, <time> by <timestep>
SEC2TIME: get Models-3 time representation for <seconds>
SECSDIFF: find time diff between two <jdate-time>s
TIME2SEC: get number of seconds for <time>
WKDAY: get day-of-week (1...7) for <jdate>


Previous Section: Grids and Coordinate Systems

Next Section: Calling from Fortran

Up: Conventions

To: Models-3/EDSS I/O API: The Help Pages