NetCDF Xdfopen problem

Eric Altshuler ela at COLA.IGES.ORG
Fri Nov 9 01:29:55 EST 2007


Mike,

The XDEF, YDEF, ZDEF and TDEF statements should have the following syntax:

xdef 200 linear -125.117 2.5
ydef 200 linear 40.2711 2.5
zdef 1 linear 1 1
tdef 39 linear 12Z24AUG2007 1HR

You probably also need the following line in the data descriptor file:

dtype netcdf

Try opening the dataset after making these changes.

Best regards,


Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
4041 Powder Mill Road, Suite 302
Calverton, MD 20705-3106
USA

E-mail: ela at cola.iges.org
Phone: (301) 902-1257
Fax: (301) 595-9793

----- Original Message -----
From: "Mike Johnson" <Mike.W.Johnson at NOAA.GOV>
To: GRADSUSR at LIST.CINECA.IT
Sent: Thursday, November 8, 2007 9:07:41 PM (GMT-0500) America/New_York
Subject: NetCDF Xdfopen problem

I've just recently returned to the GRADS community from an extended
absence and was hoping someone could give some advice on reading a
netcdf file (of which I have no previous experience).  Anyway, I've
tried a number of things relative to online documentation and examples
from the users group.  So far I've been unsuccessful in opening the
file. I am using GrADS v1.9b4.  thanks in advance...

Mike Johnson

Here's symptoms of what I thought was the most promising methodology.

*1.  I created a data descriptor file "20070824_1200.ddf" with following:*

DSET  ^20070824_1200.nc
TITLE Example NetCDF File
UNDEF -99999.
XDEF x 200 LINEAR -125.117 2.5
YDEF y 200 LINEAR 40.2711 2.5
ZDEF levels_1 LINEAR 1 1
TDEF n_valtimes 39 LINEAR 12Z24AUG2007 1HR
VARS 2
ws=>ws 1 t,z,y,x Wind Speed
wd=>wd 1 t,z,y,x Wind Direction
ENDVARS

*2.  error produced:*
xdfopen 20070824_1200.ddf
Scanning Description File: 20070824_1200.ddf
XDFopen Error:  Missing or invalid dimension size.
 --> The invalid description file record is:
 --> zdef levels_1 linear 1 1
 The data file was not opened.

*3.  partial ncdump output of 20070824_1200.nc:*
 netcdf 20070824_1200 {
dimensions:
             record = UNLIMITED ; // (39 currently)
             n_valtimes = 39 ;
             data_variables = 2 ;
             charsPerLevel = 11 ;
             namelen = 132 ;
             x = 200 ;
             y = 200 ;
             levels_1 = 1 ;
variables:
             float ws(record, levels_1, y, x)
                         ws:long_name = "Wind Speed" ;
                         ws:units = "m/s" ;
                         ws:udunits = "meter/sec" ;
                         ws:uiname = "windSpeed" ;
                         ws:valid_range = -150.f, 150.f ;
                         ws:_FillValue = -99999.f ;
                         ws:_n3d = 1 ;
                         ws:levels = "FHAG 10" ;
            char wsLevels(levels_1, charsPerLevel) ;
            char wsInventory(n_valtimes, levels_1) ;
            float wd(record, levels_1, y, x) ;
                         wd:long_name = "Wind Direction" ;
                         wd:units = "degree_True" ;
                         wd:udunits = "degree_True" ;
                         wd:uiname = "windDir" ;
                         wd:valid_range = 0.f, 360.f ;
                         wd:_FillValue = -99999.f ;
                         wd:_n3d = 1 ;
                         wd:levels = "FHAG 10"
             char wdlevels(levels_1, charsPerLevel) ;
             char wdInventory(n_valtimes, levels_1) ;
             int valtimeMINUSreftime(n_valtimes) ;
                          valtimeMINUSreftime:units = "seconds"
             double reftime ;
                          reftime:long_name = "reference time" ;
                          reftime:units = "seconds since (1970-1-1
00:00:00:0)" ;
             char origin(namelen) ;
             char model(namelen) ;
// global attributes:
                          :projIndex = 3 ;
                          :projName = "LATLON"
                          :centralLat = 42.5392f ;
                          :centralLon = -122.1475f ;
                          :rotation = 25.f ;
                          :lat00 = 40.2711f ;
                          :lon00 = -125.117f ;
                          :latNxNy = 44.7219f ;
                          :lonNxNy = -118.9594f ;
                          :dxKm = 2.5f ;
                          :dyKm = 2.5f ;
data:

ws =
8., 8.6,...............................



More information about the gradsusr mailing list