template with %ch

Jennifer Adams jma at COLA.IGES.ORG
Wed Aug 16 10:43:01 EDT 2006


Mateus,
You need to change your variable declaration for dtype netcdf files. It
should be something like this:
    air 0 t,y,x air temperature
Check the output from ncdump on your netcdf file to make sure the
variable 'air' is not defined in the Z dimension. Also, with a dtype
short, you may run into problems with undef handling -- the undef 32766
will be converted into a float value and may interfere with results of
your data analysis -- better way to do it is to give a new undef value
and the name of the undef attribute (e.g. "missing_value"):
    UNDEF -1e+20 missing_value
This way, as GrADS does the I/O, it will retrieve the missing value for
your variable, test against it, and if it's a match, it will set the
data value to -1e+20.

The CHSUB entries look fine, but if you suspect them, then leave them
out for testing purposes and write a descriptor without templating and
see if you can open and display air temperatures from the first file.

Jennifer

p.s. In general, for questions about netcdf files, please include the
output from ncdump.

On Aug 16, 2006, at 10:17 AM, Mateus Teixeira wrote:

> Dear GrADS users,
>
> I'm trying to use the new template option %ch to open 3
> NCEP/NCAR-Reanalysis files which contain the air temperature at 1000
> hPa. Their names are: T1000_HS_1985_1990.nc; T1000_HS_1991_1995.nc; and
> T1000_HS_1996_2003.nc.
>
> Reading GrADS docs I saw an example to open netcdf files and made my
> control file as follow:
>
> DSET ^T1000_HS_%ch.nc
> OPTIONS template
> DTYPE netcdf
> CHSUB     1   8764 1985_1990
> CHSUB  8765  16068 1991_1995
> CHSUB 16069  27756 1996_2003
> UNDEF 32766
> XDEF 144 linear   0 2.5
> YDEF  37 linear -90 2.5
> ZDEF   1 linear 1000 1
> TDEF 27756 linear 00z01jan1985 4hr
> VARS 1
> air 1 99 Air Temperature
> ENDVARS
>
> However, when I tried to display this variable I got an error message:
>
> NetCDF Read Error (ncvarget) for data type NC_SHORT
> Data Request Error:  Error for variable 'air'
>  Error ocurred at column 1
> DISPLAY error:  Invalid expression
>  Expression = air
>
> The variable name is the same of the netCDF files, but I think that I
> missed something to GrADS gets properly the netCDF file.
>
> Thanks in advance!
>
> --
> Mateus da Silva Teixeira
> Doutorando em Meteorologia - CPTEC/INPE
> e-mail: mtex2k3 at yahoo.com.br, mateus at cptec.inpe.br
> site: www.geocities.com/mtex2k3
>
>
>
> _______________________________________________________
> Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu
> celular. Registre seu aparelho agora!
> http://br.mobile.yahoo.com/mailalertas/
>
>
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
4041 Powder Mill Road, Suite 302
Calverton, MD 20705 USA
jma at cola.iges.org



More information about the gradsusr mailing list