Version 4.6.6 of the netCDF Operators (NCO) has been released. NCO is an Open Source package that consists of a dozen standalone, command-line programs that take netCDF files as input, then operate (e.g., derive new data, average, print, hyperslab, manipulate metadata) and output the results to screen or files in text, binary, or netCDF formats.
The NCO project is coordinated by Professor Charlie Zender of the Department of Earth System Science, University of California, Irvine. More information about the project, along with binary and source downloads, are available on the SourceForge project page.
From the release message:
4.6.6 contains a potpurri of new features: Output 2D rectangular grids formatted as UGRID meshes. Calendar dates print for bounds and climatology variables. Revamped HPSS/hsi support. The splitter produces cleaner output. The regridder groks more files and masks, and annotates output with more helpful metadata. CDL mode handles compound record variables. JSON output has changed slightly to re-use NcML keywords. ncclimo and ncremap have new extract/exclude options.
EVERYONE WHO USES NCKS TO PRINT DATA PLEASE READ THIS:
We would like to change the default behavior of
For 20+ years
ncks has, by default, dumped the text representation
of a file in (what we call) "traditional" mode.
ncdump produces a
format called CDL that is more useful than traditional mode for most
ncks has produced CDL since only 2013 and so CDL is not the
ncdump has always printed CDL very cleanly and clearly there
was little point in making CDL the default for
ncks CDL mode rivals
ncdump, and is superior in some ways.
ncks now prints times as human-readable calendar dates,
ncdump feature I used that
ncks did not have.
We propose to change the default printed output of
ncks to CDL.
Then one would type simply "
ncks" instead of "
A new "
--trd" option would still print traditional output.
Let us know if this bothers or pleases you prior to 4.6.7.
ncclimosupport new extract/exclude switches:
--no_cll_msr: Exclude cell_measures variables
--no_frm_trm: Exclude formula_terms variables
--no_ntv_tms: Exclude native-grid timeseries (splitter only)
--no_stg_grd: Exclude staggered grid coordinates
By default, these variables are always extracted. Use the above switches to exclude them instead, e.g.,
ncclimo --no_cll_msr --no_frm_trm --no_ntv_tms --no_stg_grd ...http://nco.sf.net/nco.html#no_cll_msr
ncclimo's splitter mode no longer requires variable lists. Previously the splitter required a '
-v var_lst' option to know which variables to split into timeseries. Now when the
-voption is omitted the splitter creates timeseries of all variables of rank R ≥ 2. Typically this includes all spatial variables. Variables known to be extensive (like grid properties) are automatically excluded from this list. However, we expect there will be some cases where the splitter creates timeseries from R ≥ 2 variables that are not desirable. We are happy to encode manual exceptions as we receive notice of them.
ncclimo -s 1979 -e 1981 -o $drc_out in*.nchttp://nco.sf.net/nco.html#ncclimo
The regridder now produces UGRID output for 2D rectangular grids.
ncremapin grid inferral mode with "
--rgr ugrid=foo.nc" and voilà, an annoted UGRID file is produced along with the default SCRIP gridfile. The NCO UGRID is more complete than that produced by
ESMF_Scrip2Unstruct, but ESMF can create UGRID for much more comlex grids. The NCO regridder can currently only generate UGRID for rectangular 2D input grids, and there are no plans to extend this to curvilinear or unstructured input grids.
ncks --rgr nfr=Y --rgr grid=scrip.nc --rgr ugrid=ugrid.nc in.nc out.nchttp://nco.sf.net/nco.html#rgr
ncksnow prints the units, if any, in comments after CDL values when debugging is enabled with
$ ncks --cdl -D 1 in.nc lat = -90, 90 ; // units="degrees_north" lon = 0, 90, 180, 270 ; // units="degrees_east" tpt = 273.1, 273.2, ... 274 ; // units="kelvin"http://nco.sf.net/nco.html#cdl
ncap2now implements the CF
ncwahave long implemented this, and now the relevant
ncap2methods (avg, min, max, etc.) record the operation type in the
ncap2 -s 'avg=one_dmn_rec_var.avg()' ~/nco/data/in.nc ~/foo.nchttp://nco.sf.net/nco.html#cll_mth
nckshas printed the human-legible calendar string corresponding to values with UDUnits date units (time since basetime, e.g., "days since 2000-01-01") and CF calendar attribute, if any. Now
ncksalso translates and prints time values associated with CF climatology and bounds variables as human legible dates. As before, enact this with the
--calendaroption when printing. Using
dbg_lvl≥ 1 in CDL mode prints both the value and calendar string (one in comments):
$ ncks -D 1 --cdl --cal -v tm_365 ~/nco/data/in.nc tm_365 = "2013-03-01"; // double value: 59 $ ncks -D 1 --cdl -v tm_365 ~/nco/data/in.nc tm_365 = 59; // calendar format: "2013-03-01"This option is similar to the ncdump -t option. Does this work how you'd like? Let us know.
ncksnow prints "
(no units)" instead of "
(null)" as the units string for variables with no units. And in CDL mode
ncks, when invoked with debugging (e.g.,
-D 1) prints the units string in the comment section after the values of a variable.
Additional details are available in the ChangeLog.