next up previous contents
Next: Bibliography Up: time-manager Previous: 4 Interface Design   Contents

Subsections

5 Module design notes

In discussions of valid ranges below we assume that the default native integer is signed and at least 4 bytes long.

5.1 Representation of dates

A date is represented by 2 integer values. One integer contains the calendar date (year, month and day of month), and the other contains the time of day (seconds past 0Z).

The year, month, and day of month components are packed in an integer using the expression year*1000 + month*100 + day. The range of valid dates is -2147480101 through 2147481231 which corresponds to a valid range of years from -214748 to 214748.

The time of day component of a date is represented as an integer number of seconds. Thus the precision of a date is 1 second.

The ESMF time manager defines a date type which may be initialized with the 2 integer values used by the CAM.

5.2 Representation of times

Time values are represented by 2 integer values. One integer contains the number of days and the other contains the partial day in seconds.

The valid range of times (which are assumed to be positive) is 0 through 2,147,483,647 days + 86399 seconds, or about 5.9 million years.

The precision of a time is 1 second.

The ESMF time manager defines a time type which may be initialized with the 2 integer values used by the CAM.

5.3 Counting timesteps

The underlying philosophy of the ESMF time manager design is that simulation control is based on the simulation date and the elapsed time from some reference date. There is no assumption that the timestep size is constant.

In the CCM3 the timestep size is fixed and the simulation control is based on counting timesteps. The timestep number and size plus a reference date are sufficient to compute the current date and time.

The ability to query the timestep number is for backwards compatibility with the CCM3 and allows a staged implementation of the time manager into the CAM. The alarm facilities in the time manager will eventually replace the logic that depends on the timestep number (which implicitly assumes a constant step size).

The timestep number in CAM2 is a native signed integer (usually 4 bytes) which implies that only $2^{31}$ steps may be counted. At the nominal timestep size of 1200 seconds this imposes a valid range of 81,000 years on the time manager.

5.4 Setting the stop date

The ESMF time manager determines if the current step is the last step of a simulation by testing whether the current date is equal to or later than the stop date. To support the options provided by positive values of the nestep and nelapse namelist variables, i.e., stopping the simulation a specified number of timesteps past either the start or current dates, the values must be converted to a corresponding stop date. This is done by incrementing the appropriate date by a time interval that is calculated using the current value of the timestep size multiplied by the specified number of timesteps. This implementation assumes a constant timestep size.

5.5 Status


next up previous contents
Next: Bibliography Up: time-manager Previous: 4 Interface Design   Contents
Brian Eaton 2001-11-20