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] Converting record dimension to non-record dimension

Joe,

Here is another method if NCO doesn't get it done. This is a trick to remove the "unlimited" characteristic on a named dimension. This method is relatively slow, but it has the advantage of simplicity and nothing new to install. This is in the general class of:

  ncdump in.nc | user hack | ncgen -o out.nc

Here is a specific example to remove unlimited. Change the dim name and integer value to match your file. C shell syntax:

  set str1 = 'time = UNLIMITED ; // (24350 currently)'
  set str2 = 'time = 24350 ;'
  ncdump in.nc | sed -e "s#^.$str1# $str2#" | ncgen -o out.nc

By the way, the whole file must *always* be rewritten at least once when changing "unlimited". Due to the internal structure of Netcdf 3 files, it is impossible to switch the unlimited characteristic on or off in place.

Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)

Joe Sirott wrote:
Does anyone know of a utility that will convert a large netCDF file that has a record dimension to a file that contains no record dimension at all?

--Joe
_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/



 
 
  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