This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
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>