[gradsusr] Question: xdfopen error

Steven Chan schan at fsu.edu
Thu Feb 10 11:24:40 EST 2011


Hello All:

I have been struggling to open a certain netCDF file with xdfopen.

GRADS version used:  2.0.a9 & 2.0.a9.oga.1
Error message:
> ga-> xdfopen fqd000_nch.cam2.h1.2005-07-01-00000.xdf
> Scanning Descriptor File:  fqd000_nch.cam2.h1.2005-07-01-00000.xdf
> gadsdf: SDF file does not have any non-coordinate variables.
> SDF Descriptor file fqd000_nch.cam2.h1.2005-07-01-00000.xdf was not 
> successfully opened & parsed.

I am using the following "xdf control file":
> DSET ^fqd000_nch.cam2.h1.2005-07-01-00000.nc
> TITLE fqd000_nch.cam2.h1.2005-07-01-00000.nc
> *
> * Vertical = Hybrid
> *
> OPTIONS 365_day_calendar
> DTYPE netcdf
> XDEF lon 1152 linear   0.00 0.3125
> YDEF lat 768  linear -90.00 0.2346805737
> ZDEF lev  30  levels
> 992.556095123291 976.325407391414 957.485479535535 936.198398470879
> 912.64454694464  887.020248919726 859.53476652503  820.858368650079
> 763.404481112957 691.389430314303 609.778694808483 524.687174707651
> 445.992574095726 379.100903868675 322.241902351379 273.910816758871
> 232.828618958592 197.908086702227 168.225079774857 142.994038760662
> 121.547240763903 103.317126631737 87.8212302923203 72.0124505460262
> 54.5954797416925 38.2682997733355 24.6122200042009 14.3566322512925
> 7.59481964632869 3.64346569404006
> TDEF time   1 linear 00Z01JUL2005 3hr
> *
> VARS 11
> OMEGA=>omega    30 t,z,y,x   Vertical velocity (pressure) (Pa/s)
> PBLH=>pblh       0   t,y,x   PBL Height (m)
> PRECC=>precc     0   t,y,x   Convective precipitation rate (liq + ice) 
> (m/s)
> PRECL=>precl     0   t,y,x   Large-scale (stable) precipitation rate 
> (liq + ice) (m/s)
> PRECSH=>precsh   0   t,y,x   Shallow Convection precipitation rate (m/s)
> PS=>ps           0   t,y,x   Surface pressure (Pa)
> Q=>q            30 t,z,y,x   Specific humidity (kg/kg)
> QFLX=>qflx       0   t,y,x   Surface water flux (kg/m2/s)
> T=>tmpprs       30 t,z,y,x   Temperature (K)
> U=>ugrdprs      30 t,z,y,x   Zonal Wind (m/s)
> V=>vgrdprs      30 t,z,y,x   Meridonal Wind (m/s)
> ENDVARS

