[gradsusr] 2 questions about writing NetCDF output file

Jennifer Adams jma at cola.iges.org
Fri Jul 10 15:12:16 EDT 2015


On Jul 10, 2015, at 1:55 PM, Liu, Zhong (GSFC-610.2)[GEORGE MASON UNIVERSITY] <zhong.liu-1 at nasa.gov> wrote:

> Hi GrADS users,
>  
> I have two simple questions:
>  
> 1) When outputting my data in floating (see below), how come the lat and lon arrays are still in double (other variables are in floating)? Is there any way to make them (lat, lon) floating?
>  
> 'set sdfwrite -3dt -flt -nc4 -chunk -zip '%fn
>  
> I am using GrADS 2.1.a3.

The coordinate axis values are hard-coded to be double precision. Given that it is a relatively small array of numbers, I figured it would be better to leave them at double precision since that’s how they are stored by GrADS. I don’t think it would significantly alter the file size to have them be floats instead of doubles. There is probably a way to use the NetCDF Operators to change the data type if you absolutely must have floats.

>  
> 2) For the ‘Time’ units, is there any way to overwrite for example “:units = "minutes since 1998-01-05 00:00";” with
> “days since 1998-01-05”?

GrADS stores time axis units as either minutes or months. If you use days or hours in your TDEF, they are converted to minutes. I recently changed the sdfwrite code to use 'months since’ as the unit for netcdf output when the original file had months as the time axis unit. Earlier versions of GrADS always used ‘minutes since’ and that meant that a file with a yearly time axis could not be opened with sdfopen. It is unlikely that I will add an option to convert 'minutes since’ to ‘days since' for the sdfwrite output — maybe NCO will do this, but I’m not sure. 
—Jennifer

>  
> Thanks a lot!
>  
> Best,
>  
> Zhong Liu, Ph.D.
> Zhong.Liu-1 at nasa.gov
> George Mason University and
> NASA Goddard Earth Sciences Data and
> Information Services Center
> NASA/GSFC, Code 610.2
> Greenbelt. MD. 20771  U.S.A.
> (301) 614-5764 (voice)
> (301) 614-5268 (fax)
> http://disc.gsfc.nasa.gov
> http://giovanni.gsfc.nasa.gov
> http://disc.sci.gsfc.nasa.gov/hurricane/
> http://disc.sci.gsfc.nasa.gov/hurricane/trmm_quikscat_analysis.shtml
> http://disc.sci.gsfc.nasa.gov/agriculture/ais_sup/current_conditions.shtml
>  
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150710/375ce7dc/attachment.html 


More information about the gradsusr mailing list