[Thread Prev][Thread Next][Index]

Re: How do I redefine a grid to an unlimited time axis?



On Tue, 14 Oct 2003, Erik Buitenhuis wrote:
> I have a set of NetCDF files that have a fixed number of time points
> (that is, not UNLIMITED), and I want to ncrcat the files. ncrcat then
> complains
> ncrcat: ERROR input file PIS1.0_ET_PCUL_ptrc_1990 lacks a record dimension
> I think the solution would be to convert the time axis to unlimited, but
> neither Ref Sec4.3. DEFINE GRID nor
> $FER_DIR/doc/about_grid_files.txt
> tells me how to do this.

Hi Erik and Hein,

Another way to do it (which preserves all attributes, variable names,
etc.) is to ncdump your file and compare it with one that you know has an
UNLIMITED axis -- like $FER_DIR/fer_dsets/data/monthly_navy_winds.cdf.  
The key difference is in the "dimensions" section; for example,
monthly_navy_winds.cdf has:

dimensions:
        FNOCX = 144 ;
        FNOCY = 73 ;
        TIME = UNLIMITED ; // (132 currently)

Use a text editor (or a sed, awk, perl, or python script) to change your
time dimension description to look like this, and then use ncgen to
re-create the NetCDF file.  You should then be able to ncrcat these files 
together.

If each of your files is very large, you can extract just the dimension
info using "ncks -c", ncdump that file, edit it, ncgen, and then ncks it
together with the remaining data to get the final output.  More info on
ncks is available at

http://nco.sourceforge.net/nco.html

Cheers,

Andrew

+--------------------------------------------------------+
|   Dr. Andrew T. Wittenberg   |        GFDL/NOAA        |
|  Andrew.Wittenberg@noaa.gov  |      Princeton, NJ      |
+--------------------------------------------------------+




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement