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

20020319: UDUNITS date conversion: non-Gregorian calendar systems



Emanuele,

> To: address@hidden
> cc: address@hidden
> From: emanuele lombardi <address@hidden>
> Subject: udunits & years of 360 days
> Organization: ENEA  CLIM  Casaccia
> Keywords: 200203191316.g2JDGpa05055 UDUNITS

The above message contained the following:

> I have troubles using udunits to convert numbers representing days into 
> "dates" when the calendar is known to be "climatological" (360 days).
> I know some software (like ferret) handle properly such situations taking 
> in account the value of the attribute "calendar" of the input netcdf files.
> This attribute can be given the value "360" .
> 
> But my own Fortran codes cannot act this way since udunits and its related 
> routines (e.g. utcaltime) have no way to be told which calendar is to be used.
> 
> So accessing the same netcdf file from Ferret I get the correct dates, 
> while accessing it from Fortran I get wrong dates.
> 
> It seems to me that a solution could be to add an input parameter (360/365 
> integer) to the routine "utcaltime"
> or  to add the info about the calendar length in the UNIT string given to 
> routine "utdec" .
> 
> Could you, please, tell me what is the best solution and suggest me a way I 
> could "hack"
> udunits so that it can understand 360 days calendar?
> 
> Thank you very much from Italy

The UDUNITS package wasn't designed to handle calendar systems other
than the Gregorian.  As a consequence, FERRET has to handle time
parameters separately.  The same would have to be done in Fortran.
You would have to port the FERRET time-handling code to Fortran or
create your own.

I suggest that you contact the FERRET people or try posting an inquiry
to the netCDFgroup mailing-list.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.