Version 4.6.5 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.5 contains a potpurri of new features. Setting chunk cache size
--cnk_csh can accelerate aggregation of netCDF4 files.
Climatology and regridder users may appreciate the cleaned-up
output offered by the
ncremap --vrb_lvl switch and more intelligent
grid inferral. Everyone who has tried to convert "time since..."
values to calendar dates will like the new
ncks --cal switch that does
the UDUnits conversion for you. There are also helpful bugfixes for
ncap2 attribute propagation in corner cases, and corrected error codes
for bad command line arguments.
ncksallows setting chunk cache-size with
--cnk_cshwith all applicable operators. This sets the cache size for all variables. Users have demonstrated that increasing cache size can dramatically speed-up chunking operations on large datasets. This setting only works on netCDF4 files.
ncrcat --cnk_csh=1000000000 --cnk_plc=g3d --cnk_dmn=time,365 \ --cnk_dmn=lat,1800 --cnk_dmn=lon,3600 in*.nc4 out.nc4http://nco.sf.net/nco.html#cnk_csh
Thanks to Hugo Oliveira for encouraging this feature
ncksnow prints 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. Enact this with the
--calendaroption when printing. Using
dbg_lvl >= 1in 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 -toption. Does this work how you'd like? Let us know.
ncap2now seamlessly edits character arrays. Suppose you have a string stored as an old school character array (not a netCDF4 string) with a fixed dimension size.
ncap2now supports altering the string value without having to manually pad the RHS to the exact dimension size of the LHS:
ncap2 -s 'date_sng="2016-05-11_06:00:00"' in.nc out.nc ncap2 -s 'date_sng="automatic padding"' in.nc out.ncThe exact same syntax has always worked on netCDF4 strings. This new feature frees users from needing to know the ugly details of netCDF3 string storage.
ncremapsupports a verbosity level option,
--vrb_lvl. Verbosity level is now independent of debug level,
dbg_lvl, so users can customize how much
ncremapinformation to print. Default
vrb_lvl=2and supported levels range from 0 (no output) to 4 (most verbose). The verbosity of the underlying remapping, which invokes
ncks, is still controlled by
ncremap --vrb_lvl=1 -i in.nc -m map.nc -o out.nchttp://nco.sf.net/nco.html#ncremap
Thanks to Milena Veneziani for requesting.
ncclimonow support a version option,
--version. This option prints the operator version and configuration. It's a painless way to tell, e.g., if
ncremapknows where your
ESMF_RegridWeightGenexecutable is, and where these scripts look for NCO and what version of netCDF is linked to:
ncremap --version ncclimo --versionhttp://nco.sf.net/nco.html#ncremap
ncksnow parse more unknown grids than before. The front-end of
ncremap's grid-inferenence routine has been refactored to rely on less user-provided information about dimension names. Now it obtains more information than before by examining the grid coordinates. As a result, grids from data files with strange dimension names are likelier to be parsed.
Additional details are available in the ChangeLog.