A netCDF file with the following  ncdump information:
> netcdf fqd000_nch.cam2.h1.2005-07-01-00000 {
> dimensions:
>         lat = 768 ;
>         lon = 1152 ;
>         slat = 767 ;
>         slon = 1152 ;
>         lev = 30 ;
>         ilev = 31 ;
>         isccp_prs = 7 ;
>         isccp_tau = 7 ;
>         isccp_prstau = 49 ;
>         time = UNLIMITED ; // (1 currently)
>         tbnd = 2 ;
>         chars = 8 ;
> variables:
>         double P0 ;
>                 P0:long_name = "reference pressure" ;
>                 P0:units = "Pa" ;
>         double lat(lat) ;
>                 lat:long_name = "latitude" ;
>                 lat:units = "degrees_north" ;
>         double lon(lon) ;
>                 lon:long_name = "longitude" ;
>                 lon:units = "degrees_east" ;
>         double slat(slat) ;
>                 slat:long_name = "staggered latitude" ;
>                 slat:units = "degrees_north" ;
>         double slon(slon) ;
>                 slon:long_name = "staggered longitude" ;
>                 slon:units = "degrees_east" ;
>         double w_stag(slat) ;
>                 w_stag:long_name = "staggered latitude weights" ;
>         double lev(lev) ;
>                 lev:long_name = "hybrid level at midpoints (1000*(A+B))" ;
>                 lev:units = "level" ;
>                 lev:positive = "down" ;
>                 lev:standard_name = 
> "atmosphere_hybrid_sigma_pressure_coordinate" ;
>                 lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS" ;
>         double ilev(ilev) ;
>                 ilev:long_name = "hybrid level at interfaces 
> (1000*(A+B))" ;
>                 ilev:units = "level" ;
>                 ilev:positive = "down" ;
>                 ilev:standard_name = 
> "atmosphere_hybrid_sigma_pressure_coordinate" ;
>                 ilev:formula_terms = "a: hyai b: hybi p0: P0 ps: PS" ;
>         double isccp_prs(isccp_prs) ;
>                 isccp_prs:long_name = "Mean ISCCP pressure" ;
>                 isccp_prs:units = "mb" ;
>                 isccp_prs:isccp_prs_bnds = 0., 180., 310., 440., 560., 
> 680., 800., 1000. ;
>         double isccp_tau(isccp_tau) ;
>                 isccp_tau:long_name = "Mean ISCCP optical depth" ;
>                 isccp_tau:units = "unitless" ;
>                 isccp_tau:isccp_tau_bnds = 0., 0.3, 1.3, 3.6, 9.4, 
> 23., 60., 379. ;
>         double isccp_prstau(isccp_prstau) ;
>                 isccp_prstau:long_name = "Mean pressure (mb).mean 
> optical depth (unitless)/1000" ;
>                 isccp_prstau:units = "mixed" ;
>         double time(time) ;
>                 time:long_name = "time" ;
>                 time:units = "days since 2005-01-01 00:00:00" ;
>                 time:calendar = "noleap" ;
>                 time:bounds = "time_bnds" ;
>         double time_bnds(time, tbnd) ;
>                 time_bnds:long_name = "time interval endpoints" ;
>         char date_written(time, chars) ;
>         char time_written(time, chars) ;
>         int ntrm ;
>                 ntrm:long_name = "spectral truncation parameter M" ;
>         int ntrn ;
>                 ntrn:long_name = "spectral truncation parameter N" ;
>         int ntrk ;
>                 ntrk:long_name = "spectral truncation parameter K" ;
>         int ndbase ;
>                 ndbase:long_name = "base day" ;
>         int nsbase ;
>                 nsbase:long_name = "seconds of base day" ;
>         int nbdate ;
>                 nbdate:long_name = "base date (YYYYMMDD)" ;
>         int nbsec ;
>                 nbsec:long_name = "seconds of base date" ;
>         int mdt ;
>                 mdt:long_name = "timestep" ;
>                 mdt:units = "s" ;
>         int nlon(lat) ;
>                 nlon:long_name = "number of longitudes" ;
>         int wnummax(lat) ;
>                 wnummax:long_name = "cutoff Fourier wavenumber" ;
>         double hyai(ilev) ;
>                 hyai:long_name = "hybrid A coefficient at layer 
> interfaces" ;
>         double hybi(ilev) ;
>                 hybi:long_name = "hybrid B coefficient at layer 
> interfaces" ;
>         double hyam(lev) ;
>                 hyam:long_name = "hybrid A coefficient at layer 
> midpoints" ;
>         double hybm(lev) ;
>                 hybm:long_name = "hybrid B coefficient at layer 
> midpoints" ;
>         double gw(lat) ;
>                 gw:long_name = "gauss weights" ;
>         int ndcur(time) ;
>                 ndcur:long_name = "current day (from base day)" ;
>         int nscur(time) ;
>                 nscur:long_name = "current seconds of current day" ;
>         int date(time) ;
>                 date:long_name = "current date (YYYYMMDD)" ;
>         double co2vmr(time) ;
>                 co2vmr:long_name = "co2 volume mixing ratio" ;
>         double ch4vmr(time) ;
>                 ch4vmr:long_name = "ch4 volume mixing ratio" ;
>         double n2ovmr(time) ;
>                 n2ovmr:long_name = "n2o volume mixing ratio" ;
>         double f11vmr(time) ;
>                 f11vmr:long_name = "f11 volume mixing ratio" ;
>         double f12vmr(time) ;
>                 f12vmr:long_name = "f12 volume mixing ratio" ;
>         double sol_tsi(time) ;
>                 sol_tsi:long_name = "total solar irradiance" ;
>                 sol_tsi:units = "W/m2" ;
>         int datesec(time) ;
>                 datesec:long_name = "current seconds of current date" ;
>         int nsteph(time) ;
>                 nsteph:long_name = "current timestep" ;
>         float OMEGA(time, lev, lat, lon) ;
>                 OMEGA:units = "Pa/s" ;
>                 OMEGA:long_name = "Vertical velocity (pressure)" ;
>         float PBLH(time, lat, lon) ;
>                 PBLH:units = "m" ;
>                 PBLH:long_name = "PBL height" ;
>         float PRECC(time, lat, lon) ;
>                 PRECC:units = "m/s" ;
>                 PRECC:long_name = "Convective precipitation rate (liq 
> + ice)" ;
>         float PRECL(time, lat, lon) ;
>                 PRECL:units = "m/s" ;
>                 PRECL:long_name = "Large-scale (stable) precipitation 
> rate (liq + ice)" ;
>         float PRECSH(time, lat, lon) ;
>                 PRECSH:units = "m/s" ;
>                 PRECSH:long_name = "Shallow Convection precipitation 
> rate" ;
>         float PS(time, lat, lon) ;
>                 PS:units = "Pa" ;
>                 PS:long_name = "Surface pressure" ;
>         float Q(time, lev, lat, lon) ;
>                 Q:units = "kg/kg" ;
>                 Q:long_name = "Specific humidity" ;
>         float QFLX(time, lat, lon) ;
>                 QFLX:units = "kg/m2/s" ;
>                 QFLX:long_name = "Surface water flux" ;
>         float T(time, lev, lat, lon) ;
>                 T:units = "K" ;
>                 T:long_name = "Temperature" ;
>         float U(time, lev, lat, lon) ;
>                 U:units = "m/s" ;
>                 U:long_name = "Zonal wind" ;
>         float V(time, lev, lat, lon) ;
>                 V:units = "m/s" ;
>                 V:long_name = "Meridional wind" ;
> // global attributes:
>                 :Conventions = "CF-1.0" ;
>                 :source = "CAM" ;
>                 :case = "fqd000_nch" ;
>                 :title = "UNSET" ;
>                 :logname = "juliob" ;
>                 :host = "jaguarpf-batch8" ;
>                 :Version = "$Name$" ;
>                 :revision_Id = "$Id$" ;
>                 :initial_file = 
> "/tmp/work/juliob/init/qdLL05.cam2.i.1998-01-01-00000.nc" ;
>                 :topography_file = 
> "/tmp/proj/ccsm/inputdata/atm/cam/topo/USGS_gtopo30_0.23x0.31_remap_c061107.nc" 
> ;
> }

