[netcdfgroup] Appending new data to a variable

Hello All,
       I am trying to concatenate reasonably large netcdf files to make a
large file. I.e I am trying to combine 64 256 MB files to create a 16GB
file. I'm new to the file format and 'am not entirely sure whats the best
way to go about this! Each file contains a 3-D matrix of of size
2048*2048*32 of type short.

Naively I tried just creating a new file with the size of the new dataset
2048*2048*2048 and tried adding data to it. However everytime I add data
using nc_put_var_short, only the latest addition remains! for example
......
   if ((retval = nc_put_var_int(ncid, varid, &data_out[0][0][0])))
      ERR(retval);

   if ((retval = nc_put_var_int(ncid, varid, &data_out2[0][0][0])))
      ERR(retval);

   if ((retval = nc_close(ncid)))
      ERR(retval);
....
only retains data from out2!   Is there anyway to keep appending 3-D
matrices at the end of the current variable?

Advance thanks for any help!

Cheers,

C.S.N
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: