[Thread Prev][Thread Next][Index]

Re: [ferret_users] Wrong time issue with T0="01-jan-0001 00:00" ?



Hi Jerome,
In general Ferret implements the "proleptic-gregorian" calendar, as defined in the CF Standard for NetCDF files:
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.3/cf-conventions.html#calendar

That is, the Gregorian calendar is applied to times before that calendar was historically established, so that time conventions are consistent since year 0000.

However we also accommodate files written with the mixed Julian/Gregorian calendar that is defined by the UDUNITS package, including many files written by the CDC (climate diagnostics center). If the time origin is 1-jan-0001:00:00, then the 2-day shift that was historically made in the year 1582 is applied. If a file has a time axes with any other time origin, the proleptic Gregorian calendar axis will be used. See the section "NetCDF and non-standard calendars" under http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/data-set-basics/NETCDF-DATA/

So this is unfortunate when the original file is not written with the assumption of the mixed Julian/Gregorian calendar and has a time origin of 1-jan-0001.

One could change the time origin in the input file by one second, which is not an entirely satisfactory solution but does make your example work correctly. I wonder if there are other nc utilities that would be of more help.

SET DATA "http://nomad1.ncep.noaa.gov:9090/dods/reanalyses/reanalysis-2/6hr/flx/flx";
  SET AXIS/T0="01-jan-0001 00:00:01" `landsfc,RETURN=taxis`

Ansley

Jérôme Lefèvre wrote:
Hi,

I use Ferret V6.08 and I have a strange issue with time axis when T0 is like "01-jan-0001 00:00".

I use a netcdf field LANDSFC from NCEP Reanalysis and I would like to copy and shift in time the field with ferret. In the original NCEP field, Torigin is "01-jan-0001 00:00", Tunits="days" and i keep the same Torigin and Tunits for the new time shifted axis definition.
But If I check out with "ncdump -v TIME", i found a 2 days shift.

I try CALENDAR options in DEFINE AXIS/T but without success.

Should I take some special care when i play with data field with T0="01-jan-0001 00:00" from NCEP ?

Many thanks
J. Lefevre

Please find below how to reproduct my trouble :

CA/ALL DA
CA/ALL VA
CA/ALL REGION

SET DATA "http://nomad1.ncep.noaa.gov:9090/dods/reanalyses/reanalysis-2/6hr/flx/flx"; LIST/FORMAT=CDF/FILE="LANDSFC_20070103_00z.cdf"/x=160E:163E/y=25S:23S/t="03-jan-2007 00:00" LANDSFC

sp ncdump -v TIME LANDSFC_20070103_00z.cdf
! you should see :
! double TIME(TIME) ;
! TIME:units = "days since 0001-01-01 00:00:00" ;
! TIME:long_name = "time" ;
! TIME:time_origin = "01-JAN-0001 00:00:00" ;
! TIME:axis = "T" ;
! // snipped //
! data:
! TIME = 732680 ;
!}

CA/ALL DA

! Load again LANDSFC and do 7 days shift
DEFINE SYMBOL my_NEW_DATE = "10-jan-2007 00:00"

SET DATA LANDSFC_20070103_00z.cdf

DEFINE SYMBOL UNITS = `LANDSFC,return=tunits`
DEFINE SYMBOL T0 = `LANDSFC,return=t0`
DEFINE AXIS/T/T0="($T0)"/T=($my_NEW_DATE)/NPOINT=1/unit="($UNITS)" T_AXE

LET LANDSFC_RG = reshape(LANDSFC[d=1],x[gx=LANDSFC,d=1]+y[gy=LANDSFC,d=1]+t[gt=T_AXE])
LIST/CLOBBER/FORMAT=CDF/FILE="LANDSFC_20070110_00z.cdf" LANDSFC_RG

SP ncrename -d T_AXE,TIME -v T_AXE,TIME -v LANDSFC_RG,LANDSFC LANDSFC_20070110_00z.cdf

SP ncdump -v TIME LANDSFC_20070104_00z.cdf
! you should see :
! double TIME(TIME) ;
! TIME:units = "DAYS since 0001-01-01 00:00:00" ;
! TIME:axis = "T" ;
! TIME:time_origin = "01-JAN-0001 00:00:00" ;
! // snipped //
! data:
! TIME = 732685 ;             < -  WRONG, SHOULD BE 732687 !
!}

PAUSE
CA/ALL DA
CA/ALL VA
USE LANDSFC_20070103_00z.cdf
USE LANDSFC_20070110_00z.cdf
sho grid LANDSFC[d=1]
! TIME TIME 1 r 03-JAN-2007 00:00 03-JAN-2007 00:00
sho grid LANDSFC[d=2]
! TIME1 TIME 1 r 08-JAN-2007 00:00 08-JAN-2007 00:00

??



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement