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.
Hi Drouineau,
There is an example of writing a variable with 2 unlimited dimensions in the
netCDF-4 source distribution, in the program
  libsrc4/tst_dims.c
If you built netCDF-4 and ran "make check", then this program should have been
compiled and run successfully, while printing out the message
  *** Testing file with two unlimited dimensions...ok
I don't see any problems with your example code.  When I compile and run it
linked
to the netcdf-4 library, it runs without error and creates the file
tst_large.nc.  When
I run the netCDF-4 ncdump on the file, it looks OK:
$ ../ncdump/ncdump tst_large.nc
netcdf tst_large {
dimensions:
        time = UNLIMITED ; // (10 currently)
        beam = UNLIMITED ; // (1000 currently)
variables:
        double depth(time, beam) ;
data:
 depth =
  1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
 ...
What is the indication you are seeing that your example is not successful?
--Russ
--Russ
Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: NJG-578265
Department: Support netCDF
Priority: Normal
Status: Closed