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.
Mark, > To: <address@hidden> > From: Mark Takala <address@hidden> > Subject: CDL > Organization: UCAR/Unidata > Keywords: 200106192157.f5JLvw120928 The above message contained the following: > When I make a cdl, and use the commands to generate a netcdf file from it, > i am wondering how to make an array of data, from many samplings. > > variables: > double foo > foo:long_name ="foo" > foo:units="celsius" > data: > foo = (here i want an array, for many values. not just one) > > what can I do here? > > Mark The netCDF User's Guide contains examples of CDL for arrays that contain many values. Section 2.1.2 is particularly good. It's available at http://www.unidata.ucar.edu/packages/netcdf/guidec/guidec-7.html#HEADING7-0 Basically, you add dimensions to the CDL and define variables in terms of the dimensions, e.g. dimensions: lat = 5, lon = 10; variables: double foo(lat,lon) foo:long_name ="foo" foo:units="celsius" data: foo = 1, 2, 3, ...; Regards, Steve Emmerson <http://www.unidata.ucar.edu>