[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. 
—Jennifer


> On May 21, 2018, at 4:14 PM, Cathy Smith <cathy.smith at noaa.gov> wrote:
> 
> Hi
> 
> 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). 
> 
> https://github.com/Unidata/netcdf4-python/issues/434
> 
> 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].
>> 
>> -Andrew
>> 
>> > 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
>> NOAA/NCEI/CCOG
>> Asheville, NC.
>> 828-271-4851
>> 
>> 
>> _______________________________________________
>> gradsusr mailing list
>> 
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
> 
> -- 
> ----------------------------------------------
> NOAA/ESRL PSD and CU CIRES
> 303-497-6263
> 
> http://www.esrl.noaa.gov/psd/people/cathy.smith/
> 
> 
> Emails about data/webpages may get quicker responses from emailing 
> 
> esrl.psd.data at noaa.gov
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://secure-web.cisco.com/13HNM_7Xyri-LAeV3JmT5kNP5oPjI7_MVQS7V0hidzyhkwrkQbPtT0_wU1w7N3GgqS72SgGBsrf6qr9Wel2nW6WLj8MyWJUcpzCtBGskfQXfAqZcmuXj9LXFYILGzGF-3TVsqjQrzlVGdCSByAyUdTRhDdk0EC5N7-1XWwFGqRgDRBtfzVJ9qv53EW6Uq5UX6u2z6tFcCsk_a9JyQowfzLNPZF8YZJ0iSSK_g1AjonpzJSjoX2DXiLC4vGiOPYeQNlEtxre_cByhvdl9uWmuf3_AebI0tQIh7mJDP8Xr0DHDnvqRxfH-wtRiU3h1Hc_y4p-X_fb1HnmnyAAukXxQ0BDuEAawL9H6HXJG9MNXNeTPMQvTEKFDuftEqPsAc2VlO/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr

--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University






More information about the gradsusr mailing list