Re: variable name

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu Nov 01 2012 - 20:13:00 MDT

Actually, basic NetCDF rules allow periods, dashes, spaces, and *all
other printing ASCII characters* in variable names, except slash (/).
I believe that NCL provides unrestricted access for this part of
NetCDF, through string references as Dennis showed. Restrictions are
added by conventions such as COARDS cited by Gerry, and CF, but the
original question did not mention a convention.

http://www.unidata.ucar.edu/software/netcdf/docs/object_name.html
http://www.unidata.ucar.edu/software/netcdf/docs/classic_format_spec.html

This is not to say that creating new NetCDF files with characters that
confuse programming languages is a good idea; try not to do this. CF,
for example, authorizes only underscores.

--Dave

On Thu, Nov 1, 2012 at 2:58 PM, Gerry Creager <gerry.creager@noaa.gov> wrote:
> Just following up on Dennis' comment about file names in NetCDF...
> >From http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html we
> find this statement:
> Variable names:
> Variable names should begin with a letter and be composed of letters,
> digits, and underscores. It is recommended that variable names be
> case-insensitive implying that the same case-insensitive name should
> not be used for multiple variables within a single file.
>
> gerry
>
>
> On Thu, Nov 1, 2012 at 12:10 PM, Dennis Shea <shea@ucar.edu> wrote:
>> x = f->$"PM2.5_emssion"$
>>
>> or
>> vname = "PM2.5_emssion"
>> x = f->$vname$
>>
>> =================================
>> Note: I do not thin that a valid netCDF name can contain a '.'
>>
>> On 11/01/2012 11:01 AM, Luo, Chao wrote:
>>> Hi,
>>>
>>> I am processing data of Netcdf format files by NCL script. One of
>>> variable names (PM2.5_emssion) can not be read by NCL. It seems the
>>> issue is related to variable name, which includes dot "." (
>>> fatal:syntax error: line 7 in file read.ncl before or near .5 , var =
>>> f->PM2.5). I was wondering if there is any way to read the data.
>>>
>>> Thanks much,
>>>
>>> CL
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 1 20:13:11 2012

This archive was generated by hypermail 2.1.8 : Tue Nov 06 2012 - 15:05:49 MST