[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 19990519: problem with ncgen



>To: address@hidden
>From: Olivier Amram <address@hidden>
>Subject: problem with ncgen
>Organization: .
>Keywords: 199905191603.KAA13560

Hi Olivier,

> I have some troubles when I try to convert the following file (see
> attached file) file with NCGEN program.

The file has some peculiar variable names that begin with a number.

    float 0.Precip.IntRain(time, y, x) ;

NetCDF variable names are supposed to begin with an alphabetic
character or "_".

The current version of netCDF (3.4) does not permit creating variables
with names that begin with a non-alphabetic character, but previous
versions before version 3 of netCDF allowed any characters to be used
in variable names.  The netCDF library can still access data from
files with arbitrary variable names, and ncdump can be used to look at
the data as text, but the ncgen program has never been able to
interpret such variables.  The reason for this is the same as the
reason most programming languages have restrictions on the characters
used in variable names: it would otherwise be difficult or impossible
to distinguish variables from numbers or to parse statements in the
language.

You can rename the variables to begin with an alphabetic character
using the nc_rename_var() function, for example.  If the new names are
no longer than the old names, this can be done "in-place" without
copying the data to a new file.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu