Version 4.5.3 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:
This release mainly advances features related to regridding.
The primary advance is support for curvilinear regridding.
Latitude and longitude may now be two-dimensional coordinates.
NCO will now rectangular and curvilinear grids from most
(well-behaved) input data files, so regridding swath-like data (SLD)
(e.g., WRF and much NASA L2 data) just became a lot easier.
The
~/nco/data/sld_nco.sh
script integrates the most common regridding
tasks into a (hopefully) turnkey solution in time for Thanksgiving.
Feedback welcome!
New Features
-
NCO's new
configure --disable-doc
switch allows NCO (but not its documentation) to build on vanilla OSX again. It has long been possible to build/install NCO on MacOSX with a common packaging system, e.g., MacPorts, Fink, etc. However, it recently become important to build NCO from source on vanilla MacOSX without any packaging system. Apple has not updated some GNU tools (like Texinfo) for over 10 years, and maintaining backwards compatibility of the documentation on vanilla OSX is not feasible. Docs continue to build fine with MacPorts, Fink, etc. -
ncks --rgr nfr
reads any/all grid information from input files, infers any necessary but missing information (e.g., estimates cell interface locations from cell midpoints), and outputs the gridfile in SCRIP-format for easy use by offline regridders. The procedure works on input files where NCO can identify lat/lon coordinates.
ncks --rgr nfr --rgr grid=infer.nc in.nc out.nc
http://nco.sf.net/nco.html#grid -
ncks --rgr skl='y'
creates a "skeleton" version of a data file with the specified geometry. This skeleton file contains grid center and interfaces locations and gridcell area. These can be more easily be assessed, and continental outlines examined, than with the corresponding SCRIP file. The skeleton can also be manually populated with data rather than relying on a model.
# Generate T42 Gaussian grid file t42_SCRIP.nc and skeleton file t42_skl.nc ncks --rgr skl=${DATA/grids/t42_skl.nc --rgr grid=/grids/t42_SCRIP.nc \ --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr \ ~zender/nco/data/in.nc ~/foo.nc}
http://nco.sf.net/nco.html#skl -
Generate 2-D regional grids in SCRIP format, and, in conjunction
with a mapfile, regrid to/from regional bounding boxes.
During grid generation, specify bounding box edges with
--rgr wesn=lon_wst,lon_est,lat_sth,lat_nrt
or--rgr snwe=lat_sth,lat_nrt,lon_wst,lon_est
This feature debuted 4.5.2 but was not announced because it was not yet documented.
# Regrid global file to regional domain ncks --map map_global_to_regional_bilin.nc in.nc out.nc
http://nco.sf.net/nco.html#grid
http://nco.sf.net/nco.html#regrid -
Use
--xtn_var
or--extensive
to specify extensive variables. Extensive variables are summed not averaged during regridding. The support for extensive variables is not yet robust, yet we are ready to receive feedback from early adopters.
ncks --xtn count --map map.nc in.nc out.nc
http://nco.sf.net/nco.html#regrid
Additional details are available in the ChangeLog.