⇐ ⇒

[CF-metadata] Two-variable integer Time in CF?

From: V. Balaji <V.Balaji>
Date: Thu, 01 Nov 2007 15:46:26 -0400 (EDT)

Rich: some of us in the modeling community (you know who you are:-)
went through a fairly lengthy discussion of time representation some
years ago.

I like the two-integer approach, but not those particular two. Both
"days" and "milliseconds" are problematic: "days" are inappropriate
for non-terrestrial planets, and "milliseconds" a somewhat arbitrary
subdivision that seems 'small enough' with respect to our currently
envisaged applications, but which will surely fail for something or
other (e.g I could imagine a model with a 1/3 second timestep).

What I'd propose instead is a two-integer approach, both longs
(64-bit, that is). The first is the number of seconds since the time
origin, and the second the number of ticks since the last full second.
A 'tick' is defined by an integer attribute tick_length (which in your
case would be 1000) defining an integer fraction of a second
appropriate to the application.

So there's two auxiliary attributes, time_origin (which, while we're
about it, we should make a proper attribute instead of parsing from a
'time since...' string) and a tick_length.

Thanks,

Rich Signell writes:

> CF-folk,
>
> I'd like to find out what the community thinks of adding a
> two-variable integer representation as an acceptable way of
> representing time in CF.
>
> In our Marine Time Series database at the USGS here in Woods Hole, we
> have always represented "time" with two integer variables: one
> integer variable to represent the days from a time origin that starts
> at midnight, one integer variable to represent the number of
> milliseconds since midnight:
>
> netcdf 2651-A1H {
> dimensions:
> time = 1726 ;
> depth = 1 ;
> lat = 1 ;
> lon = 1 ;
> variables:
> int time(time) ;
> time:units = "days since 1968-05-23 00:00 UTC" ;
> time:aux_time = "time2";
> int time2(time) ;
> time2:units = "milliseconds since 00:00 UTC" ;
>
> So a floating point time would be constructed as:
> time_float = time + time2/1000/3600/24
>
> There are at least two advantages to this format over the standard
> float or double representation with a single variable:
>
> - you can use integer arithmetic on time, avoiding round off problems
> where you get 23:59:59 instead of 00:00:00.
>
> - you can have millisecond precision over millennia, so you can do
> things like paleo earthquake simulations.
>
> I was speaking yesterday with David Stuebe from the FVCOM modeling
> group, and then use the same two-integer representation for their
> unstructured mesh model results. They also include a floating point
> time representation so that CF-compliant tools will work.
>
> If nobody thinks this is a bad idea, we can go ahead with a proposal
> on the Conventions Wiki, along with demonstration files and examples
> of how it could be used, following the CF standards process.
>
> -Rich
>
>

-- 
V. Balaji                               Office:  +1-609-452-6516
Head, Modeling Systems Group, GFDL      Home:    +1-212-253-6662
Princeton University                    Email: v.balaji at noaa.gov
Received on Thu Nov 01 2007 - 13:46:26 GMT

This archive was generated by hypermail 2.3.0 : Tue Sep 13 2022 - 23:02:40 BST

⇐ ⇒