variable names with Upper case in dtype netcdf

Diane Stokes Diane.Stokes at NOAA.GOV
Fri Feb 11 17:21:40 EST 2005


HOOP!  YOU RULE!

I forgot you could do that in the classic descriptor files!

I didn't think including the descriptor file would help in this case,
but I should have included it for completeness.

The following works:

DSET ^time_mean.00%y4.%m2.%d2.nc
dtype netcdf
options template
undef -1.e+34f missing_value
title operational godas time_mean files
*
TDEF 18  LINEAR  05jun2004 5dy

XDEF 360 LINEAR 1.0 1.0
YDEF 200 LEVELS -74 -73 -72 -71 -70 -69 -68 -67 -66 -65 -64 -63 -62 -61
     -60 -59 -58 -57 -56 -55 -54 -53 -52 -51 -50 -49 -48 -47
     -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33
     -32 -31 -30 -29.00091 -28.00547 -27.01727 -26.03983 -25.07657
     -24.13073 -23.20537 -22.30333 -21.42718 -20.57921 -19.76142
     -18.97547 -18.22264 -17.50391 -16.81982 -16.17058 -15.55598
     -14.97548 -14.4281 -13.91256 -13.42719 -12.97002 -12.53873
     -12.13076 -11.74327 -11.3732 -11.01731 -10.67218 -10.33429
     -10.00005 -9.66672 -9.33339 -9.00006 -8.66673 -8.3334 -8.00007
     -7.66674 -7.33341 -7.00008 -6.66675 -6.33342 -6.00009 -5.66676
     -5.33343 -5.0001 -4.66677 -4.33344 -4.00011 -3.66678 -3.33345
     -3.00012 -2.66679 -2.33346 -2.00013 -1.6668 -1.33347 -1.00014
     -0.66681 -0.33348 -0.00015 0.33318 0.66651 0.99984 1.33317 1.6665
     1.99983 2.33316 2.66649 2.99982 3.33315 3.66648 3.99981 4.33314
     4.66647 4.9998 5.33313 5.66646 5.99979 6.33312 6.66645 6.99978
     7.33311 7.66644 7.99977 8.3331 8.66643 8.99976 9.33309 9.66642
     9.99975 10.33399 10.67188 11.01701 11.3729 11.74297 12.13046
     12.53843 12.96972 13.4269 13.91226 14.4278 14.97517 15.55569
     16.17028 16.81952 17.50361 18.22235 18.97516 19.76112 20.57891
     21.42687 22.30303 23.20507 24.13043 25.07627 26.03953 27.01697
     28.00517 29.00061 29.9997 30.9997 31.9997 32.9997 33.9997 34.9997
     35.9997 36.9997 37.9997 38.9997 39.9997 40.9997 41.9997 42.9997
     43.9997 44.9997 45.9997 46.9997 47.9997 48.9997 49.9997 50.9997
     51.9997 52.9997 53.9997 54.9997 55.9997 56.9997 57.9997 58.9997
     59.9997 60.9997 61.9997 62.9997 63.9997 64.9997
ZDEF 40 levels 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 105, 115, 125,
135, 145, 155,
     165, 175, 185, 195, 205, 215, 225, 238.4779, 262.2945, 303.0287,
     366.7978, 459.091, 584.6193, 747.187, 949.5881, 1193.53, 1479.588,
     1807.187, 2174.619, 2579.091, 3016.798, 3483.029, 3972.294, 4478.478


vars 12
temp     40 t,z,y,x   potential temperature [degC]
salinity 40 t,z,y,x   salinity [ppm-0.035]
tcor     40 t,z,y,x   temperature correction [deg C]
scor     40 t,z,y,x   salinity correction [ppm-0.035]
hflx      1 t,z,y,x   Surface heat flux [cal/cm**2/s]
sflx      1 t,z,y,x   Surface salt flux [g/cm**2/s]
convU=>convu     1 t,z,y,x   convergence of H*ubar [cm/s]
psiu      1 t,z,y,x   Streamfunction for H*ubar [Sv]
psiv      1 t,z,y,x   Streamfunction for H*vbar [Sv]
eta       0 t,y,x     Surface height [cm]
hmxl      0 t,y,x     Mixed layer depth [cm]
hblt      0 t,y,x     Boundary layer depth [cm]
endvars


Thank you!
    Have a great weekend.
      Diane


Don Hooper wrote:

> Diane Stokes,
>
> You did not share your DDF file.  I'm wondering if it took advantage
> of something explained at:
>         http://grads.iges.org/grads/gadoc/descriptorfile.html#VARS
> When you declare a variable, you can say SDFname=>GrADSname (there
> is a similar feature in xdfopen-style DDFs).  So, you could map
> convU to convu there, so that in GrADS' name space, where everything
> gets lowercased, you could still get at convU by referring to it
> as "convu".
>
> -Hoop
>
>>From owner-gradsusr at LIST.CINECA.IT  Fri Feb 11 14:42:18 2005
>>From: Diane Stokes <Diane.Stokes at NOAA.GOV>
>>
>>Hi,
>>
>>I'm running GrADS 1.9b3 on both IBM AIX and SGI.
>>
>>We have a netcdf file with about 17 variables.  The new "dtype netcdf"
>>can handle all but one, convU, apparently because there is an upper case
>>letter in the variable name:
>>
>>ga-> d convU
>>Data Request Error:  Error for variable 'convu'
>>   Error ocurred at column 1
>>DISPLAY error:  Invalid expression
>>   Expression = convu
>>
>>I get the same msg whether I call it "convU" or "convu" at the grads
>>prompt or in the ctl file.
>>
>>Following is the just that section from ncdump -c:
>>
>>         float convU(Time, Surface, yt_j, xt_i) ;
>>                 convU:long_name = "convergence of H*ubar" ;
>>                 convU:units = "cm/s" ;
>>                 convU:valid_range = -300000.f, 300000.f ;
>>                 convU:missing_value = -1.e+34f ;
>>                 convU:_FillValue = -1.e+34f ;
>>
>>When I regenerate the file calling that variable "convu" instead of
>>"convU", grads can display the variable.  (Note, grads does not have an
>>issue with the upper case in "Time" and "Surface").
>>
>>However, I can successfully display the variable by opening the original
>>netcdf file using sdfopen or by opening a ddf with xdfopen.  So, it
>>seems it is just an issue with perhaps the "open" or "dtype netcdf"
>>section of the code.
>>
>>
>>Am I doing something wrong, or is this just a slight oversight in the code?
>>
>>In this case, we are not in a rush for a resolution because convU isn't
>>an important parameter to us.  But it would be good to know for future
>>reference (in the case of a more critical parameter).
>>
>>I'll provide a sample file or full "ncdump -c" output if it will be useful.
>>
>>Best Regards,
>>   Diane Stokes
>>--
>>Diane Stokes
>>Environmental Modeling Center
>>National Weather Service/NOAA
>
>

--
Diane Stokes
Environmental Modeling Center
National Weather Service/NOAA



More information about the gradsusr mailing list