Re: [netcdfgroup] Problem in deleting variables with ncks (Pedro Vicente)

  • To: netCDF Mail List <netcdfgroup@xxxxxxxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] Problem in deleting variables with ncks (Pedro Vicente)
  • From: Charlie Zender <zender@xxxxxxx>
  • Date: Wed, 06 Nov 2013 11:27:33 -0800
Hi Naoki,

Let me revise the initial answer to this question on this group
to prevent incorrect information from spreading. Followups should
go to http://sourceforge.net/p/nco/discussion/?source=navbar

To delete a "bounds" variable like "time_bounds" use -C:

ncks -O -C -x -v time_bounds Season_ET.nc Season_ET.nc

It is fine to have the same input and output filename because
everything is written via a temporary file for safety.
The -C switch is necessary for a subtle reason having to do with
the CF metadata conventions. Without -C, NCO subsetting assumes
the user wants all coordinates and bounds and axes associated with
all extracted variables. Because you want your output file to contain
"time", and "time" lists "time_bounds" as a "bounds" variable, NCO
first deletes then restores "time_bounds" from the extraction list.
The -C switch tells the operator NOT to necessarily include all the
coordinates and bounds and axes, i.e., it does what you want.

cz
-- 
Charlie Zender, Earth System Sci. & Computer Sci.
University of California, Irvine 949-891-2429 )'(



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