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

Re: question about netCDF



Hi Fred,

> I browsed in the on-line documentattion, but didn't find an answer to this
> question:
> 
> How is the history global attribute supposed to work?
> 
> My reference manual dated April 1993 says that the history global attribute
> "is a character array with a line for each innvocation of a program ..."  I
> like this idea but don't see how a 1-dimensional global attribute supports a
> multi-line history, i.e., a 2-D array of characters.  I'd like to see a
> "well-behaved generic netCDF filter" that appends to the history attribute.
> 
> Can you help?

The new-line character, represented in a CDL string by "\n", is used to
separate lines in a multi-line global history.  For example, in CDL you
could use something like:

  :history = "created 5/08/92 by R. Rew\n",
             "here\'s a second line of history\n",
             "and here is the last line." ;

The ncgen program understands that this is a concatenation of multiple line
strings for a single character attribute value, and ncdump prints out the
attribute over multiple lines, rather than as a single long line of
characters with embedded "\n" characters.

For examples of a "well-behaved generic netCDF filter", see the netCDF
operators <URL:http://www.unidata.ucar.edu/packages/ncopers/> or Harvey
Davie's FAN package
<URL:ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/fan.tar.Z>, which I will
be announcing on netcdfgroup later today or tomorrow.

--Russ