Version 4.6.8 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:
Many new features in 4.6.8 are, as usual, related to climatologies and regridding.
ncclimo
can now be given an explicit list of seasons to compute
instead of, or in addition to, MAM,JJA,SON,DJF.
ncremap
has improved mask and format handling. There are also
a collection of minor bugfixes and improvements, including JSON tweaks, ISO8601
printing, and GCC7 and netCDF 4.5.x compatibility.
This release includes an important ncwa fix that prevents incorrect answers
when hyperslabs are used with masks and/or weights. Upgrade if you use
nc-d
with
-d
hyperslabs.
PLEASE READ THIS IF YOU USE NCKS TO PRINT DATA:
The
ncks
default printing will change to CDL in summer 2017. For
20+ years
ncks
has, by default, dumped the text representation of a file
in (what we call) "traditional" mode, which best facilitates meticulous data
examination in line-by-line format.
ncdump
produces CDL format that is more useful for most NCO
users.
ncdump
has always printed clean CDL and for many years there
was little point in defaulting
ncks
printed output to CDL. However,
ncks
CDL mode now rivals
ncdump
in many ways. In particular,
ncks --cln
now prints times as human-readable calendar dates,
the last
ncdump
feature that I used which
ncks
lacked. Hence in summer 2017
ncks
default printed output will change to CDL. Then one will
type simply
"ncks"
instead of
"ncks --cdl"
. We just added a new
"--trd"
option to print traditional output. Use
--trd
in your scripts and their behavior will not change. Otherwise
your printing scripts will start to print CDL this summer. You have been
warned.
New Features
-
ncap2
now fully implements NCO chunking maps and policies. Previouslyncap2
preserved existing chunking in variables, but could not be told to do anythin different. Now all command-line chunking behavior supported by NCO works inncap2
.ncap2 --cnk_plc=unchunk -S cnk.nco in.nc4 out.nc4
http://nco.sf.net/nco.html#cnk -
ncks
CDL printing supports finer-grained control of date formats, including an ISO 8601 "T" option. Previouslyncks
printed UDUnits-compliant times as dates when invoked with the--cdl
and--cal
options. A third option,--dt_fmt
, now exposes finer control of the format with short, regular, and ISO8601 options:ncks -H -m -v time_bnds -C --cdl --dt_fmt=1 ~/nco/data/in.nc ncks -H -m -v time_bnds -C --cdl --dt_fmt=2 ~/nco/data/in.nc ncks -H -m -v time_bnds -C --cdl --dt_fmt=3 ~/nco/data/in.nc dt_fmt: Output: 0,1 1964-03-13 09:08:16 (Default, short format) 2 1964-03-13 09:08:16.000000 (regular format) 3 1964-03-13T09:08:16.000000 (ISO8601 "T" format)
Note that --dt_fmt automatically implies --cal.
http://nco.sf.net/nco.html#cln -
Some data are best evaluated with custom-defined seasons, e.g., JFM instead of DJF,
or two-month seasons such as FM or ON.
ncclimo
now supports up to eleven (and counting) seasons, although by default it only computes MAM, JJA, SON, and DJF. As of NCO 4.6.8, use theseasons
option to specify additional or alternate seasons:ncclimo --seasons=jfm,jas,ann -s 1980 -e 1983 -i drc_in -o drc_out
Use "–seasons=none
" to completely turn-off seasonal and annual-mean climatologies:ncclimo --seasons=none -s 1980 -e 1983 -i drc_in -o drc_out
http://nco.sf.net/nco.html#ncclimo -
ncremap --msk_src
and--msk_dst
options now accept the value 'none' to prevent the regridder from interpreting any variable as a mask in files from which source or destination grids are inferred.ncremap -i ~/ed.nc --msk_src=none -d ~/ed.nc -o ~/foo.nc ncremap -i ~/ed.nc -d ~/ed.nc --msk_dst=none -o ~/foo.nc
http://nco.sf.net/nco.html#ncremap -
ncremap
now accepts standard NCO arguments for output file type. The-3
,-4
,-5
,-6
, and-7
flags, or their long-option equivalents--fl_fmt=fmt
or--file_format=fmt
wherefmt
isclassic
,netcdf4
,64bit_data
,64bit_offset
, ornetcdf4_classic
(or some synonyms) causes the output files created byncremap
, e.g., the regridded files and the grid files, to have the requested format. The ERWG and TempestRemap weight-generators support only a subset of these formats.ncremap -7 -i ~/deepthroat.nc -d ~/wapo.nc -o ~/foo.nc
http://nco.sf.net/nco.html#fl_fmt_ncremap
Additional details are available in the ChangeLog.