[gradsusr] xdfopen grads 2.0a3 question/problem

Santanello, Joseph A. (GSFC-6170) joseph.a.santanello at nasa.gov
Thu Mar 13 11:05:14 EDT 2014


I've found a solution to the question posted below (from April 2013) thanks to Arlindo da Silva at NASA-GSFC.  For V2 and beyond, the ctl files for cdf data need to be modified slightly (see below), and then the 'open' command used instead of 'xdfopen'.

Hello,
I seem to be having an issue using xdfopen in GrADS 2.0.a3 but not in an older version  (GrADS 1.10r2).  I have ARM netcdf data which I would like to display in GrADS with xdfopen.  In GrADS 1.10 it works fine with the script below but in GrADS 2.0a3 it does not.
DSET ARM/20100530/sgpmet/sgpmetE15.b1.201005%d2.000000.cdf
OPTIONS template
TITLE ARM Data
UNDEF -9999
TDEF time 2880 linear 00:00Z30may2010 1mn
XDEF time 01 levels -98.284
YDEF time 01 levels 36.431
VARS 4
atmos_pressure=>press 0 99 atmospheric pressure (kpa)
temp_mean=>temp 0 99 temperature (deg C)
rh_mean=>rh 0 99 relative humidity (%)
tbrg_precip_total=>precip 0 99 Tipping bucket rain guage total precip (mm/hr)
ENDVARS
The problem is, in GrADS 2.0a3, the initial value is being treated as a constant and not varying in time like it should.  I get just a straight line at whatever the initial value is.  For example, if I try to display temperature and the temperature at 00Z May 30 (initial time) is 25 C, I will get a straight line with only that same value at every time.  I tried changing the ctl file to this (below) based on the users guide but it is still not working.
DSET ARM/20100530/sgpmet/sgpmetE15.b1.201005%d2.000000.cdf
OPTIONS template
DTYPE netcdf
TITLE ARM Data
UNDEF -9999
TDEF time 2880 linear 00:00Z30may2010 1mn
XDEF time 01 levels -98.284
YDEF time 01 levels 36.431
VARS 4
atmos_pressure=>press 0 t atmospheric pressure (kpa)
temp_mean=>temp 0 t temperature (deg C)
rh_mean=>rh 0 t relative humidity (%)
tbrg_precip_total=>precip 0 t Tipping bucket rain guage total precip (mm/hr)
ENDVARS
I really want to use GrADS 2.0a3 because it has better math functions and tools to make comparisons to other data sets easier.  I also have the same problem in GrADS 2.0.2 so I think it must have something to do with newer versions.  Thanks in advance for any help.
Also, time is the only dimension in the cdf file so that is why xdef and ydef are set to time.
Tom

-----
On Fri, Mar 7, 2014 at 10:13 AM, Santanello, Joseph A. (GSFC-6170) <joseph.a.santanello at nasa.gov<mailto:joseph.a.santanello at nasa.gov>> wrote:

Hi Arlindo,

Here is an example of what I'm working with. 'test30' is what you open with xdfopen, and then it reads in the daily ARM cdf files. So if you then change the time dimension (e.g. 1 48) you'll see the variables are constant throughout each day instead of varying every 30 mins.

/discover/nobackup/jsantane/WRF2GrADS/NEWS/2006/SMOS % ll test30_E4_jun1.ctl
-rwxr-xr-x 1 jsantane r0620 509 2008-11-13 17:36 test30_E4_jun1.ctl

It turns out, you had the wrong ctl. Actually, you had a "ddf" not a "ctl", and because you were using "time" for XDEF, YDEF and TDEF grads v2 got confused (this portion of the code was rewritten for v2). Use the attached "ctl" instead with the open command (yes, "open" not "sdfopen" or "xdfopen"):

ga-> open test30_E4_jun1.ctl

It worked for me with opengrads v2. If it works please post the solution to gradsusr so others can benefit as well.

Let me know if it works for you.

Arlindo

Old ctl file:
DSET ^sgp30smosE4.b1.2006%m2%d2.000000.cdf
OPTIONS template
TITLE Lamont OK ARM Data
XDEF time 1 LINEAR -97.485 1.0
YDEF time 1 LINEAR 36.605 1.0
ZDEF time 1 LINEAR 1.0 1.0
TDEF time 4416 LINEAR 00Z01JUN2006 30MN
VARS 9
wspd=>wspd 1 99 Wind Speed
wspd_va=>wspdva 1 99 Wind Speed
wdir=>wdir 1 99 Wind Direction
sd_deg=>degsd 1 99 SD Degree
temp=>temp 1 99 Wind Speed
rh=>relh 1 99 Wind Speed
vap_pres=>vpress 1 99 Vapor Pressure
bar_pres=>press 1 99 Barometric Pressure
precip=>pcp 1 99 Precipitation
ENDVARS

New ctl file:
DSET ^sgp30smosE4.b1.2006%m2%d2.000000.cdf
OPTIONS template
DTYPE netcdf
UNDEF 1e20
TITLE Lamont OK ARM Data
XDEF 1 LINEAR -97.485 1.0
YDEF 1 LINEAR 36.605 1.0
ZDEF 1 LINEAR 1.0 1.0
TDEF 4416 LINEAR 00Z01JUN2006 30MN
VARS 9
wspd=>wspd 0 t Wind Speed
wspd_va=>wspdva 0 t Wind Speed
wdir=>wdir 0 t Wind Direction
sd_deg=>degsd 0 t SD Degree
temp=>temp 0 t Wind Speed
rh=>relh 0 t Wind Speed
vap_pres=>vpress 0 t Vapor Pressure
bar_pres=>press 0 t Barometric Pressure
precip=>pcp 0 t Precipitation
ENDVARS
----


-----------------
Joseph.A.Santanello at nasa.gov
http://neptune.gsfc.nasa.gov/hsb/personnel/index.php?id=182
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140313/3f9d0fb5/attachment.html 


More information about the gradsusr mailing list