[gradsusr] Uncorrect time value in sdfwrite
Jennifer M Adams
jadams21 at gmu.edu
Sun May 27 20:22:07 EDT 2018
Version 2.1.0 had this addition:
* Output from sdfwrite command will use 'months since' or 'minutes since'
in time axis metadata depending on what is used in the original data file
Before that, the units were always ‘minutes since’ but I discovered that GrADS was unable to read some of its own output files, which was not cool. I think it was when the time axis increment was years and the units was minutes that it broke. When GrADS opens a file that has a time axis increment with units ‘mo’ or ‘yr’, the it gets stored as ‘months’. For all other time intervals, the increment unit is converted to ‘minutes’ and stored that way.
> On May 21, 2018, at 4:14 PM, Cathy Smith <cathy.smith at noaa.gov> wrote:
> The time unit "months since" is not udunits complaint as months vary in length. While GrADS is able to handle it, it is not the best idea for files that might be read by pretty much all other software.
> If you want time steps as months, there are other ways to do this (though they do not use udunits).
> Cathy Smith
> On 5/21/18 1:52 PM, Boyin Huang - NOAA Federal wrote:
>> Thanks a lot. It works.
>> On Mon, May 21, 2018 at 1:42 PM, Andrew Friedman <andfried at gmail.com> wrote:
>> Hi Boyin,
>> One option is to use the NCO utilities (http://nco.sourceforge.net/nco.html) to change the starting time and time units.
>> Here’s an example of changing time from seconds to minutes, and the starting time to 1979:
>> ncap2 -O -s "time=time/(60)" -s "time at units=\"minutes since 1979-01-01 00:00:00\"" $infile $infile
>> [I imagine that for changing from minutes to months you’ll need to use a loop for different lengths of month].
>> > On May 21, 2018, at 4:31 PM, Boyin Huang - NOAA Federal <boyin.huang at noaa.gov> wrote:
>> > Hi Jennifer and Andrew,
>> > Thanks a lot. Indeed, if I write necdf by "set t 1 last", I got the right time values (first value is zero) in unit of minute. The question is whether I can change the unit into "month" instead of minute.
>> > By "set t num", the time value is always zero. I hope that I can change the starting time by the attribute setting like this:
>> > 'set sdfattr time char units months since 1854-01-15 00:00:00'
>> > --
>> > Boyin Huang, Room-468
>> > NOAA/NCEI/CCOG
>> > Asheville, NC.
>> > 828-271-4851
>> Boyin Huang, Room-468
>> Asheville, NC.
>> gradsusr mailing list
>> gradsusr at gradsusr.org
> NOAA/ESRL PSD and CU CIRES
> Emails about data/webpages may get quicker responses from emailing
> esrl.psd.data at noaa.gov
> gradsusr mailing list
> gradsusr at gradsusr.org
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University
More information about the gradsusr