[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #PNJ-836397]: Time Stamp in Netcdf output



Hi,

> I got the data and then I tried to access through ncbrowse.  When I do
> this, for 4-D variable (x,y,z,t), time is shown as seconds. I am
> writing the time as seconds and I am also writing base date as
> attribute. But the time stamp is shown as time in seconds and not
> actual time plus data (combination of base_date and time).

Please note that ncbrowse is developed, maintained, and supported by
its author.  We don't know much about ncbrowse or the conventions it
uses for interpreting time, but if that's the tool that will be used
to look at your data, then you should follow the conventions ncbrowse
supports.

We recommend using CF conventions for time, if you want your data to
be accessible by many applications:

  
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.0/cf-conventions.html#time-coordinate

The time units recommended in the CF conventions are those understood by
the udunits package.  In particular,

  time:units = "True Julian Day" ;

is *not* understood by udunits, and is not compliant with the CF conventions.

  time2:units = "msec since 0:00 GMT" ;

is understood by udunits as the number of msec since 2001-01-01 00:00 GMT.

In particular, note why the CF conventions recommends using the
proleptic_gregorian
calendar rather than the Julian calendar for time.

> I checked the sample file given in ncbrowse which I have attached
> here. when I use this, I see the time in True Julian days in actual
> data plus time. But I am not able to get this in my code.
>
> When I use cdf2ascii tool, YYYY is shown as 1970. Is this the base
> date inside netcdf.  It is really confusing as how to describe time in
> fortran 90.

The cdf2ascii program was developed and maintained by its author.  We don't
know about cdf2ascii or the conventions it uses for interpreting time.

There is no "base date inside netcdf".  NetCDF is a library for data access
and does not deal with time as a data type or use any concepts of time for
any arguments or return values from functions.  How you represent time must
be handled by conventions or in a layer above the netCDF data access library.

> Please look into this problem as this is delaying the work.
> I am stuck here in adressing the time as YYYY-mm-dd hh:mm.

You might want to look at this discussion:

  
https://www.myroms.org/forum/viewtopic.php?p=225&sid=9b035be61977fa64d63bf5fac7229703

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: PNJ-836397
Department: Support netCDF
Priority: Normal
Status: Closed