Project

General

Profile

Remove UTC in reference time as in older CDO versions

Added by judy hertz over 4 years ago

All,

I have HDF5 source files with reference times that include UTC. After some variable and attribute changes to the files using (unintentionally) different versions of CDO, some files retained UTC and some haven't:

:CDI = "Climate Data Interface version 1.6.8 (http://mpimet.mpg.de/cdi)" ;
    double time(time) ;
        time:standard_name = "time" ;
        time:bounds = "time_bnds" ;
        time:units = "seconds since 1970-01-01 00:00:00" ;

:CDO = "Climate Data Operators version 1.9.7.1 (http://mpimet.mpg.de/cdo)" ;
    double time(time) ;
        time:standard_name = "time" ;
        time:bounds = "time_bnds" ;
        time:units = "seconds since 1970-01-01 00:00:00 UTC" ;

We don't use UTC in our reference times and I need to remove it. Our current CDO version 1.9.7.1 doesn't remove the UTC using setreftime:

cdo -setreftime,1970-01-01,00:00:00,seconds

Using setreftime of the older version 1.6.8 removes the UTC, is there a more efficient way to remove it with the current CDO version toolset?

thanks!


Replies (3)

RE: Remove UTC in reference time as in older CDO versions - Added by judy hertz over 4 years ago

I'd still like to hear any comments on the difference of treatment on UTC between the versions, but I was able to use NCO to add or remove UTC:

ncatted -a units,time,o,c,'seconds since 1970-01-01 00:00:00' infile outfile
ncatted -a units,time,o,c,'seconds since 1970-01-01 00:00:00 UTC' infile outfile

RE: Remove UTC in reference time as in older CDO versions - Added by Uwe Schulzweida over 4 years ago

There were many users who didn't like the time unit being changed. So we decided to change the time unit only when the content changes.

Cheers,
Uwe

RE: Remove UTC in reference time as in older CDO versions - Added by Ralf Mueller over 4 years ago

@judy : just in case you don't know

 ncatted -O .... 
only changes this meta information in to input and saves it. This can be quite useful for large data-sets because it avoids the needed the re-write if the data section.

cheers
ralf

    (1-3/3)