If I remove VARS/ENDVARS from the xdf, the file can open, but the 
metadata information is erroneous and data cannot be displayed:
> Scanning Descriptor File:  fqd000_nch.cam2.h1.2005-07-01-00000.xdf
> SDF file fqd000_nch.cam2.h1.2005-07-01-00000.nc is open as file 1
> LON set to 0 360
> LAT set to -90 90
> LEV set to 992.556 992.556
> Time values set: 2005:7:1:0 2005:7:1:0
> E set to 1 1
> ga-> q file
> File 1 : fqd000_nch.cam2.h1.2005-07-01-00000.nc
>   Descriptor: fqd000_nch.cam2.h1.2005-07-01-00000.xdf
>   Binary: fqd000_nch.cam2.h1.2005-07-01-00000.nc
>   Type = Gridded
>   Xsize = 1152  Ysize = 768  Zsize = 30  Tsize = 1  Esize = 1
>   Number of Variables = 11
>      omega  30  t,z,y,x  Vertical velocity (pressure)
>      omega  0  t,y,x  PBL height
>      omega  0  t,y,x  Convective precipitation rate (liq + ice)
>      omega  0  t,y,x  Large-scale (stable) precipitation rate (liq + ice)
>      omega  0  t,y,x  Shallow Convection precipitation rate
>      omega  0  t,y,x  Surface pressure
>      omega  30  t,z,y,x  Specific humidity
>      omega  0  t,y,x  Surface water flux
>      omega  30  t,z,y,x  Temperature
>      omega  30  t,z,y,x  Zonal wind
>      omega  30  t,z,y,x  Meridional wind

I am fairly sure I am doing xdfopen correctly, but I may be there 
something silly that I am just not realizing.
Thank you ahead for the responses.

Steven Chan




More information about the gradsusr mailing list