Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

[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
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690