Version 5.0.2 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:
Version 5.0.2 contains significant new features and few minor fixes.
ncclimo
now splits timeseries into variables specified by regular
expressions. ncremap
now supports the MOAB parallel interface to the
TempestRemap (TR) weight-generation libraries for 1D FV->FV grids.
The regridder and all quantization algorithms (including BitGroom)
have been refactored to treat NC_FILL_FLOAT/DOUBLE as the _FillValue
if no other _FillValue
has been explicitly set.
New Features
-
ncclimo
now expands variable lists that contain regular expressions (RX). Previously the splitter would aggregate all variables specified by an RX into a single timeseries file. Now the splitter places every variable into its own file. Thus using an RX produces the same timeseries files as explicitly specifying every variable. There is no change in the behavior of climo mode; it continues to put all variables in one file.ncclimo --var_lst=_2DMS.? in*.nc ncclimo --var_lst=_2DMS.? --var_xtr=area in*.nc
Both commands use an RX in a variable list. The second command explicitly adds the 'area' variable to all output timeseries. The improved functionality should be especially useful to analyze datasets with large numbers of tracers/species. Thanks to Qi Tang of PNNL for suggesting this feature. -
ncremap
now supports the MOAB parallel interface to the TempestRemap (TR) weight-generation libraries for 1D FV->FV grids.ncremap
will invokembtempest
in parallel mode whenever the user requests a TR algorithm (e.g.,--alg_typ=fv2fv_flx
) and, additionally, specifies the number of MPI tasks-per-node with--mpi_nb=<mpi_nbr>
:ncremap --alg_typ=fv2fv_flx ... --map=map.nc # TR ncremap --mpi_nbr=24 --alg_typ=fv2fv_flx ... --map=map.nc # MOAB
BTW, the same convention applies to MPI-enabled ERWG:ncremap --alg_typ=aave ... --map=map.nc # ESMF ncremap --mpi_nbr=24 --alg_typ=aave ... --map=map.nc # Parallel ESMF
ncremap
automatically usesmbconvert
to convert SCRIP and Exodus gridfiles (based on their file suffix) to MOAB.h5m
format. It then usesmbpart
to partition the MOAB grids, and then callsmbtempest
. Twoncremap
options specific tombtempest
are available to configure this workflow. The intersection algorithm can be set with--nsx_alg=advfront|kdtree
(default iskdtree
). Set the partition number formbpart
with--prt_nbr=<prt_nbr>
. The partition number must be a multiple ofmpi_nbr
and by defaultprt_nbr=mpi_nbr
.ncremap --mpi_nbr=24 --nsx_alg=advfront --alg_typ=fv2fv_flx ... ncremap --mpi_nbr=24 --prt_nbr=48 --alg_typ=fv2fv_flx ... ncremap --mpi_nbr=24 --prt_nbr=48 --alg_typ=fv2fv_flx ...
Limitations that MOAB anticipates removing in future releases: Currently MOAB is only trustworthy for thefv2fv_flx
algorithm. High order and spectral element maps require more work in MOAB. Currentlymbtempest
only generates map-files that regrid to rank 1 (unstructured) grids.mbtempest
"unrolls" any rank 2 (e.g., latxlon) destination grid into its rank 1 equivalent. Users seeking to regrid to rank 2 grids can manually alter the MOAB-generated mapfile with something like:ncks -O -x -v dst_grid_dims ~/map.nc ~/map_fix.nc ncap2 -O -s 'defdim("dst_grid_dims",2);dst_grid_dims($dst_grid_dims)={256,129};' ~/map_tmp.nc ~/map_fix.nc
Replace 256,129 by the lon,lat (Fortran order!) of your grid. The resulting map-file,map_fix.nc
, will almost regrid as intended. The regridded output will have curvilinear coordinates (e.g, lat(lat,lon)) instead of rectangular coordinates (e.g., lat(lat)), and the coordinate "bounds" variables (e.g.,lat_bnds
) will not be correct and may cause plotting issues at poles and Greenwich. Nevertheless, the weights are correct and of unsurpassed accuracy. MOAB anticipates supporting rank 2 mapfiles and TR high-order and spectral element algorithms in the future.
This initial NCO support gives the opportunity to adoptncremap
to generate FV->FV mapfiles with 1D destination grids, an important class of regridding problems for model coupling purposes. We welcome suggestions for new/improved options/features. Due to its complexity, only MOAB insalled via Conda is supported. Thanks to Vijay Mahadevan of ANL for his help with MOAB.
http://nco.sf.net/nco.html#tr
http://nco.sf.net/nco.html#moab -
Bit-Adjustment-Algorithms (BAAs) for lossy quantization
(e.g., BitGrooming) now only quantize the values
NC_FILL_FLOAT
orNC_FILL_DOUBLE
for float and double variables, respectively, when the_FillValue
attribute has been set to some other value. Previously all BAAs always quantizedNC_FILL_FLOAT
orNC_FILL_DOUBLE
unless they were explicitly set as_FillValue
. Thanks to Ed Hartnett of NOAA for this suggestion. -
Similarly, the
ncremap
regridder and vertical interpolation routines now treat the valuesNC_FILL_FLOAT
andNC_FILL_DOUBLE
as missing values for float and double variables, respectively, unless their_FillValue
has been explicitly set to some other value. Now datasets that never explicitly set a_FillValue
will be regridded/interpolated properly. -
Operators like
ncks
andncrcat
that utilize the UDUnits library will now report more thorough diagnostics when that library cannot be successfully opened, e.g., because the database file could not be found. This has been helpful in diagnosing the issues that underlie unexpected workflow failures that turn out to be due to incorrectly configured UDUnits environments. Thanks to Tom Vo of LLNL for helping uncover related issues. -
ncremap
now infers curvilinear grids from data files that include coordinates namedwest_east
andsouth_north
. Thanks to a StackOverflow user for suggesting this feature. -
ncclimo
now assumes the model name string in input files is'eam'
not'cam'
. The old behavior can be recovered by explicitly specifyingncclimo --mdl_nm=cam
.
Additional details are available in the ChangeLog.