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

Re: [netcdfgroup] concatenate netcdf files

shl,

This type of concatenation is done easily and intuitively in NCL, and probably several other math and data handling languages. I would prefer to tell you about the NCL method. Do you have a working copy of NCL installed?

If not, there is an easy kludge. I do not like to recommend this because it is kludgey. However it is reliable, and frequently it gets the job done with least effort.

You can convert the latitude dimension into a record variable with a command line trick, manipulate the dimension line in the ncdump/CDL text version of the Netcdf file. In your case you can even just do it with a text editor because you have only four small files.

Then use ncrcat to concatenate the four subset files together, along the latitude dimension, as you have already surmised.

Please see my netcdfgroup post of 2007-nov-28, "Converting record dimension to non-record dimension", for an example of this method. In your case you are going the opposite way, from non-record to record, so change the control strings accordingly. HTH.

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/psd1/

shl7c wrote:
So, it seems like I should be able to use the ncrcat function to concatenate
the files... but that function requires that there be a record dimension.
I'm not entirely sure what that is...

It seems that I need for the latitude dimension to be a record dimension...
is there an easy way to make it such?


 
 
  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