This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Organization: River Forecast Center, TULSA > Keywords: 199401131409.AA09924 Hi Nalneesh, > I am new to this group and I have a very straight forward question. How do > I put comments in the netcdf file. It seems that in the library there are > no functions that allow that kind of operation, or may be I am not so > thorough. Comments must be represented as the values of attributes, either named global attributes or variable-specific attributes. There is no standard way to represent the comments put in a CDL file after the "// " characters in the netCDF file, since those comments don't necessarily apply to either a particular variable or to the whole netCDF file (for example, they may apply to a dimension, an attribute, or a group of variables). General comments about all of the data in a netCDF file may be represented using a string-valued attribute, such as: :Comments = "This data is known to be suspect. Users who want\n", "to know the details, should consult the paper by\n", " I. M. Dubious, 1999." ; Comments about a dimension or attribute require some sort of convention, since dimensions and attributes cannot have attributes in the netCDF data model (only variables have attributes). You could use global attributes that include the dimension or variable/attribute name, for example: dimensions: rec = UNLIMITED; variables: float T; T:calibration = "-3" ; ... :Comments_rec_dim = "This dimension is unlimited because\n", "we may eventually want to add more\n", "data for later times.\n" ; :Comments_T_var_calibration_att = "in Hobson units"; Also, in the future you may want to send netcdf questions to the Unidata support address address@hidden, so they will be properly forwarded to someone who can answer the question even if I am out of town or on vacation. Thanks. --Russ __________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden P.O. Box 3000 (303)497-8645 Boulder, Colorado 80307-3000