Met Office Logo
  bullet   Home   bullet   Research   bullet   Hadley Centre  bullet  GDT   bullet  Chapter 23 Space
  NWP | Climate | Seasonal forecasting | Atmospheric processes | Oceanography | Projects | The stratosphere Space
Page Top
Spacer
  GDT netCDF conventions

23. Time variables and intervals


A ``time variable'' is one which represents date and time, which we will refer to hereafter just as ``time''. An ``interval of time'' is the difference between two times.

It would be possible to describe time in terms of six components (year, month, day, hour, minute, second) in a netCDF file, using six component variables of various data types. However, it is more efficient and for many purposes more convenient to represent a time as a single number, giving the elapsed interval since a certain reference time, which may be either implicit or explicit. We refer to conversion from the components of a time into a single number as ``encoding'', and the reverse as ``decoding''. Encoding and decoding are complicated because year and month are units with lengths that depend on the date and the calendar in use, so special provisions are needed for time axes.

A ``calendar'' defines the set of valid dates (year-month-day combinations). The standard calendar is the Gregorian (the calendar of udunits), but climate models do not always use this. For instance, in the calendar of the Hadley Centre GCM, all months have 30 days. The elapsed interval in units of fixed length (days, hours, minutes, seconds) between two times will not necessarily be the same in two different calendars, because there may be different numbers of valid dates between them. For example, the interval between 1 February 1996 and 1 March 1996 is one month, and equals 29 days in the standard calendar, but 30 days in the Hadley Centre model calendar, since 30 February is a valid date in the latter. Therefore the encoding of a time into an elapsed interval will depend on the calendar, and it is necessary to know the calendar when converting. This standard permits the use of the standard calendar (below, section 26) and of other calendars (section 27). The calendar attribute, described in the following sections, indicates the calendar in use. If a time coordinate variable has no calendar attribute, the global calendar attribute (section 5), if present, applies to it.

This standard permits two different methods, distinguished by their units, of encoding a time into a number. These methods, referred to as ``relative time'' and ``absolute time'', are described in the following sections (24 and 25). Relative time is a more familiar method, but absolute time offers important advantages.

Time variables may have an attribute time_format, to specify a format for printing the date and time, according to the conventions of the Unix (TM) date command.

Time coordinate variables must always explicitly include the units attribute; there is no default value.

 
About Us
Climate
Climate monitoring
Climate models
Climate predictions
Carbon cycle
Visiting Scientist programme
News
Press releases
PRECIS brochure
List of all publications
Contact
Climate centres
Intergovernmental Panel on Climate Change
Climate data for impacts research
UK Climate Impacts Programme
Contact
Contact us
Spacer
www.metoffice.gov.uk (C)Crown copyright Met Office 2000