Re:Appending NetCDF file in unlimited dimension

  • Subject: Re:Appending NetCDF file in unlimited dimension
  • From: shectman@xxxxxxxxxxxxx (Robert M. Shectman)
  • Date: Tue, 9 Nov 93 17:14:58 -0800
Thank you for your responses and a minor apology.

In my example, it was easy to assume the presense of a second problem
issue.  The example had imbedded in it, the question of what
happens when I write temp[0...], temp[5...] to space for temp[1...] etc.,
in addition to the problem of what happens when I alternate writes
to two different record variables temp and rh.  

I understood that writing non sequentially to the same array would 
trigger fill values, what I was not sure of was whether alternating writes
to different arrays would trigger file rewrites to force the array
to be contiquous across the unlimited dimension.  The answer (thankfully)
is no, the record structure of the netCDF file handles it.  

I was pointed to the chapter in the documention entitled NetCDF
File Structure and Performance.

In particular it says "record data, containing the data record for variables
that have an unlimited dimension" and "the record-data part that follows
the fixed-size data consists of a variable number of records, each of which
contains data for all the record variables.  The record data for each
variable is stored contiquously in each record"



HOWEVER, this does point out a possible problem.  If I have two unlimited
variables, say A(unlimited,10) and B(unlimited, 100, 100, 100), each
NetCDF record will have space to hold both A and B.  If during the course
of data generation, I generate A at 1000 time steps, and B at ten time steps,
the file will contain enough storage to hold 1000 A's and 1000 B's, even
though I only use 10 of the B's.  This is something to be aware of, though
its to early to tell if this case will ever arise for us.


Thank you for your responses.

Robert M. Shectman
Atmospheric Release Advisory Capability
Lawrence Livermore National Laboratory

shectman@xxxxxxxx
(510) 423-6714