[Git][debian-gis-team/nco][upstream] New upstream version 5.3.1
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Mon Jan 13 04:55:57 GMT 2025
Bas Couwenberg pushed to branch upstream at Debian GIS Project / nco
Commits:
0721c213 by Bas Couwenberg at 2025-01-13T05:47:26+01:00
New upstream version 5.3.1
- - - - -
20 changed files:
- bld/nco.spec
- bld/nco_dst.pl
- configure
- configure.ac
- configure.eg
- data/ncclimo
- data/ncremap
- debian/changelog
- doc/ANNOUNCE
- doc/ChangeLog
- doc/VERSION
- doc/debian.txt
- doc/index.shtml
- doc/nco.texi
- src/nco/nco.h
- src/nco/nco_msa.c
- src/nco/nco_rgr.c
- src/nco/nco_s1d.c
- src/nco/nco_scm.c
- src/nco/nco_var_utl.c
Changes:
=====================================
bld/nco.spec
=====================================
@@ -2,17 +2,17 @@
# http://cvs.fedoraproject.org/viewvc/devel/nco/nco.spec?view=co
Name: nco
-Version: 5.2.9
+Version: 5.3.1
Release: 1%{?dist}
Summary: Programs that manipulate netCDF files
Group: Applications/Engineering
License: BSD
URL: http://nco.sf.net/
-# Obtain NCO version 5.2.9-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 5.3.1-1 tar.gz from Sourceforge using CVS:
# cvs -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco login
-# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-5.2.9-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-5.2.9/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
+# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-5.3.1-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-5.3.1/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
Source0: nco-%{version}.tar.gz
#Patch0: nco_install_C_headers.patch
#Patch1: nco_find_udunits-dat.patch
@@ -108,6 +108,9 @@ fi
# %{_libdir}/libnco++.so
%changelog
+* Sun Jan 12 2025 Charlie Zender <zender at uci.edu> - 5.3.1-1
+- new upstream 5.3.1
+
* Mon Dec 23 2024 Charlie Zender <zender at uci.edu> - 5.3.0-1
- new upstream 5.3.0
=====================================
bld/nco_dst.pl
=====================================
@@ -5,20 +5,20 @@
# Usage:
# Export tagged, public versions
-# /usr/bin/scp ${DATA}/nco-5.3.0.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
-
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-5.3.0 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-5.3.0 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-5.3.0 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-5.3.0 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-5.3.0
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-5.3.0
+# /usr/bin/scp ${DATA}/nco-5.3.1.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-5.3.1 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-5.3.1 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-5.3.1 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-5.3.1 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-5.3.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-5.3.1
# Export daily snapshot
# ${HOME}/nco/bld/nco_dst.pl --dbg=2
@@ -256,7 +256,7 @@ if($bld){
# Set up FTP server
chdir $dst_pth_pfx or die "$prg_nm: ERROR unable to chdir to $dst_pth_pfx: $!\n"; # $! is system error string
cmd_prc("$cp_cmd $doc_fl ./$dst_vrs/doc"); # Copy derived documentation to source directory
- cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-5.3.0/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
+ cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-5.3.1/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
cmd_prc("$rsh_cmd $www_mch $rm_cmd $www_drc/src/$dst_fl"); # Remove any distribution with same name
if($dly_snp){cmd_prc("$rsh_cmd $www_mch $rm_cmd -r $www_drc/src/nco-????????.tar.gz");} # Remove previous daily snapshots from WWW server
cmd_prc("$rcp_cmd $dst_fl $www_mch:$www_drc/src"); # Copy local tarfile to WWW server
=====================================
configure
=====================================
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for NCO netCDF Operators 5.3.0.
+# Generated by GNU Autoconf 2.72 for NCO netCDF Operators 5.3.1.
#
# Report bugs to <nco-bugs at lists.sourceforge.net>.
#
@@ -616,8 +616,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='NCO netCDF Operators'
PACKAGE_TARNAME='nco'
-PACKAGE_VERSION='5.3.0'
-PACKAGE_STRING='NCO netCDF Operators 5.3.0'
+PACKAGE_VERSION='5.3.1'
+PACKAGE_STRING='NCO netCDF Operators 5.3.1'
PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
PACKAGE_URL=''
@@ -1426,7 +1426,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-'configure' configures NCO netCDF Operators 5.3.0 to adapt to many kinds of systems.
+'configure' configures NCO netCDF Operators 5.3.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1498,7 +1498,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of NCO netCDF Operators 5.3.0:";;
+ short | recursive ) echo "Configuration of NCO netCDF Operators 5.3.1:";;
esac
cat <<\_ACEOF
@@ -1670,7 +1670,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-NCO netCDF Operators configure 5.3.0
+NCO netCDF Operators configure 5.3.1
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2449,7 +2449,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by NCO netCDF Operators $as_me 5.3.0, which was
+It was created by NCO netCDF Operators $as_me 5.3.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4549,7 +4549,7 @@ fi
# Define the identity of the package.
PACKAGE='nco'
- VERSION='5.3.0'
+ VERSION='5.3.1'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -23047,7 +23047,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by NCO netCDF Operators $as_me 5.3.0, which was
+This file was extended by NCO netCDF Operators $as_me 5.3.1, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23115,7 +23115,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-NCO netCDF Operators config.status 5.3.0
+NCO netCDF Operators config.status 5.3.1
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"
=====================================
configure.ac
=====================================
@@ -56,7 +56,7 @@
# 20170808: Choose between traditional version and Git-based version
# If Git, consider that Linux dynamic libraries will have full messy name, MacOS will not
# https://stackoverflow.com/questions/43526939/how-to-insert-git-based-version-in-autoconf-managed-project
-AC_INIT([NCO netCDF Operators],[5.3.0],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[5.3.1],[nco-bugs at lists.sourceforge.net],[nco])
# Print GNU copyright in configure script
AC_COPYRIGHT
=====================================
configure.eg
=====================================
@@ -349,7 +349,7 @@ scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.u
# Latest sysadmin-compiled module usage: module load netcdf-c/4.7.4 nco/4.9.3 # 20201208
# Personal recipe last modified: 20240221 (fix E3SMU paths, use anaconda, not bld/Makefile)
# Personal recipe last borken: 20231129 /gpfs/alpine/cli115/proj-shared/e3sm-unified/base/envs/e3sm_unified_1.9.1_login/lib/libnetcdf.so: undefined reference to `H5Pset_dxpl_mpio' <-- Fix by manual linking to -lmfhdf -ldf -lhdf5_hl -lhdf5
-# Personal recipe last successful: 20240220
+# Personal recipe last successful: 20250101
export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE'
export LINUX_CXX='g++ -std=c++11'
export LINUX_FC='gfortran'
@@ -358,7 +358,6 @@ export NETCDF_ROOT=/ccs/proj/cli115/software/e3sm-unified/base/envs/e3sm_unified
export PATH=${PATH}:/ccs/proj/cli115/software/e3sm-unified/base/envs/e3sm_unified_latest/bin
cd ~/nco;git reset --hard origin/master
cd ~/nco;CC=${LINUX_CC} CXX=${LINUX_CXX} NETCDF_ROOT=${HOME}/anaconda ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
-# cd ~/nco/bld;make ANTLR_ROOT=${HOME} ANTLR_LIB=${MY_LIB_DIR} NETCDF_ROOT=${NETCDF_ROOT} OPTS=D OMP=Y allinone;cd -
# !Andes
# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on blues/anvil
@@ -444,7 +443,6 @@ scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.u
# Personal recipe last successful: 20230917
module purge
cd ~/nco;CC=${LINUX_CC} CXX=${LINUX_CXX} NETCDF_ROOT=${HOME}/anaconda ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
-cd ~/nco;ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
/bin/cp -f config.log nco.config.log.foo
/bin/cp -f libtool nco.libtool.foo
make clean;make > nco.make.foo 2>&1
@@ -535,6 +533,22 @@ make clean;make > nco.make.foo 2>&1
make check >> nco.make.foo 2>&1
make install >> nco.make.foo 2>&1
scp nco.configure.foo nco.config.log.foo nco.libtool.foo nco.make.foo dust.ess.uci.edu:Sites/nco/rgr
+
+# 20250102 Attempt to build on PM using entirely public directories
+export PATH="./:/global/cfs/cdirs/e3sm/zender/sh:/global/cfs/cdirs/e3sm/zender/bin_perlmutter:/global/cfs/cdirs/e3sm/zender/anaconda/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin:/opt/cray/pe/netcdf/4.8.1.1/gnu/9.1/bin"
+export LD_LIBRARY_PATH="./:/global/cfs/cdirs/e3sm/zender/lib_perlmutter:/global/cfs/cdirs/e3sm/zender/anaconda/lib:/usr/local/lib:/lib:/usr/lib:/usr/lib:/opt/cray/pe/netcdf/4.8.1.1/gnu/9.1/lib:/global/common/software/spackecp/perlmutter/e4s-21.11/software/cray-sles15-zen3/gcc-11.2.0/gsl-2.7-2p3pcjckzogek2dubph7q4yd5msjuhxt/lib"
+export MY_BIN_DIR=/global/cfs/cdirs/e3sm/zender/bin_perlmutter
+export MY_LIB_DIR=/global/cfs/cdirs/e3sm/zender/lib_perlmutter
+export MY_OBJ_DIR=/global/cfs/cdirs/e3sm/zender/obj_perlmutter
+
+export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE'
+export LINUX_CXX='g++ -std=c++11'
+export LINUX_FC='gfortran'
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest/lib
+export NETCDF_ROOT=/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest
+export PATH=${PATH}:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest/bin
+cd ~/nco;git reset --hard origin/master
+cd ~/nco;CC=${LINUX_CC} CPPFLAGS="-I${DATA}/anaconda/include -I/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest/include" CXX=${LINUX_CXX} LDFLAGS="-L${DATA}/anaconda/lib -L/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest/lib" NETCDF_ROOT=${DATA}/anaconda ./configure --prefix=${DATA} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.foo 2>&1
# !Perlmutter
# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on greenplanet
=====================================
data/ncclimo
=====================================
@@ -214,8 +214,8 @@ if [ "${hrd_pth}" = 'Yes' ] && [ "${NCO_PATH_OVERRIDE}" = 'Yes' ]; then
export PATH="${PATH}:${NCARG_ROOT}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib"
fi # !NCARG_ROOT
- export PATH='/global/homes/z/zender/bin_perlmutter'\:${PATH}
- export LD_LIBRARY_PATH='/global/homes/z/zender/lib_perlmutter'\:${LD_LIBRARY_PATH}
+ export PATH='/global/cfs/cdirs/e3sm/zender/bin_perlmutter'\:${PATH}
+ export LD_LIBRARY_PATH='/global/cfs/cdirs/e3sm/zender/lib_perlmutter'\:${LD_LIBRARY_PATH}
fi # !LMOD_SYSTEM_NAME
;; # !login
perlmutter* | nid[0123456789][0123456789][0123456789][0123456789][0123456789][0123456789] )
@@ -232,8 +232,8 @@ if [ "${hrd_pth}" = 'Yes' ] && [ "${NCO_PATH_OVERRIDE}" = 'Yes' ]; then
export PATH="${PATH}:${NCARG_ROOT}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib"
fi # !NCARG_ROOT
- export PATH='/global/homes/z/zender/bin_perlmutter'\:${PATH}
- export LD_LIBRARY_PATH='/global/homes/z/zender/lib_perlmutter:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest'\:${LD_LIBRARY_PATH} ; ;;
+ export PATH='/global/cfs/cdirs/e3sm/zender/bin_perlmutter'\:${PATH}
+ export LD_LIBRARY_PATH='/global/cfs/cdirs/e3sm/zender/lib_perlmutter:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest'\:${LD_LIBRARY_PATH} ; ;;
* ) # Default fall-through
hrd_pth_fnd='No' ; ;;
esac # !HOSTNAME
=====================================
data/ncremap
=====================================
@@ -230,8 +230,8 @@ if [ "${hrd_pth}" = 'Yes' ] && [ "${NCO_PATH_OVERRIDE}" = 'Yes' ]; then
export PATH="${PATH}:${NCARG_ROOT}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib"
fi # !NCARG_ROOT
- export PATH='/global/homes/z/zender/bin_perlmutter'\:${PATH}
- export LD_LIBRARY_PATH='/global/homes/z/zender/lib_perlmutter'\:${LD_LIBRARY_PATH}
+ export PATH='/global/cfs/cdirs/e3sm/zender/bin_perlmutter'\:${PATH}
+ export LD_LIBRARY_PATH='/global/cfs/cdirs/e3sm/zender/lib_perlmutter'\:${LD_LIBRARY_PATH}
fi # !LMOD_SYSTEM_NAME
;; # !login
perlmutter* | nid[0123456789][0123456789][0123456789][0123456789][0123456789][0123456789] )
@@ -248,8 +248,8 @@ if [ "${hrd_pth}" = 'Yes' ] && [ "${NCO_PATH_OVERRIDE}" = 'Yes' ]; then
export PATH="${PATH}:${NCARG_ROOT}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${NCARG_ROOT}/lib"
fi # !NCARG_ROOT
- export PATH='/global/homes/z/zender/bin_perlmutter'\:${PATH}
- export LD_LIBRARY_PATH='/global/homes/z/zender/lib_perlmutter:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest'\:${LD_LIBRARY_PATH} ; ;;
+ export PATH='/global/cfs/cdirs/e3sm/zender/bin_perlmutter'\:${PATH}
+ export LD_LIBRARY_PATH='/global/cfs/cdirs/e3sm/zender/lib_perlmutter:/global/common/software/e3sm/anaconda_envs/base/envs/e3sm_unified_latest'\:${LD_LIBRARY_PATH} ; ;;
* ) # Default fall-through
hrd_pth_fnd='No' ; ;;
esac # !HOSTNAME
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+nco (5.3.1-1) unstable; urgency=low
+
+ * new upstream version Dark Sunset (Farewell Palisades and Altadena): ncks: autoconversion in regridder/interpolator; ncremap: PS fix tm dmn, ERA5 t MERRA2 H, PM --npo
+
+ -- Charlie Zender <zender at uci.edu> Sun, 12 Jan 2025 12:26:18 -0700
+
nco (5.3.0-1) unstable; urgency=low
* new upstream version Awkward Self Haircut: ncclimo: tms area_wgt, omit -v; ncks: S1D refactor, lut_out, frc_column, frc_landunit, snw_ocn, pft->PFT, clmv4; ncrcat: fix REC_APN wrn
=====================================
doc/ANNOUNCE
=====================================
@@ -1,142 +1,124 @@
$Header$ -*-text-*-
-netCDF Operators NCO version 5.3.0 wag their tails
+netCDF Operators NCO version 5.3.1 howl at the Moon
http://nco.sf.net (Homepage, Mailing lists, Help)
http://github.com/nco/nco (Source Code, Issues, Releases)
What's new?
-Version 5.3.0 significantly improves the unpacking of ELM/CLM/CTSM
-history and restart datasets, and seems complete in this regard.
-ncrcat has more friendly behavior when appending, and ncclimo now
-outputs more metrics (such as valid area per gridcell) when in
-regional statistics mode. This release many be skipped if these
-changes do not interest you.
-
-Work on 5.3.1 is underway and includes improved NC_STRING for
-common text attributes.
+Version 5.3.1 adds features and fixes to ncremap and ncclimo.
+The new autoconversion feature allows these scripts to automagically
+convert netCDF4 string variables to netCDF3 character arrays.
+The improved treatment of fixed time dimensions allows ncclimo to work
+with raw MERRA2 files. Together these improvements make possible
+regridding and vertical interpolation of the new formatting of
+Copernicus Data Store (CDS) files used for, e.g., ERA5.
+Skip this release if these changes do not interest you.
+
+Work on 5.3.3 is underway and includes improved NC_STRING
+autoconversion support for other NCO operators.
Enjoy,
Charlie
NEW FEATURES (full details always in ChangeLog):
-A. Once again, ncks leveled-up how it unpacks ELM/CLM history/restart
-files. New features include automatic writing of fractional landunit
-and fractional column variables frc_landunit and frc_column,
-respectivly. frc_landunit is equivalent to the variable PCT_LANDUNIT
-sometimes placed in history files, but is expressed as a decimal
-fraction (not a percent) and is derived from restart files.
-The landunit dimension of frc_landunit is of size ten: Index zero
-contains the sum (should be 1.0) of standard landunit types/indexes
-1-9 soil, crop, ..., urban medium density).
-frc_column is a bespoke version of the same, only for column (not
-landunit) types. For datasets with Multiple Elevation Classes (MECs):
-index = 0 is soil column, index = 1 is MEC == 1, indexes 2..10
-are remaining MEC columns, index 11 is sub-total of MEC columns, index
-= 12 is deep lake column, index = 13 is wetland column, and index = 14
-is grand total of natural columns. For non-MEC datasets, index = 0 is
-soil column, index = 1 is glaciated column, index = 2 is deep lake
-column, index = 3 is wetland column, and index = 4 is grand total of
-natural columns.
-
-ncks --s1d --hrz=history.nc restart.nc s1d_r05.nc # Restart file
-ncks -m -v frc.? s1d_r05.nc
-netcdf s1d_r05 {
- dimensions:
- column = 15 ;
- landunit = 10 ;
- lat = 360 ;
- lon = 720 ;
-
- variables:
- float frc_column(column,lat,lon) ;
- float frc_landunit(landunit,lat,lon) ;
-}
-
-http://nco.sf.net/nco.html#s1d
-http://nco.sf.net/nco.html#unpack_sparse
-
-B. ncks can now grid snow-related variables into a top-down
-(ocean-like) vertical grid that many think is more intuitive.
-By default ELM/CLM/CTSM store the negative of the number of active
-snow layers in the variable SNLSNO. Restart files for these models
-store the active snow layer butted-up against the lowest layers in
-the level dimension (so that they are continguous with soil layers
-to simplify hydrologic calculations). This makes snow variables in
-restart files hard to visualize. By default S1D now uses SNLSNO, if
-present, to unpack snow variables in a first layer downwards order,
-increasing with depth. Inactive layers at the bottom (i.e., where they
-reside physically). The resulting snow variables appear like ocean
-state variables over uneven bathymetry, with missing value
-underneath. We call this "snow-ocean" ordering to contrast it with
-the on-disk storage order of snow variables.
-
-http://nco.sf.net/nco.html#s1d
-http://nco.sf.net/nco.html#snw_ocn
-http://nco.sf.net/nco.html#snw_rdr
-http://nco.sf.net/nco.html#no_snw_ocn
-
-C. ncks S1D now accepts the "--rgr lut_out=$lut_out" option to specify
-which column type(s) to place in each gridcell in the output file.
-The argument lut_out is the standard landunit type of the column,
-with (thus far) two additional values that will output area-weighted
-averages of multiple landunit types:
-
-lut_out Output will be value of column(s) in this Landunit
-1 Vegetated or bare soil
-2 Crop
-3 Landice (plain, no MEC)
-4 Landice multiple elevation classes
-5 Deep lake
-6 Wetland
-7 Urban tall building district
-8 Urban high density
-9 Urban medium density
-10 Area-weighted average of all landunit types except MEC glaciers
-13 Area-weighted average of soil+(non-MEC) glacier
-
-For example,
-ncks --s1d --rgr lut_out=1 --hrz=hst.nc rst.nc s1d.nc # Output Soil LUT
-ncks --s1d --rgr lut_out=13 --hrz=hst.nc rst.nc s1d.nc # Avg Soil+Glacier
-
-http://nco.sf.net/nco.html#s1d
-http://nco.sf.net/nco.html#lut_out
-
-D. ncremap always warns when it regrids land model files that contain
-a "landfrac" variable and SGS renormalization is not requested.
-This is because ELM/CLM/CTSM use "landfrac" for sub-gridscale
-fraction, and ignoring that causes errors along coastlines.
-EAMxx also archives that same "landfrac" but every EAMxx variable
-is valid throughout every gridcell so renormalization would be
-superfluous at best. Now ncremap no longer emits the "landfrac"
-WARNING for EAMxx files.
-http://nco.sf.net/nco.html#eamxx
-
-E. As of NCO version 5.3.0 (December, 2025) ncclimo automatically
-outputs additional metrics with global statistics. The output files
-containing the global timeseries also contain the variable
-valid_area_per_gridcell. This field is equivalent to the product of
-the area variable and the sgs_frc variable (if any). Thus for
-ELM/CLM/CTSM, this field equals area times landfrac, while for EAM/CAM
-this variable simply equals area. The output files also contain the
-area and sgs_frc variables separately. The presence of these variables
-in output allows downstream processors (e.g., zppy) to generate
-additional masks and weights for rescaling the statistics. For
-example, these fields can be used to rescale global sums into any
-units desired.
-ncclimo -P elm --split --rgn_stt=sum -c v3.LR.piControl -s 460 -e 461 \
---drc_in=drc_in --drc_out=drc_out
-http://nco.sf.net/nco.html#glb_stt
-http://nco.sf.net/nco.html#rgn_stt
+A. Autoconversion of NC_STRING variables, i.e., automatic conversion
+from type NC_STRING to NC_CHAR as dictated by choosing a netCDF3
+output from a netCDF4 input file, work for all attributes, but not for
+all variables. This is because attributes are at most one-dimensional
+and may be of any size whereas variables require gridded dimensions
+that usually do not fit the ragged sizes of text strings.
+Hence scalar NC_STRING attributes are correctly converted to and
+stored as NC_CHAR attributes in the netCDF3 output file, but
+not all NC_STRING variables are correctly converted.
+
+As of version 5.3.1, NCO has two distinct levels of support for
+autoconversion of NC_STRING variables. ncremap fully supports
+autoconversion of scalar NC_STRING variables in both horizontal
+regridder and vertical interpolation mode. This means that ncremap
+will produce netCDF3 output files from netCDF4 input files (if
+requested) and that any NC_STRING variables in the input files will be
+translated to NC_CHAR arrays in the netCDF3 output files. There is no
+loss of information since the entire contents of the string is
+preserved in the character array. Autoconversion stores the character
+array with a new dimension named sng_lng_X where X is the smallest
+power of ten between 10 and 10000 that is capable of containing the
+string contents (including the terminating NUL character).
+This type of variable autoconversion fails if the input string length
+exceeds 10000 (this is a safety measure, and could be expanded if
+people lobby me).
+
+All operators besides ncremap currently retain only the first
+character of the input NC_STRING array. This loses information.
+We are working to implement the same feature that ncremap enjoys.
+Both types of autoconversion fail if the input string variable is
+multidimensional, i.e., an array of type NC_STRING. A feature to solve
+that case is tractable, though we have not yet received any requests
+for it.
+
+Thanks to Waler Hannah (LLNL) for prompting this feature.
+http://nco.sf.net/nco.html#autoconversion
+http://nco.sf.net/nco.html#ncclimo
+
+B. ncremap's vertical interpolator now automatically extrapolates
+variables named "t" (as in ERA5 raw data) as if they were temperature.
+Futhermore the interpolator now automatically extrapolates variables
+named "H" (as in MERRA2 raw data) and VerticalLayerMidpoint (SCREAM)
+as if they were geopotential height. See the documentation for
+specifics about the temperature and geopotential height extrapolation
+algorithms.
+http://nco.sf.net/nco.html#vrt
+
+C. For many years, users at select supercomputer centers have been
+able to access the latest versions of NCO scripts directly from
+C. Zender's build directories. However, this feature was not
+documented until now. Zender's build directories usually contain the
+latest NCO snapshot, and so may be unstable and are not for everyday
+use. This feature is instead intended to allow users to test and
+provide feedback on new features before they are distributed in a
+public release.
+Invoking ncclimo and ncremap with the --npo (or long-option equivalent
+--nco_path_override) flag as the first option (i.e., as $1) causes
+these scripts to utilize the binary NCO executables in Zender's build
+directories on the following machines at the national supercomputer
+centers in parentheses:
+acme1 (LLNL), andes (ORNL), chrysalis (ANL), compy (PNNL), derecho
+(NCAR), frontier (ORNL), and perlmutter (NERSC).
+
+If the latest features that you want are actually implemented in the
+NCO binaries or library, then it may suffice to invoke your own
+version of the scripts, as in the first examples below. However, if
+the latest features that you want are implemented in the scripts
+themselves, then you can either invoke Zender's scripts directly (as
+in the second set of examples), or copy those scripts into your own
+executable path:
+ at verbatim
+# Access Zender's latest binaries from your default scripts
+ncremap --npo -m map.nc in.nc out.nc
+ncclimo --npo -P elm -c ${caseid} ...
+# Access Zender's latest binaries from Zender's latest scripts
+~zender/bin/ncremap --npo -m map.nc in.nc out.nc
+~zender/bin/ncclimo --npo -P elm -c ${caseid} ...
+ at end verbatim
+ at end example
+In both cases, the --npo flag must be the first option invoked.
+http://nco.sf.net/nco.html#npo
+http://nco.sf.net/nco.html#nco_path_override
BUG FIXES:
-A. ncrcat ensures that the last time value and monotonicity are
-both defined before the monotonicity check is performed in REC_APN
-mode. This fixes overly noisy false-negative WARNINGs about
-monotonicity. Thanks to Seth McGinnis (NCAR) for reporting this
-problem.
+A. ncremap's vertical interpolator now understands that the time
+dimension in input surface pressure fields may be "fixed".
+Previously the interpolator assumed that the temporal dimension, if
+any, was an unlimited/record dimension. This could cause it to
+miscalculate the number of horizontal spatial dimensions, and then
+to fail. Now the interpolator considers any fixed dimension named
+"time", or most unlimited dimensions (except certain corner cases) to
+be temporal dimension. This allows it to interpolate raw MERRA2 or
+ERA5 data. Thanks to Naser Mahfouz (PNNL) for prompting this
+fix/feature.
+http://nco.sf.net/nco.html#vrt
Full release statement at http://nco.sf.net/ANNOUNCE
=====================================
doc/ChangeLog
=====================================
@@ -1,3 +1,55 @@
+2025-01-12 Charlie Zender <zender at uci.edu>
+
+ * NCO 5.3.1 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.1: Dark Sunset (Palisades Lost)';git push
+ git tag -a 5.3.1 -m 'ncks: autoconversion in regridder/interpolator; ncremap: PS fix tm dmn, ERA5 t MERRA2 H, PM --npo';git push --tags
+
+ * Document 5.3.1
+
+2025-01-03 Charlie Zender <zender at uci.edu>
+
+ * NCO 5.3.1-alpha02 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.1-alpha02: Poison Enchilada';git push
+ git tag -a 5.3.1-alpha02 -m 'all: 2025; ncremap: PS fix tm dmn, ERA5 t MERRA2 H, PM --npo';git push --tags
+
+ * Change Perlmutter --npo paths to /global/cfs/cdirs/e3sm/zender/[bin,lib]_perlmutter
+
+2025-01-02 Charlie Zender <zender at uci.edu>
+
+ * Extrapolate variables named "H" with geopotential height algorithm
+
+ * Verify MERRA2 prs->hyb interpolation works when time is fixed dimension
+
+ * Extrapolate variables named "t" as temperature profiles (like ERA5) using global lapse rate method
+
+ * Demonstrate prs->hyb interpolation for MERRA2 works correctly for multi-timestep datasets
+
+2025-01-01 Charlie Zender <zender at uci.edu>
+
+ * Handle fixed time dimension in PS in pure pressure input (like MERRA2)
+
+2024-12-31 Charlie Zender <zender at uci.edu>
+
+ * 2025
+
+2024-12-29 Charlie Zender <zender at uci.edu>
+
+ * NCO 5.3.1-alpha01 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.1-alpha01: Au Revoir Chloe';git push
+ git tag -a 5.3.1-alpha01 -m 'Functionally identical to 5.3.0, plus autoconversion in regridder/interpolator';git push --tags
+
+ * ncks: Add autoconversion to vertical interpolation. Works single-threaded, fails multi-threaded.
+
+2024-12-28 Charlie Zender <zender at uci.edu>
+
+ * ncks: Finish autoconversion functionality in horizontal regridder
+
+ * ncks: Generalize string length dimension size as smallest necessary integral power of 10
+
+2024-12-24 Charlie Zender <zender at uci.edu>
+
+ * ncks: Add stubs to handle autoconversion in regridder
+
2024-12-23 Charlie Zender <zender at uci.edu>
* NCO 5.3.0 release procedure:
=====================================
doc/VERSION
=====================================
@@ -1 +1 @@
-5.3.0
+5.3.1
=====================================
doc/debian.txt
=====================================
@@ -29,18 +29,18 @@ apt-get install dh-make debhelper devscripts fakeroot gnupg debian-policy develo
2. Debian build procedure recommends placing entire package source in
subdirectory of main package.
- For starters, we wish to create .debs of tagged releases, e.g., nco-5.2.9
- First we create a clean source distribution of nco and place it in nco-5.2.9
+ For starters, we wish to create .debs of tagged releases, e.g., nco-5.3.1
+ First we create a clean source distribution of nco and place it in nco-5.3.1
Until we know what is necessary, however, we just copy a snapshot
2.1 Clean all build files from development directory
cd ~/nco;make distclean;cd bld;make clean;cd ~
tar cvzf ./nco/nco.tar.gz ./nco/*
-cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-5.2.9
-/bin/rm nco.tar.gz;tar cvzf nco-5.2.9.tar.gz ./nco-5.2.9/*
-cd ~/nco/nco-5.2.9
-dh_make -e zender at uci.edu -f ../nco-5.2.9.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-5.3.1
+/bin/rm nco.tar.gz;tar cvzf nco-5.3.1.tar.gz ./nco-5.3.1/*
+cd ~/nco/nco-5.3.1
+dh_make -e zender at uci.edu -f ../nco-5.3.1.tar.gz
2.2 The preceding steps created template debian files for a .deb,
Those files now reside in ~/nco/debian.
@@ -55,7 +55,7 @@ dh_make -e zender at uci.edu -f ../nco-5.2.9.tar.gz
from previous build
cd ~/nco;/bin/rm *.gz
- cd ~/nco/nco-5.2.9
+ cd ~/nco/nco-5.3.1
dpkg-buildpackage -rfakeroot > foo 2>&1
dpkg-buildpackage -rsudo > foo 2>&1
@@ -84,33 +84,33 @@ patch -p0 < nco_X.Y.Z-3.diff # Patch destination with Debian diff
make tags
# Put cute version-specific string in nco_ctl.c:nco_nmn_get()
# Install correct version numbers before updating Debian
-# tags-query replace 5.2.9 with X.Y.Z+1
+# tags-query replace 5.3.1 with X.Y.Z+1
# If tags-query replace does not work, be sure to manually change
# versions in configure.ac, debian/files, doc/ANNOUNCE, doc/debian.txt,
# doc/index.shtml, doc/nco.texi, bld/nco_dst.pl, doc/VERSION
# 20141201: Change NCO_VERSION_PATCH in src/nco.h!!!!!!!!!!!!!!!!!!!!!!
- cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 5.2.9-1 # Update changelog (-b forces this version number)
+ cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 5.3.1-1 # Update changelog (-b forces this version number)
emacs ~/nco/bld/nco.spec # Update changelog
# For unknown reason rules file may lose its executable bit
chmod a+x ~/nco/debian/rules
# Rebuild autotools so new version # propagates
cd ~/nco;aclocal;autoheader;automake --foreign;autoconf
# Save all files in emacs before tagging
- ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-5.2.9
+ ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-5.3.1
# Upload tarball to SF https://sourceforge.net/projects/nco/files
- cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-5.2.9.tar.gz .
+ cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-5.3.1.tar.gz .
7. Ubuntu PPA
https://help.launchpad.net/Packaging/PPA
-dput NCO nco_5.2.9-2~ppa1_source.changes
+dput NCO nco_5.3.1-2~ppa1_source.changes
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
# Location of build diagnostics for mentors to help
-http://dust.ess.uci.edu/nco/src/nco_5.2.9-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_5.2.9-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_5.2.9-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_5.2.9-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_5.2.9.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_5.3.1-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_5.3.1-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_5.3.1-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_5.3.1-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_5.3.1.orig.tar.gz
# Becoming a Debian developer
http://www.debian.org/devel/join/newmaint
@@ -164,31 +164,31 @@ Matej Vela <vela at debian.org>, Daniel Baumann <daniel at debian.org>, Warren Turkal
# export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/X11R6/lib
# sudo aptitude install antlr bison flex gsl-bin libgsl0-dev libantlr-dev netcdf-bin libnetcdfc7 libnetcdf-dev texinfo libcurl4-gnutls-dev libexpat1-dev libxml2-dev udunits-bin libudunits2-0 libudunits2-dev
cd ~/nco;cvc
-sudo /bin/rm -rf ${DATA}/nco-5.2.9 ${DATA}/nco_5.2.9* ${DATA}/debian # Cleanup last build. sudo necessary for removal because dpkg-buildpackage uses sudo?
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.2.9-1 -d nco-5.2.9 nco # Export based on tag
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -d nco-5.2.9 nco # Export most recent
-tar cvzf ./nco_5.2.9.orig.tar.gz --exclude='nco-5.2.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.2.9
-/bin/rm -rf ${DATA}/nco-5.2.9 # Remove cvs-exported directory
-tar xvzf ./nco_5.2.9.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-5.2.9/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-5.2.9/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-5.2.9/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-5.3.1 ${DATA}/nco_5.3.1* ${DATA}/debian # Cleanup last build. sudo necessary for removal because dpkg-buildpackage uses sudo?
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.1-1 -d nco-5.3.1 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -d nco-5.3.1 nco # Export most recent
+tar cvzf ./nco_5.3.1.orig.tar.gz --exclude='nco-5.3.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.1
+/bin/rm -rf ${DATA}/nco-5.3.1 # Remove cvs-exported directory
+tar xvzf ./nco_5.3.1.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-5.3.1/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-5.3.1/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-5.3.1/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
#export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-#cd ${DATA}/nco-5.2.9;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-5.2.9;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes
-cd ${DATA}/nco-5.2.9;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-5.3.1;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-5.3.1;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes
+cd ${DATA}/nco-5.3.1;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_5.2.9-1_*.deb
+sudo dpkg --install ${DATA}/nco_5.3.1-1_*.deb
cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
# http://lintian.debian.org/full/zender@uci.edu.html
-lintian ${DATA}/nco_5.2.9-1_*.deb
-ls -l ${DATA}/nco_5.2.9*
+lintian ${DATA}/nco_5.3.1-1_*.deb
+ls -l ${DATA}/nco_5.3.1*
m ~/foo.nco
# Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_5.2.9* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_5.2.9* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_5.3.1* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_5.3.1* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
# NB: Make sure RPMs build before uploading to debian, since changing
# Debian versions is a PITA
# NB: Only upload pbuilder Debian Sid (not personal Ubuntu) .deb builds to Debian mentors
-# cd ${DATA};dupload -t mentors nco_5.2.9-1_*.changes
+# cd ${DATA};dupload -t mentors nco_5.3.1-1_*.changes
bsrc # Reset shell environment for regular development
# New build system #2
@@ -202,52 +202,52 @@ DIST=sid sudo pbuilder update # Update chroot before building package in it
# dget http://ftp.debian.org/debian/pool/main/n/nco/nco_3.9.0-1.dsc
# dget http://ftp.debian.org/debian/pool/main/n/netcdf/netcdf_3.6.1-1.dsc
# apt-get source nco # Get package source
-sudo /bin/rm /var/cache/pbuilder/result/nco_5.2.9* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_5.3.1* # Cleanup prior build
# To pass DEB_BUILD_OPTIONS to pbuilder while using sudo, one must first
# modify sudoers with visudo to prevent sudo from resetting environment
#export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-cd ${DATA};DIST=sid sudo pbuilder build nco_5.2.9-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_5.2.9-1_*.changes
-lintian /var/cache/pbuilder/result/nco_5.2.9-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_5.3.1-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_5.3.1-1_*.changes
+lintian /var/cache/pbuilder/result/nco_5.3.1-1_*.deb
sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_5.2.9-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_5.3.1-1_*.deb
cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
# NB: Upload pbuilder Debian Sid packages to Debian mentors, but not
# to personal or NCO websites since most people use Ubuntu not Debian
# NB: Debian versions are a PITA, ensure RPMs build before uploading to Debian
-cd /var/cache/pbuilder/result;dupload -t mentors nco_5.2.9-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_5.3.1-1_*.changes
# RPM builds as root
export rpm_root='/usr/src/redhat'
# export sudo_sng='' # sudo not-necessary when builing in user directories
export sudo_sng='sudo' # sudo necessary when building in system directories
cd ~/nco;cvc;cvu
-/bin/rm -rf ${DATA}/nco-5.2.9 ${DATA}/nco-5.2.9* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-5.3.1 ${DATA}/nco-5.3.1* # Cleanup last build
${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-5.2.9 \
-${rpm_root}/RPMS/i386/nco-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.2.9-?.i386.rpm \
-${rpm_root}/SOURCES/nco-5.2.9.tar.gz \
-${rpm_root}/SPECS/nco-5.2.9.spec \
-${rpm_root}/SRPMS/nco-5.2.9-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.2.9-1 -d nco-5.2.9 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-5.2.9.spec
-tar cvzf ./nco-5.2.9.tar.gz --exclude='nco-5.2.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.2.9
-${sudo_sng} /bin/cp ${DATA}/nco-5.2.9.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-5.3.1 \
+${rpm_root}/RPMS/i386/nco-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.1-?.i386.rpm \
+${rpm_root}/SOURCES/nco-5.3.1.tar.gz \
+${rpm_root}/SPECS/nco-5.3.1.spec \
+${rpm_root}/SRPMS/nco-5.3.1-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.1-1 -d nco-5.3.1 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-5.3.1.spec
+tar cvzf ./nco-5.3.1.tar.gz --exclude='nco-5.3.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.1
+${sudo_sng} /bin/cp ${DATA}/nco-5.3.1.tar.gz ${rpm_root}/SOURCES
cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-5.2.9.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-5.3.1.spec > ~/foo.nco 2>&1
scp \
-${rpm_root}/RPMS/i386/nco-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.2.9-?.i386.rpm \
-${rpm_root}/SRPMS/nco-5.2.9-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.1-?.i386.rpm \
+${rpm_root}/SRPMS/nco-5.3.1-?.src.rpm \
dust.ess.uci.edu:/var/www/html/nco/src
scp \
-${rpm_root}/RPMS/i386/nco-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.2.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.2.9-?.i386.rpm \
-${rpm_root}/SRPMS/nco-5.2.9-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.1-?.i386.rpm \
+${rpm_root}/SRPMS/nco-5.3.1-?.src.rpm \
zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
# RPM builds as user
@@ -256,33 +256,33 @@ zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
export rpm_root="${DATA}/rpm/nco"
#cd ~/nco;cvc;cvu # This risks committing unwanted *.[ch]pp files
mkdir -p ${DATA}/rpm/nco/TMP ${DATA}/rpm/nco/BUILD
-/bin/rm -rf ${DATA}/nco-5.2.9 ${DATA}/nco-5.2.9* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-5.3.1 ${DATA}/nco-5.3.1* # Cleanup last build
/bin/rm -r -f \
-${rpm_root}/nco-5.2.9-?.src.rpm \
-${rpm_root}/nco-5.2.9.spec \
-${rpm_root}/nco-5.2.9.tar.gz \
-${rpm_root}/*/nco-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-devel-5.2.9-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.2.9-1 -d nco-5.2.9 nco # Export based on tag
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -dnco-5.2.9 nco # Export most recent and build as 5.2.9-1
-tar cvzf ./nco-5.2.9.tar.gz --exclude='nco-5.2.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.2.9
-/bin/cp ${DATA}/nco-5.2.9.tar.gz ${rpm_root}
+${rpm_root}/nco-5.3.1-?.src.rpm \
+${rpm_root}/nco-5.3.1.spec \
+${rpm_root}/nco-5.3.1.tar.gz \
+${rpm_root}/*/nco-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.1-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.1-1 -d nco-5.3.1 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -dnco-5.3.1 nco # Export most recent and build as 5.3.1-1
+tar cvzf ./nco-5.3.1.tar.gz --exclude='nco-5.3.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.1
+/bin/cp ${DATA}/nco-5.3.1.tar.gz ${rpm_root}
ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/nco.spec
cd ${rpm_root}
rpmbuild -ba --sign nco.spec > ~/foo.nco 2>&1
-rpmlint ${rpm_root}/*/nco-5.2.9-?.*.rpm
+rpmlint ${rpm_root}/*/nco-5.3.1-?.*.rpm
sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-5.2.9-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-5.3.1-?.*.rpm
scp \
-${rpm_root}/*/nco-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-devel-5.2.9-?.*.rpm \
-${rpm_root}/nco-5.2.9-?.*.src.rpm \
+${rpm_root}/*/nco-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.1-?.*.rpm \
+${rpm_root}/nco-5.3.1-?.*.src.rpm \
dust.ess.uci.edu:/var/www/html/nco/src
scp \
-${rpm_root}/*/nco-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.2.9-?.*.rpm \
-${rpm_root}/*/nco-devel-5.2.9-?.*.rpm \
-${rpm_root}/nco-5.2.9-?.*.src.rpm \
+${rpm_root}/*/nco-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.1-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.1-?.*.rpm \
+${rpm_root}/nco-5.3.1-?.*.src.rpm \
zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
=====================================
doc/index.shtml
=====================================
@@ -71,7 +71,7 @@ Try to disable Spammers' machines:
<p><h1 align="center">Bienvenue sur le netCDF Operator (NCO) site</h1>
<p><h2>
-Current stable NCO version is 5.3.0 released <!--#flastmod file="src/nco-5.3.0.tar.gz"-->
+Current stable NCO version is 5.3.1 released <!--#flastmod file="src/nco-5.3.1.tar.gz"-->
</h2>
<table border=0 width=100%>
@@ -155,7 +155,8 @@ and
<h2>Recent Releases & Milestones</h2>
<ul>
-<li>2025 Jan ??: 5.3.1 <i>In Progress...</i>
+<li>2025 Feb ??: 5.3.2 <i>In Progress...</i>
+<li>2025 Jan 12: 5.3.1 ncclimo/ncremap features
<li>2024 Dec 23: 5.3.0 S1D more features
<li>2024 Oct 18: 5.2.9 S1D features
<li>2024 Sep 02: 5.2.8 ncclimo --rgn_stt
@@ -661,16 +662,21 @@ Identical copies of those tarballs are also stored
<a href="http://nco.sf.net/src">here</a> on SourceForge for historical
continuity.
You may retrieve the source of tagged versions directly with, e.g.,
-<tt>git clone -b 5.3.0 http://github.com/nco/nco.git nco-5.3.0</tt></a>.
+<tt>git clone -b 5.3.1 http://github.com/nco/nco.git nco-5.3.1</tt></a>.
<ul>
-<li><b>NCO 5.3.2</b>: (<i>Future</i>)
+<li><b>NCO 5.3.3</b>: (<i>Future</i>)
netCDF4 user-defined types support;
<tt>ncks --xtn</tt> better extensive variable treatment?;
<tt>ncks --bsa</tt> Byte-swap algoritm;
+<tt>ncremap</tt> CF Convention for longitude vertices in map-files;
<tt>ncremap</tt> small-circle weights;</li>
-<li><b>NCO 5.3.1</b>: (<i>In Progress, features in-progress or complete include</i>)
-<tt>ncremap</tt> CF Convention for longitude vertices in map-files</li>
-<li><b>NCO 5.3.0</b>: (<i>Current Stable Release</i>)
+<li><b>NCO 5.3.2</b>: (<i>In Progress, features in-progress or complete include</i>)
+<tt>ncremap</tt> Gracefully autoconvert N-D NC_STRING->(N+1)-D NC_CHAR variables</li>
+<li><b>NCO 5.3.1</b>: (<i>Current Stable Release</i>)
+<tt>ncclimo/ncremap</tt> <tt>--npo</tt>, build revamp;
+<tt>ncremap</tt> Gracefully autoconvert 0-D NC_STRING->1-D NC_CHAR variables;
+<tt>ncremap</tt> Fixed time dimension OK, <tt>t, H</tt> interpolation;</li>
+<li><b>NCO 5.3.0</b>:
<tt>ncclimo area_wgt</tt>;
<tt>ncks --s1d --snw_ocn --lut_out</tt>;
<tt>ncks --s1d</tt> <tt>frc_landunit</tt>, <tt>frc_column</tt>;
@@ -853,7 +859,7 @@ Or, alternatively, permanently add conda-forge (which teems with goodies besides
‘<tt>conda config --add channels conda-forge</tt>’, then
install NCO with ‘<tt>conda install nco</tt>’.
The default NCO installed by <tt>conda</tt> is generally within a month of the latest release.
-<li><a href="https://github.com/conda-forge/nco-feedstock">nco-5.3.0</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-5.3.1</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
Thanks to Rich Signell, Filipe Fernandes, Pedro Vicente, Xylar Asay-Davis and others for developing and maintaining the NCO package for conda.
</ul>
@@ -862,7 +868,7 @@ Thanks to Rich Signell, Filipe Fernandes, Pedro Vicente, Xylar Asay-Davis and ot
<h3><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux</a></h3>
<ul>
<!--
-<li><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux-compatible Intel systems, prebuilt binary executable <a href="http://www.debian.org">deb</a>: <a href="http://packages.debian.org/testing/math/nco.html">nco-5.3.0</a></li>
+<li><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux-compatible Intel systems, prebuilt binary executable <a href="http://www.debian.org">deb</a>: <a href="http://packages.debian.org/testing/math/nco.html">nco-5.3.1</a></li>
-->
<a href="http://packages.debian.org/unstable/science/nco">Debian NCO</a> and
<a href="https://launchpad.net/ubuntu/+source/nco">Ubuntu NCO</a> homepages.
@@ -870,8 +876,8 @@ Thanks to Rich Signell, Filipe Fernandes, Pedro Vicente, Xylar Asay-Davis and ot
NCO packages in the Debian/Ubuntu repositories (e.g., Sid and Raring) generally lag the packages distributed here by 6–12 months.
<a name="beta"></a><a name="prerelease"> <!-- http://nco.sf.net#beta -->
Newer (beta- or pre-release) packages are often available for intrepid Debian/Ubuntu users as described <a href="https://github.com/nco/nco/tree/master/doc/beta.txt">here</a>.
-<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_5.3.0-1_i386.deb</tt>’):</dt>
-<li><a href="https://launchpad.net/ubuntu/+source/nco/5.3.0-1">nco_5.3.0-1_amd64.deb</a> : Executables AMD64-compatible</li>
+<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_5.3.1-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/5.3.1-1">nco_5.3.1-1_amd64.deb</a> : Executables AMD64-compatible</li>
Thanks to Daniel Baumann, Sebastian Couwenberg, Barry deFreese, Francesco Lovergine,
Brian Mays, Rorik Peterson, and Matej Vela for their help packaging
NCO for Debian over the years.
@@ -915,10 +921,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
<!--
# MacOS 15.2 (Sequoia) systems (firn, sastrugi, spectral):
/usr/bin/scp ~/nco/doc/index.shtml zender,nco at web.sf.net:/home/project-web/nco/htdocs
-cd ~/bin;tar cvzf ${DATA}/nco-5.3.0.macos.15.2.tar.gz nc*;scp ${DATA}/nco-5.3.0.macos.15.2.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-5.3.1.macos.15.2.tar.gz nc*;scp ${DATA}/nco-5.3.1.macos.15.2.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
-->
The most up-to-date executables are probably those in the tarball below. Those unfamiliar with installing executables from tarballs may try the (older) <a href="http://en.wikipedia.org/wiki/Apple_Disk_Image">DMG</a> files (you may need to add <tt>/opt/local/bin</tt> to your executable path to access those operators).
-<li><a href="src/nco-5.3.0.macos.15.2.tar.gz">nco-5.3.0.macos.15.2.tar.gz</a> (<!--#fsize file="src/nco-5.3.0.macos.15.2.tar.gz"-->): Executables MacOS 15.2-compatible (last updated <!--#flastmod file="src/nco-5.3.0.macos.15.2.tar.gz"-->). Maintained by NCO Project.</li>
+<li><a href="src/nco-5.3.1.macos.15.2.tar.gz">nco-5.3.1.macos.15.2.tar.gz</a> (<!--#fsize file="src/nco-5.3.1.macos.15.2.tar.gz"-->): Executables MacOS 15.2-compatible (last updated <!--#flastmod file="src/nco-5.3.1.macos.15.2.tar.gz"-->). Maintained by NCO Project.</li>
<li><a href="http://fink.sf.net">Fink</a> packages for <a href="http://fink.sf.net/pdb/package.php/nco">NCO</a>: Currently NCO 4.9.5. Maintained by Alexander Hansen.</li>
<li><a href="http://brew.sh">Homebrew</a> packages for <a href="https://formulae.brew.sh/formula/nco">NCO</a>: Currently NCO 5.1.5. Install with ‘<tt>brew install nco</tt>’. Maintained by Carlo Cabrera, Ian Lancaster, Alejandro Soto, and others over the years.</li>
<li><a href="http://trac.macosforge.org/projects/macports/wiki">MacPorts</a> infrastructure for <a href="https://ports.macports.org/port/nco">NCO</a>: <a href="https://ports.macports.org/port/nco">Portfile</a>: Currently NCO 5.1.1. Install with ‘<tt>sudo port install nco</tt>’. Maintained by Takeshi Enomoto.</li>
@@ -1121,12 +1127,12 @@ On the <a href="https://sourceforge.net/p/nco/bugs">Bug Tickets</a> site.</li>
The simplest way to acquire the source is to download the compressed tarball:
<ul>
<li>
-<!-- scp ${DATA}/nco-5.3.0.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="https://github.com/nco/nco/archive/5.3.0.tar.gz">nco-5.3.0.tar.gz</a>
-(<!--#fsize file="src/nco-5.3.0.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-5.3.0.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-5.3.0.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha256 src/nco-5.3.0.tar.gz"-->
+<!-- scp ${DATA}/nco-5.3.1.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/5.3.1.tar.gz">nco-5.3.1.tar.gz</a>
+(<!--#fsize file="src/nco-5.3.1.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-5.3.1.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-5.3.1.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha256 src/nco-5.3.1.tar.gz"-->
</li>
</ul>
@@ -1147,8 +1153,8 @@ To avoid the churn that comes with using the latest snapshot,
potential contributors may wish to retrieve a recent tagged (i.e.,
stable and released) version,
This command retrieves the entire NCO repository (< 20 MB) and
-then checks out NCO version <tt>5.3.0</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 5.3.0</tt></p>
+then checks out NCO version <tt>5.3.1</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 5.3.1</tt></p>
However, the most efficient way to actively track and develop NCO is to
retrieve the current (“bleeding edge”) NCO snapshot.
This command retrieves the latest NCO master branch into a local
@@ -1158,12 +1164,12 @@ directory named <tt>nco</tt>:
Track changes to the development version using
<p><tt>cd nco;git pull</tt></p>
One difference between running a "tagged" release
-(e.g., <tt>5.3.0</tt>) and the development version is that the
+(e.g., <tt>5.3.1</tt>) and the development version is that the
tagged release operators will print a valid version number (e.g.,
-<tt>5.3.0</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>5.3.1</tt>) when asked to do so with the <tt>-r</tt> flag
(e.g., <tt>ncks -r</tt>).
Snapshots will include the sub-version and patch-level in the version
-information (e.g., <tt>5.3.0-alpha06</tt>).
+information (e.g., <tt>5.3.1-alpha06</tt>).
<!--
<a name="doxy"></a>
@@ -1346,9 +1352,9 @@ As of 20131101 there is no Cygwin package for ANTLR, and the Cygwin netCDF packa
<li>Once you have installed the pre-requisites as shown above, you may then build the latest stable NCO and install it in, e.g., <tt>/usr/local</tt> with:
<tt>
-<dt>wget https://github.com/nco/nco/archive/5.3.0.tar.gz</dt>
-<dt>tar xvzf 5.3.0.tar.gz</dt>
-<dt>cd nco-5.3.0</dt>
+<dt>wget https://github.com/nco/nco/archive/5.3.1.tar.gz</dt>
+<dt>tar xvzf 5.3.1.tar.gz</dt>
+<dt>cd nco-5.3.1</dt>
<dt>./configure --prefix=/usr/local</dt>
<dt>make</dt>
<dt>sudo make install</dt>
=====================================
doc/nco.texi
=====================================
@@ -128,12 +128,12 @@ Octave TeXInfo manual shows clean TeXInfo structure
@setfilename nco.info
@c Define edition, date, ...
- at set nco-edition 5.3.0
- at set doc-edition 5.3.0
- at set copyright-years 1995--2024
- at set update-year 2024
- at set update-date 23 December 2024
- at set update-month December 2024
+ at set nco-edition 5.3.1
+ at set doc-edition 5.3.1
+ at set copyright-years 1995--2025
+ at set update-year 2025
+ at set update-date 12 January 2025
+ at set update-month January 2025
@settitle @acronym{NCO} @value{nco-edition} User Guide
@@ -4381,16 +4381,43 @@ values instead.
If this feature interests you, please be the squeaky wheel and let us
know.
-String conversions (to @code{NC_CHAR}) work for all attributes, but
-not for variables.
+String conversions (from @code{NC_STRING} to @code{NC_CHAR}) work for
+all attributes, but not for all variables.
This is because attributes are at most one-dimensional and may be of any
size whereas variables require gridded dimensions that usually do not
fit the ragged sizes of text strings.
Hence scalar @code{NC_STRING} attributes are correctly converted to and
stored as @code{NC_CHAR} attributes in the netCDF3 output file, but
- at code{NC_STRING} variables are not correctly converted.
-If this limitation annoys or enrages you, please let us know by being
-the squeaky wheel.
+not all @code{NC_STRING} variables are correctly converted.
+
+As of version 5.3.1 (January, 2025), @acronym{NCO} has two distinct
+levels of support for autoconversion of @code{NC_STRING} variables.
+ at command{ncremap} fully supports autoconversion of scalar
+ at code{NC_STRING} variables in both horizontal regridder and vertical
+interpolation mode.
+This means that @command{ncremap} will produce netCDF3 output files
+from netCDF4 input files (if requested) and that any @code{NC_STRING}
+variables in the input files will be translated to @code{NC_CHAR}
+arrays in the netCDF3 output files.
+There is no loss of information since the entire contents of the
+string is preserved in the character array.
+The autoconversion stores the character array with a new dimension
+named @code{sng_lng_ at var{X}} where @var{X} is the smallest power of
+ten between 10 and 10000 that is capable of containing the string
+contents (including the terminating @code{NUL} character).
+This type of variable autoconversion fails if the input string length
+exceeds 10000 (this is a safety measure, and will be expanded if
+people lobby me).
+
+All operators besides @command{ncremap} currently retain only the
+first character of the input @code{NC_STRING} array.
+This loses information.
+We are working to implement the same feature that @command{ncremap}
+enjoys.
+Both types of autoconversion fail if the input string variable is
+multidimensional, i.e., an array of type @code{NC_STRING}.
+A feature to solve that case would be tractable, though we have not
+yet received any requests for it.
@item
@cindex @code{--fix_rec_dmn all}
@@ -7924,7 +7951,7 @@ These annotations include
@var{ilev_dmn_nm}-dimension will be vertically interpolated to the
specified (with @samp{vrt_out=@var{vrt_fl}}) vertical output grid,
and will all contain the @var{lev_dmn_nm}- and, for
- hybrid-sigma/pressure interface variables,
+ hybrid sigma-pressure interface variables,
@var{ilev_dmn_nm}-dimensions.
To treat different dimensions as the midlayer and interface level
dimensions, use the options @samp{--rgr lev_dmn_nm=@var{lev_dmn_nm}}
@@ -7943,7 +7970,7 @@ These annotations include
@cindex @samp{--rgr plev_nm=@var{plev_nm}}
@item Vertical Coordinate Names: @var{lev}, @var{ilev}, @var{plev}
The name of the vertical coordinate variables that represent
- midpoint levels and interface levels in hybrid-sigma/pressuure
+ midpoint levels and interface levels in hybrid sigma-pressure
input files are @var{lev_nm} and @var{ilev_nm}, and default to
@code{lev} and @code{ilev}, respectively.
While the vertical coordinate in pure-pressure vertical grid files
@@ -7959,17 +7986,17 @@ These annotations include
vertical coordinate output names re-use the ``lev'' options, i.e.,
@samp{--rgr lev_nm_out=@var{lev_nm_out}} option.
Variables that contain a @var{lev_dmn_nm}-dimension or a
- @var{ilev_dmn_nm}-dimension on hybrid-sigma/pressure input grid,
+ @var{ilev_dmn_nm}-dimension on hybrid sigma-pressure input grid,
or a @var{plev_dmn_nm}-dimension on a pure pressure grid,
will be regridded, and output in vertically interpolated files on
- a hybrid-sigma/pressure grid will all contain the @var{lev_nm}-
+ a hybrid sigma-pressure grid will all contain the @var{lev_nm}-
and @var{ilev_nm}-variables, and output on a pure-pressure grid
will contain the @var{lev_nm} coordinate.
Unless the @var{lev_dmn_nm} and @var{ilev_dmn_nm} dimensions
are explicitly configured otherwise, they will share the same
name as the @var{lev_nm}/@var{plev_nm} and
@var{ilev_nm}-variables, respectively.
- Thus variables regridded to a hybrid-sigma/pressure output grid
+ Thus variables regridded to a hybrid sigma-pressure output grid
usually have @var{lev_nm}- and @var{ilev_nm} as coordinate
variables.
Variables regridded to a pure-pressure output grid will only have
@@ -7989,7 +8016,7 @@ These annotations include
@cindex @samp{--rgr ps_nm=@var{ps_nm}}
@item Surface Pressure Names: @var{ps}, @var{PS}
The name of the surface pressure field necessary to reconstruct
- the layer pressures in the hybrid-sigma/pressure coordinate system
+ the layer pressures in the hybrid sigma-pressure coordinate system
is @var{ps_nm} which defaults to @code{PS}.
As of @acronym{NCO} @w{version 5.1.2}, released in November, 2022,
one may change this with the @samp{--rgr ps_nm=@var{ps_nm}} option.
@@ -13309,7 +13336,7 @@ pack, etc.) the following variables:
@code{msk_*}, and
@code{wgt_*}.
These variables represent Gaussian weights, land/sea masks,
-time fields, hybrid pressure coefficients, and latititude/longitude
+time fields, hybrid sigma-pressure coefficients, and latitude/longitude
boundaries.
We call these fields non-coordinate @dfn{grid properties}.
Coordinate grid properties are easy to identify because they are
@@ -14309,7 +14336,8 @@ It is not possible to manually define in Output any dimensions that exist in Inp
@end html
@node Left hand casting, Arrays and hyperslabs, Dimensions, ncap2 netCDF Arithmetic Processor
@subsection Left hand casting
- at cindex hybrid coordinate system
+ at cindex hybrid sigma-pressure coordinate system
+ at cindex hybrid vertical coordinate system
@cindex left hand casting
@cindex @acronym{LHS}
The following examples demonstrate the utility of the
@@ -14352,7 +14380,7 @@ message.
Consider now a slightly more complex example.
In geophysical models, a coordinate system based on
a blend of terrain-following and density-following surfaces is
-called a @dfn{hybrid coordinate system}.
+called a @dfn{hybrid sigma-pressure coordinate system}.
In this coordinate system, four variables must be manipulated to
obtain the pressure of the vertical coordinate:
@var{PO} is the domain-mean surface pressure offset (a scalar),
@@ -14368,7 +14396,7 @@ from the four input variables of mixed rank and orthogonality:
ncap2 -s 'prs_mdp[time,lat,lon,lev]=P0*hyam+PS*hybm' in.nc out.nc
@end example
Manipulating the four fields which define the pressure in a hybrid
-coordinate system is easy with left hand casting.
+sigma-pressure coordinate system is easy with left hand casting.
@html
<a name="pdel"></a> <!-- http://nco.sf.net/nco.html#pdel -->
@@ -14377,9 +14405,9 @@ coordinate system is easy with left hand casting.
Finally, we show how to use interface quantities to define midpoint
quantities.
In particular, we will define interface pressures using the standard
- at acronym{CESM} output hybrid coordinate parameters, and then difference
-those interface pressures to obtain the pressure difference between
-the interfaces.
+ at acronym{CESM} output hybrid sigma-pressure coordinate parameters, and
+then difference those interface pressures to obtain the pressure
+difference between the interfaces.
The pressure difference is necessary obtain gridcell mass path
and density (which are midpoint quantities).
Definitions are as in the above example, with new variables
@@ -19516,7 +19544,7 @@ ncclimo [-3] [-4] [-5] [-6] [-7]
[-f @var{fml_nm}] [--fl_fmt=@var{fl_fmt}] [--glb_avg] [--glb_stt=@var{glb_stt}]
[-h @var{hst_nm}] [-i @var{drc_in}] [-j @var{job_nbr}] [-L @var{dfl_lvl}] [-l @var{lnk_flg}]
[-m @var{mdl_nm}] [--mth_end=@var{mth_end}] [--mth_srt=@var{mth_srt}]
-[-n @var{nco_opt}] [--no_cll_msr] [--no_frm_trm] [--no_ntv_tms] [--no_stg_grd] [--no_stdin]
+[-n @var{nco_opt}] [--npo] [--no_cll_msr] [--no_frm_trm] [--no_ntv_tms] [--no_stg_grd] [--no_stdin]
[-O @var{drc_rgr}] [-o @var{drc_out}] [-P @var{prc_typ}] [-p @var{par_typ}] [--qnt=@var{qnt_prc}]
[-R @var{rgr_opt}] [-r @var{rgr_map}] [-S @var{yr_prv}] [-s @var{yr_srt}]
[--seasons=@var{csn_lst}] [--sgs_frc=@var{sgs_frc}] [--split] [--sum_scl=@var{sum_scl}]
@@ -20128,6 +20156,55 @@ This can cause unexpected results, so use the front-end options to
@command{ncclimo} when possible, rather than attempting to subvert
them with @var{nco_opt}.
+ at html
+<a name="npo"></a> <!-- http://nco.sf.net/nco.html#npo -->
+<a name="nco_path_override"></a> <!-- http://nco.sf.net/nco.html#nco_path_override -->
+ at end html
+ at cindex @code{--npo}
+ at cindex @code{--nco_path_override}
+As of @acronym{NCO} version 5.3.1 (released January, 2025) users at
+select supercomputer centers can access the latest versions of
+ at acronym{NCO} scripts directly from @w{C. Zender's} build
+directories.
+These build directories usually contain the latest @acronym{NCO}
+snapshot, and so may be unstable and are not for everyday use.
+This feature is instead intended to allow users to test and provide
+feedback on new features before they are distributed in a public
+release.
+Invoking @command{ncclimo} and @command{ncremap} with the @code{--npo}
+(or long-option equivalent @code{--nco_path_override}) flag as
+ at emph{the first option} (i.e., as @code{$@{1@}}), causes these scripts
+to utilize the binary @acronym{NCO} executables in Zender's build
+directories on the following machines at the national supercomputer
+centers in parentheses:
+ at code{acme1} (LLNL),
+ at code{andes} (ORNL),
+ at code{chrysalis} (ANL),
+ at code{compy} (PNNL),
+ at code{derecho} (NCAR),
+ at code{frontier} (ORNL), and
+ at code{perlmutter} (NERSC).
+ at example
+
+If the latest features that you want are actually implemented in the
+ at acronym{NCO} binaries or library, then it may suffice to invoke your
+own version of the scripts, as in the first examples below.
+However, if the latest features that you want are implemented in the
+scripts themselves, then you can either invoke Zender's scripts
+directly (as in the second set of examples), or copy those scripts
+into your own executable path:
+ at verbatim
+# Access Zender's latest binaries from your default scripts
+ncremap --npo -m map.nc in.nc out.nc
+ncclimo --npo -P elm -c ${caseid} ...
+# Access Zender's latest binaries from your Zender's latest scripts
+~zender/bin/ncremap --npo -m map.nc in.nc out.nc
+~zender/bin/ncclimo --npo -P elm -c ${caseid} ...
+ at end verbatim
+ at end example
+In both cases, the @code{--npo} flag must be the first option
+invoked.
+
@html
<a name="drc_rgr"></a> <!-- http://nco.sf.net/nco.html#drc_rgr -->
@end html
@@ -21641,7 +21718,7 @@ EXAMPLES
@html
<a name="merra2"></a> <!-- http://nco.sf.net/nco.html#merra2 -->
@end html
-How to create a climo from a collection of monthly
+How does one create a climo from a collection of monthly
non- at acronym{CESM}'ish files?
This is a two-step procedure:
First be sure the names are arranged with a @acronym{YYYYMM}-format date
@@ -26079,11 +26156,12 @@ ncremap [-3] [-4] [-5] [-6] [-7]
[--dt_sng=@var{dt_sng}] [--esmf_typ=@var{esmf_typ}]
[--fl_fmt=@var{fl_fmt}] [-G @var{grd_sng}] [-g @var{grd_dst}]
[-I @var{drc_in}] [-i @var{input-file}] [-j @var{job_nbr}] [-L @var{dfl_lvl}]
-[-M] [-m @var{map_fl}] [--mpi_nbr=@var{mpi_nbr}] [--mpi_pfx=@var{mpi_pfx}] [--mpt_mss] [--msh_fl=@var{msh_fl}]
-[--msk_apl] [--msk_dst=@var{msk_dst}] [--msk_out=@var{msk_out}] [--msk_src=@var{msk_src}] [--mss_val=@var{mss_val}]
-[-n @var{nco_opt}] [--nm_dst=@var{nm_dst}] [--nm_src=@var{nm_src}]
-[--no_add_fll] [--no_cll_msr] [--no_frm_trm] [--no_permute] [--no_stdin] [--no_stg_grd]
-[-O @var{drc_out}] [-o @var{output-file}] [-P @var{prc_typ}] [-p @var{par_typ}]
+[-M] [-m @var{map_fl}] [--mpi_nbr=@var{mpi_nbr}] [--mpi_pfx=@var{mpi_pfx}] [--mpt_mss]
+[--msh_fl=@var{msh_fl}] [--msk_apl] [--msk_dst=@var{msk_dst}]
+[--msk_out=@var{msk_out}] [--msk_src=@var{msk_src}] [--mss_val=@var{mss_val}]
+[-n @var{nco_opt}] [--nm_dst=@var{nm_dst}] [--nm_src=@var{nm_src}] [--npo]
+[--no_add_fll] [--no_cll_msr] [--no_frm_trm] [--no_permute] [--no_stdin]
+[--no_stg_grd] [-O @var{drc_out}] [-o @var{output-file}] [-P @var{prc_typ}] [-p @var{par_typ}]
[--pdq=@var{pdq_opt}] [--qnt=@var{qnt_opt}] [--preserve=@var{prs_stt}] [--ps_nm=@var{ps_nm}]
[-R @var{rgr_opt}] [--rgn_dst] [--rgn_src] [--rnr_thr=@var{rnr_thr}]
[--rrg_bb_wesn=@var{bb_wesn}] [--rrg_dat_glb=@var{dat_glb}] [--rrg_grd_glb=@var{grd_glb}]
@@ -26092,7 +26170,8 @@ ncremap [-3] [-4] [-5] [-6] [-7]
[--skl=@var{skl-file}] [--stdin] [-T @var{drc_tmp}] [-t @var{thr_nbr}]
[-U] [-u @var{unq_sfx}] [--ugrid=@var{ugrid-file}] [--uio]
[-V @var{rgr_var}] [-v @var{var_lst}[, at dots{}]] [--version] [--vrb=@var{vrb_lvl}]
-[--vrt_in=@var{vrt_fl}] [--vrt_out=@var{vrt_fl}] [--vrt_nm=@var{vrt_nm}] [--vrt_ntp=@var{vrt_ntp}] [--vrt_xtr=@var{vrt_xtr}]
+[--vrt_in=@var{vrt_fl}] [--vrt_out=@var{vrt_fl}] [--vrt_nm=@var{vrt_nm}]
+[--vrt_ntp=@var{vrt_ntp}] [--vrt_xtr=@var{vrt_xtr}]
[-W @var{wgt_opt}] [-w @var{wgt_cmd}] [-x @var{xtn_lst}[, at dots{}]] [--xcl_var]
[--xtr_nsp=@var{xtr_nsp}] [--xtr_xpn=@var{xtr_xpn}]
[@var{input-files}] [@var{output-file}]
@@ -26231,11 +26310,11 @@ is supplied with @samp{-m @var{map_fl}}.
Most people ultimately use @command{ncremap} to regrid data, yet not all
data can or should be regridded in the sense of applying a sparse-matrix
-of weights to an input field to produce and output field.
-Certain fields (e.g., the longitude coordinate) specify the grid.
+of weights to an input field to produce an output field.
+Certain fields (e.g., the longitude coordinate) specify the grid itself.
These fields must be provided in order to compute the weights that are
used to regrid.
-The regridded usually copies these fields ``as is'' directly into
+The regridder usually copies these fields ``as is'' directly into
regridded files, where they describe the destination grid, and replace
or supercede the source grid information.
Other fields are extensive grid properties (e.g., the number of cells
@@ -28093,7 +28172,9 @@ and cause the vertical interpolation routine to look for surface
pressure under the name @code{ps} instead of @code{PS}.
The @acronym{MPAS} procedures permute input data dimensions into this
order:
- at code{Time,depth,nVertInterfaces,nVertLevels,nVertLevelsP1,nZBGCTracers,nBioLayersP1,nAlgaeIceLayers,nDisIronIceLayers,nIceLayers,maxEdges,MaxEdges2,nCategories,R3,ONE,TWO,FOUR,nEdges,nCells},
+ at code{Time,depth,nVertInterfaces,nVertLevels,nVertLevelsP1,nZBGCTracers,
+nBioLayersP1,nAlgaeIceLayers,nDisIronIceLayers,nIceLayers,
+maxEdges,MaxEdges2,nCategories,R3,ONE,TWO,FOUR,nEdges,nCells},
and invokes renormalization.
An @acronym{MPAS} dataset that contains any other dimensions will fail
to regrid until/unless those dimensions are added to the
@@ -29183,10 +29264,12 @@ to vertically interpolate the input file to the vertical coordinate
grid contained in the file @var{vrt_fl}.
This option first appeared in @acronym{NCO} @w{version 4.8.0},
released in May, 2019.
-The vertical gridfile @var{vrt_fl} must specify a vertical gridtype
-that @command{ncremap} understands, currently either pure-pressure or
-hybrid-coordinate pressure.
-We plan to add pure-sigma coordinates in the future.
+The vertical gridfile @var{vrt_fl} must specify one of the three
+vertical gridtypes that @command{ncremap} understands: pure-pressure,
+hybrid sigma-pressure, or geometric depth (e.g., for ocean data).
+Note that pure-sigma coordinates are a special case of hybrid
+sigma-pressure coordinates and can always be reformatted to work as
+well.
Besides the vertical grid-type, the main assumptions, constraints, and
priorities for future development of vertical regridding are:
@@ -29241,31 +29324,25 @@ priorities for future development of vertical regridding are:
November 2022 in @acronym{NCO} @w{version 5.1.1}, are:
linear extrapolation (@samp{--vrt_xtr=linear}),
setting @w{to 0.0} (@samp{--vrt_xtr=zero}).
- Linear extrapolation does exactly what you think: Values outside
- the input domain are linearly extrapolated from the nearest two
- values inside the input domain.
- Zero extrapolation sets values outside the extrapoloation domain
+ Linear extrapolation does exactly what it sounds like:
+ Extrapolate values outside the input domain linearly from the
+ nearest two values inside the input domain.
+ Zero extrapolation sets values outside the extrapolation domain
@w{to 0.0}.
Supporting other methods, or improving the existing
special-case approximations for temperature or geopotential,
will remain low priority until we are lobbied with compelling
use-cases for other algorithms.
- at item Missing values may not always be treated correctly
- Eliminating this constraint was not originally a priority
- because atmospheric datasets often contain no missing data.
- However, now that vertical regridding can be applied to ocean
- data with a depth coordinate, we need to verify that using
- missing values to indicate bathymetry works as expected.
- at item Time-varying vertical grids are only allowed for hybrid grids
+ at item Time-varying vertical grids are only allowed for hybrid sigma-pressure grids
(not pure pressure grids), and these must store the time
dimension as a record dimension.
This constraint applies to the vertical grid only, not to the
other fields in the dataset.
Hence this does not preclude interpolating timeseries to/from
time-invariant vertical grids.
- For example, time-varying hybrid grid data such as temperature
- may be interpolated to timeseries on a time-invariant pressure
- grid.
+ For example, time-varying hybrid sigma-pressure grid data such
+ as temperature may be interpolated to timeseries on a
+ time-invariant pressure grid.
Eliminating this constraint will not be a priority unless/until
an important use-case is identified.
@item Variable names for input and output vertical grids must match
@@ -29273,12 +29350,12 @@ priorities for future development of vertical regridding are:
@acronym{NCEP} implementations.
These names include @code{hyai}, @code{hyam}, @code{hybi},
@code{hybm}, @code{ilev}, @code{lev}, @code{P0}, and @code{PS}
- (for @acronym{E3SM/CESM} hybrid grids), @code{lev},
- @code{lev_2}, and @code{lnsp} (for @acronym{ECMWF} hybrid grids
- only), @code{depth}, @code{timeMonthly_avg_zMid} (for
- @acronym{MPAS} depth grids), and @code{plev} and @code{level}
- (for pure-pressure grids with @acronym{NCEP} and @acronym{ERA5}
- conventions, respectively).
+ (for @acronym{E3SM/CESM} hybrid sigma-pressure grids), @code{lev},
+ @code{lev_2}, and @code{lnsp} (for @acronym{ECMWF} hybrid
+ sigma-pressure grids only), @code{depth},
+ @code{timeMonthly_avg_zMid} (for @acronym{MPAS} depth grids),
+ and @code{plev} and @code{level} (for pure-pressure grids with
+ @acronym{NCEP} and @acronym{ERA5} conventions, respectively).
The infrastructure to provide alternate names for any of these
input/output variables names is straightforward, and is heavily
used for horizontal spatial regridding.
@@ -29314,10 +29391,10 @@ e.g., @samp{--plev_nm_in=z}.
<a name="vrt_hyb_mk"></a> <!-- http://nco.sf.net/nco.html#vrt_hyb_mk -->
<a name="vrt_hyb"></a> <!-- http://nco.sf.net/nco.html#vrt_hyb -->
@end html
-Hybrid-coordinate grids are a hybrid between a sigma-coordinate
-grid (where each pressure level is a fixed fraction of a
-spatiotemporally varying surface pressure) and a pure-pressure grid
-that is spatially invariant (as described above).
+Hybrid sigma-pressure coordinate grids are a hybrid between a
+sigma-coordinate grid (where each pressure level is a fixed fraction
+of a spatiotemporally varying surface pressure) and a pure-pressure
+grid that is spatially invariant (as described above).
The so-called hybrid @var{A} and @var{B} coefficients specify the
fractional weight of the pure-pressure and sigma-grids, respectively,
at each level.
@@ -29328,9 +29405,9 @@ at each level.
@cindex @code{hybi}
@cindex @code{hybm}
@cindex @code{formula_terms} attribute
-The hybrid gridfile must specify @var{A} and @var{B} coefficients for
-both layer midpoints and interfaces with these standard
-(as employed by @acronym{CESM} and @acronym{E3SM}) names and
+The hybrid sigma-pressure gridfile must specify @var{A} and @var{B}
+coefficients for both layer midpoints and interfaces with these
+standard (as employed by @acronym{CESM} and @acronym{E3SM}) names and
dimensions: @code{hyai(ilev)}, @code{hybi(ilev)}, @code{hyam(lev)},
and @code{hybm(lev)}.
The reference pressure and surface pressure must be named
@@ -29358,8 +29435,8 @@ ncks -C -v hyai,hyam,hybi,hybm,P0 in_L128.nc vrt_hyb_L128.nc
@end verbatim
@end example
Such files are extremely small and portable, and represent
-all the hybrid files created by the model because the vertical
-grid parameters are time-invariant.
+all the hybrid sigma-pressure files created by the model because the
+vertical grid parameters are time-invariant.
A ``fat'' vertical grid file would also include the time-varying
grid information, i.e., the surface pressure field.
Fat grid-files are also easy to create with @command{ncks}, e.g.,
@@ -29378,9 +29455,10 @@ ncap2 -s 'prs_mdp[time,lat,lon,lev]=P0*hyam+PS*hybm' \
@end verbatim
@end example
-Hybrid-coordinate grids define a pure-sigma or pure-pressure grid when
-either their @var{A} or @var{B} coefficients are zero, respectively.
-For example, the following creates the hybrid-coordinate
+Hybrid sigma-pressure coordinate grids define a pure-sigma or
+pure-pressure grid when either their @var{A} or @var{B} coefficients
+are zero, respectively.
+For example, the following creates the hybrid sigma-pressure coordinate
representation of a pure-pressure grid with midpoints every @w{100 hPa}
from @w{100 hPa} to @w{1000 hPa}:
@example
@@ -29398,8 +29476,8 @@ vertical grids (as opposed to pure pressure grids).
@end html
As of July 2019 and @acronym{NCO} @w{version 4.8.1}, @acronym{NCO}
supports regridding @acronym{ECMWF} datasets in @acronym{IFS} hybrid
-vertical coordinate format to @acronym{CESM}/@acronym{E3SM}-format
-hybrid vertical grids.
+sigma-pressure vertical coordinate format to
+ at acronym{CESM}/@acronym{E3SM}-format hybrid vertical grids.
Unfortunately there was a regression and this functionality was
broken between about 2023--2024 (the workaround is to use older
@acronym{NCO} versions like 4.9.0).
@@ -29559,19 +29637,26 @@ By default @command{ncremap} sets all extrapolated values to the
nearest valid value.
Temperature and geopotential height are exceptions to this rule.
-Temperature variables (those named @code{T} or @code{ta}, anyway) are
-extrapolated upwards towards space using the nearest neighbor
-assumption, and downwards beneath the surface assuming a moist
-adiabatic lapse rate of 6.5 degrees centigrade per 100 millibars.
-Geopotential variables (those named @code{Z3} or @code{zg}, anyway)
-are extrapolated upwards and downwards using the hypsometric equation
+As of version 5.3.1 (January, 2025), temperature variables are assumed
+to be those named @code{T} (@acronym{CESM}, @acronym{E3SM}),
+ at code{t} (as in @acronym{ERA5} raw data), @code{ta} (@acronym{CMIP}),
+or @code{tpt_*},
+anyway) are extrapolated upwards towards space using
+the nearest neighbor assumption, and downwards beneath the surface
+assuming a moist adiabatic lapse rate of @w{6.5 degrees} centigrade
+per @w{100 millibars}.
+As of version 5.3.1 geopotential variables are assumed to be those
+named @code{Z3} (@acronym{CESM}, @acronym{E3SM}), @code{H} (as in
+ at acronym{MERRA2} raw data), @code{zg} (@acronym{CMIP}), or
+ at code{VerticalLayerMidpoint} (@acronym{SCREAM}) are extrapolated
+upwards and downwards using the hypsometric equation
@footnote{@math{Z_2-Z_1=(R_d*T_v/g_0)*ln(p_1/p_2)=(R_d*T_v/g_0)*(ln(p_1)-ln(p_2))}}
@c Z2-Z1=(Rd*Tv/g0)*ln(p1/p2)=(Rd*Tv/g0)*(ln(p1)-ln(p2))}
with constant global mean virtual temperature
- at math{@var{@tpt{}} = 288}K.
-This assumption leads to unrealistic values where @tpt{} differs
+ at math{@var{tpt} = 288}K.
+This assumption leads to unrealistic values where @var{tpt} differs
significantly from the global mean surface temperature.
-Using the local @tpt{} itself would be a much better approximation,
+Using the local @var{tpt} itself would be a much better approximation,
yet would require a time-consuming implementation.
Please let us know if accurate surface geopotential extrapolation in
cold regions is important to you.
@@ -30129,7 +30214,7 @@ whose attributes are to be renamed.
<a name="bug_nc4_rename"></a> <!-- http://nco.sf.net/nco.html#bug_nc4_rename -->
@end html
@cartouche
-Caveat lector: Unforunately from 2007--present (August, 2023) the
+Caveat lector: Unforunately from 2007--present (January, 2025) the
netCDF library (versions 4.0.0--4.9.3) contains bugs or limitations
that sometimes prevent @acronym{NCO} from correctly renaming coordinate
variables, dimensions, and groups in netCDF4 files.
@@ -31328,9 +31413,6 @@ This list links to the full papers and seminars themselves.
<a name="prp_sei"></a> <!-- http://nco.sf.net/nco.html#prp_sei -->
<a name="fnd"></a> <!-- http://nco.sf.net/nco.html#fnd -->
@end html
- at menu
-* Proposals for Institutional Funding::
- at end menu
@node Proposals for Institutional Funding, , Citation, Contributing
@section Proposals for Institutional Funding
=====================================
src/nco/nco.h
=====================================
@@ -380,7 +380,7 @@ extern "C" {
# define NCO_VERSION_MINOR 3
#endif /* !NCO_VERSION_MINOR */
#ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 0
+# define NCO_VERSION_PATCH 1
#endif /* !NCO_VERSION_PATCH */
#ifndef NCO_VERSION_NOTE
# define NCO_VERSION_NOTE "" /* Blank for final versions, non-blank (e.g., "-beta73") for pre-release versions */
@@ -390,7 +390,7 @@ extern "C" {
# define NCO_LIB_VERSION ( NCO_VERSION_MAJOR * 100 + NCO_VERSION_MINOR * 10 + NCO_VERSION_PATCH )
#endif /* !NCO_LIB_VERSION */
#ifndef NCO_VERSION
-# define NCO_VERSION "5.3.0"
+# define NCO_VERSION "5.3.1"
#endif /* !NCO_VERSION */
/* Compatibility tokens new to netCDF4 netcdf.h: */
=====================================
src/nco/nco_msa.c
=====================================
@@ -1373,9 +1373,9 @@ nco_cpy_var_val_mlt_lmt_trv /* [fnc] Copy variable data from input to ou
Too many other limits on string translation to list them all :)
This only handles plain strings */
if(var_out.sz > 1L){
- (void)fprintf(stdout,"%s: ERROR Unable to autoconvert. %s reports string variable %s is an array of %li strings. Autoconversion of string variables is currently limited to scalar string variables (that contain a single string), and does not work on arrays of strings. Even single strings are currently translated incorrectly because each string is typically a distinct size, meaning a distinct phony dimension would need to be created for every single string and NCO is loathe to do that. Instead, NCO curretly translates single strings to a single character (instead of, say, creating a new string dimension of some arbitrary size). Complaints? Suggestions? Let us know.\n",nco_prg_nm_get(),fnc_nm,var_nm,var_out.sz);
+ (void)fprintf(stdout,"%s: ERROR Unable to autoconvert. %s reports string variable %s is an array of %li strings. Autoconversion of string variables is currently limited to scalar string variables (that contain a single string), and does not work on arrays of strings. Even single strings are difficult to translate correctly because each string is typically a distinct size, meaning a distinct dimension would need to be created to store the character array for every single string. Currently, the scripts ncremap and ncclimo handle this by translating strings into character arrays of size 10, 100, 1000, or 10000. The NCO binaries (including this executable) currently keep only the first character of strings. A more complete solution is in the works. Complaints? Suggestions? Let us know.\nHINT: If you do not need variable %s, then consider excluding it from the input file to avoid this autoconversion error with, e.g., ncks -C -x -v %s in.nc out.nc\nc",nco_prg_nm_get(),fnc_nm,var_nm,var_out.sz,var_nm,var_nm);
nco_exit(EXIT_FAILURE);
- } /* endif err */
+ } /* !err */
var_out=var_in;
var_out.sz=strlen(var_out.val.sngp[0]);
=====================================
src/nco/nco_rgr.c
=====================================
@@ -311,9 +311,9 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
rgr->plev_nm_in=NULL; /* [sng] Name of input variable to recognize as pure-pressure coordinate */
rgr->plev_nm_out=NULL; /* [sng] Name of variable to output as vertical coordinate for pure pressure grids */
rgr->plev_nm_tpl=NULL; /* [sng] Name of template variable to recognize as vertical coordinate for pure pressure grids */
- rgr->ps_nm_in=NULL; /* [sng] Name of input variable to recognize as surface pressure for hybrid/sigma pressure grids */
- rgr->ps_nm_out=NULL; /* [sng] Name of variable to output as surface pressure for hybrid/sigma pressure grids */
- rgr->ps_nm_tpl=NULL; /* [sng] Name of template variable to recognize as surface pressure for hybrid/sigma pressure grids */
+ rgr->ps_nm_in=NULL; /* [sng] Name of input variable to recognize as surface pressure for hybrid sigma-pressure grids */
+ rgr->ps_nm_out=NULL; /* [sng] Name of variable to output as surface pressure for hybrid sigma-pressure grids */
+ rgr->ps_nm_tpl=NULL; /* [sng] Name of template variable to recognize as surface pressure for hybrid sigma-pressure grids */
rgr->sgs_frc_nm=NULL; /* [sng] Name of variable sub-gridscale fraction */
rgr->sgs_msk_nm=NULL; /* [sng] Name of variable sub-gridscale mask */
rgr->vrt_nm=NULL; /* [sng] Name of dimension to employ for vertices */
@@ -914,10 +914,10 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
if(!rgr->plev_nm_in) rgr->plev_nm_in=(char *)strdup("plev"); /* [sng] Name of variable to recognize as pure pressure coordinate */
if(!rgr->plev_nm_tpl) rgr->plev_nm_tpl=(char *)strdup("plev"); /* [sng] Name of template variable to recognize as vertical coordinate for pure pressure grids */
if(!rgr->ps_nm_out){
- if(rgr->ps_nm_in) rgr->ps_nm_out=(char *)strdup(rgr->ps_nm_in); else rgr->ps_nm_out=(char *)strdup("PS"); /* [sng] Name of variable to output as surface pressure for hybrid/sigma pressure grids */
+ if(rgr->ps_nm_in) rgr->ps_nm_out=(char *)strdup(rgr->ps_nm_in); else rgr->ps_nm_out=(char *)strdup("PS"); /* [sng] Name of variable to output as surface pressure for hybrid sigma-pressure grids */
} /* !rgr->ps_nm_out */
- if(!rgr->ps_nm_in) rgr->ps_nm_in=(char *)strdup("PS"); /* [sng] Name of input variable to recognize as surface pressure for hybrid/sigma pressure grids */
- if(!rgr->ps_nm_tpl) rgr->ps_nm_tpl=(char *)strdup("PS"); /* [sng] Name of template variable to recognize as surface pressure for hybrid/sigma pressure grids */
+ if(!rgr->ps_nm_in) rgr->ps_nm_in=(char *)strdup("PS"); /* [sng] Name of input variable to recognize as surface pressure for hybrid sigma-pressure grids */
+ if(!rgr->ps_nm_tpl) rgr->ps_nm_tpl=(char *)strdup("PS"); /* [sng] Name of template variable to recognize as surface pressure for hybrid sigma-pressure grids */
/* Derived from defaults and command-line arguments */
// On second thought, do not strdup() these here. This way, NULL means user never specified lon/lat-out names
@@ -946,6 +946,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
char *fl_vrt_in=NULL; /* [sng] Input vertical grid file */
char *fl_pth_lcl=NULL;
+ int fl_in_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Input file format */
int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
int fll_md_old; /* [enm] Old fill mode */
int in_id; /* I [id] Input netCDF file ID */
@@ -977,15 +978,15 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if(SHARE_OPEN) md_open=md_open|NC_SHARE;
rcd+=nco_fl_open(fl_tpl,md_open,&bfr_sz_hnt,&tpl_id);
- /* Formula-terms for hybrid pressure vertical grid on unstructured CAM/EAM horizontal grid:
+ /* Formula-terms for hybrid sigma-pressure vertical grid on unstructured CAM/EAM horizontal grid:
prs_mdp[time,lev,col]=P0*hyam[lev] +PS[time,col]*hybm[lev]
prs_ntf[time,lev,col]=P0*hyai[ilev]+PS[time,col]*hybi[ilev] */
- /* Formula-terms for hybrid pressure vertical grid on unstructured SCREAM/EAMxx horizontal grid:
+ /* Formula-terms for hybrid sigma-pressure vertical grid on unstructured SCREAM/EAMxx horizontal grid:
prs_mdp[time,col,lev]=P0*hyam[lev] +PS[time,col]*hybm[lev]
prs_ntf[time,col,lev]=P0*hyai[ilev]+PS[time,col]*hybi[ilev] */
- /* Formula-terms for hybrid pressure vertical grid on ECMWF RLL horizontal grid:
+ /* Formula-terms for hybrid sigma-pressure vertical grid on ECMWF RLL horizontal grid:
prs_mdp[time,lev,lat,lon]=hyam[lev] +exp(lnsp[time,lat,lon])*hybm[lev]
prs_ntf[time,lev,lat,lon]=hyai[ilev]+exp(lnsp[time,lat,lon])*hybi[ilev] */
@@ -1023,6 +1024,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
nco_bool flg_hrz_mrv_out=True; /* [flg] Horizontal dimension is Most-Rapidly-Varying in output */
nco_bool flg_mlc_out=True; /* [flg] Add maxLevelCell to output 3D depth grids */
nco_bool flg_ps_rtn=False; /* [flg] Retain surface pressure variable in vertical interpolation output */
+ nco_bool flg_dmn_is_fx_tm=False; /* [flg] Current dimension is fixed (not record) temporal dimension */
nco_bool flg_vrt_tm=False; /* [flg] Output depends on time-varying vertical grid */
nco_bool ncr_idx_in=True; /* [flg] Input vertical coordinate increases monotonically in index (not geometric) space */
nco_bool ncr_idx_out=True; /* [flg] Output vertical coordinate increases monotonically in index (not geometric) space */
@@ -1109,7 +1111,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
nco_vrt_grd_out=nco_vrt_grd_dpt; /* SOSE */
flg_grd_out_dpt=True;
}else{ /* !hyai */
- (void)fprintf(stdout,"%s: ERROR %s Unable to locate hybrid-sigma/pressure or pure-pressure vertical grid coordinate information, or depth dimension, in vertical grid file for output data\n",nco_prg_nm_get(),fnc_nm);
+ (void)fprintf(stdout,"%s: ERROR %s Unable to locate hybrid sigma-pressure or pure-pressure vertical grid coordinate information, or depth dimension, in vertical grid file for output data\n",nco_prg_nm_get(),fnc_nm);
(void)fprintf(stdout,"%s: HINT ensure vertical grid coordinate file contains a valid vertical grid coordinate\n",nco_prg_nm_get());
return NCO_ERR;
} /* !hyai */
@@ -1325,12 +1327,17 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
for(rec_idx=0;rec_idx<dmn_nbr_rec;rec_idx++)
if(dmn_ids_out[dmn_idx] == dmn_ids_rec[rec_idx])
break;
- if(rec_idx == dmn_nbr_rec || dmn_nbr_out == 1){
+ /* 20250101: Above loop fails to identify temporal dimensions that are fixed not record dimensions
+ NASA MERRA2 pressure-level timeseries contain PS with fixed time dimension
+ Treat dimensions named "[Tt]ime" as temporal */
+ rcd=nco_inq_dimname(tpl_id,dmn_ids_out[dmn_idx],dmn_nm);
+ if(strcasestr(dmn_nm,"time")) flg_dmn_is_fx_tm=True; else flg_dmn_is_fx_tm=False;
+ if(!flg_dmn_is_fx_tm && (rec_idx == dmn_nbr_rec || dmn_nbr_out == 1)){
/* This PS dimension is not record dimension, or is sole PS dimension */
grd_sz_out*=dmn_cnt_out[dmn_idx];
dmn_hrz_nbr_out++;
- } /* !rec_idx, !dmn_nbr_out */
- if(rec_idx != dmn_nbr_rec && dmn_nbr_out > 1 && dmn_cnt_out[dmn_idx] > 1L){
+ } /* !flg_dmn_is_fx_tm !rec_idx, !dmn_nbr_out */
+ if((flg_dmn_is_fx_tm || rec_idx != dmn_nbr_rec) && dmn_nbr_out > 1 && dmn_cnt_out[dmn_idx] > 1L){
/* Multi-dimensional PS contains this multi-element record dimension, which we assume is time (not space) */
tm_nbr_out=dmn_cnt_out[dmn_idx];
if(tm_nbr_out > 1L) flg_vrt_tm=True;
@@ -1646,8 +1653,8 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
nco_vrt_grd_in=nco_vrt_grd_dpt; /* SOSE */
flg_grd_in_dpt=True;
}else{ /* !hyai */
- (void)fprintf(stdout,"%s: ERROR %s Unable to locate hybrid-sigma/pressure or pure-pressure or depth vertical grid coordinate information in input file\n",nco_prg_nm_get(),fnc_nm);
- (void)fprintf(stdout,"%s: HINT only invoke vertical interpolation on files that contain variables with vertical dimensions, and with known vertical coordinate variable names. The signal variables default to \"hyai\" for hybrid, \"plev\" for pressure, and the signature dimension defaults to \"nVertLevels\" for height/depth. See http://nco.sf.net/nco.html#lev_nm for options to change these names at run-time, e.g., \"--rgr plev_nm=vrt_nm\"\n",nco_prg_nm_get());
+ (void)fprintf(stdout,"%s: ERROR %s Unable to locate hybrid sigma-pressure or pure-pressure or depth vertical grid coordinate information in input file\n",nco_prg_nm_get(),fnc_nm);
+ (void)fprintf(stdout,"%s: HINT only invoke vertical interpolation on files that contain variables with vertical dimensions, and with known vertical coordinate variable names. The signal variables default to \"hyai\" for hybrid sigma-pressure, \"plev\" for pure pressure, and the signature dimension defaults to \"nVertLevels\" for height/depth. See http://nco.sf.net/nco.html#lev_nm for options to change these names at run-time, e.g., \"--rgr plev_nm=vrt_nm\"\n",nco_prg_nm_get());
return NCO_ERR;
} /* !hyai */
if(flg_grd_in_dpt){
@@ -1722,7 +1729,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
/* Assume ECMWF files use "lnsp" for (log) surface pressure, otherwise CAM/EAM style */
if(!strcmp(ps_nm_in,"lnsp")) flg_grd_hyb_ecmwf=True; else flg_grd_hyb_cameam=True;
- /* 20190602: ECMWF hybrid vertical grid parameters and dimensions differ from CAM/EAM:
+ /* 20190602: ECMWF hybrid sigma-pressure vertical grid parameters and dimensions differ from CAM/EAM:
ECMWF defines vertical dimensions "nhym" and "nhyi" specifically for hy[ab][im] and uses "lev" and "lev_2" for all other variables, whereas CAM/EAM uses same dimensions "lev" and "ilev" for all vertical variables including hybrid coefficients
ECMWF provides "hya?" as a constant in Pa and "hyb?" as a dimensionless coefficient of PS, whereas CAM/EAM provides "hya?" and "hyb?" both as dimensionless coefficients of P0 and PS
ECMWF provides "lev" and "lev_2" with midpoint and surface pressure indices (not values), respectively, whereas CAM/EAM provides "lev" and "ilev" coordinate values in hPa
@@ -1748,11 +1755,11 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if((rcd=nco_inq_varid_flg(in_id,ps_nm_in,&ps_id)) == NC_NOERR){ /* NB: Use in_id not vrt_in_id to search for PS in pure-pressure files since the surface pressure field is likely to be in the data file */
/* Output file-creation procedure discriminates between input surface pressure dimensioned as CAM/EAM vs. ECMWF */
flg_grd_hyb_cameam=True;
- if(flg_grd_out_hyb && (ps_id_tpl == NC_MIN_INT)) (void)fprintf(stderr,"%s: INFO %s detects spatially varying surface pressure field %s in pure-pressure input data file. %s will be copied directly from pure-pressure grid input dataset to, and used to construct the pressures of, the output hybrid-coordinate data file, where it will be named %s.\n",nco_prg_nm_get(),fnc_nm,ps_nm_in,ps_nm_in,ps_nm_out);
- if(flg_grd_out_hyb && (ps_id_tpl != NC_MIN_INT)) (void)fprintf(stderr,"%s: INFO %s detects spatially varying surface pressure field in both vertical-grid file as %s, and in pure-pressure input data file as %s. The vertical grid-file takes precedence. %s will be copied directly from vertical-grid file to, and used to construct the pressures of, the output hybrid-coordinate data file, where it will be named %s. %s in input pure-pressure file will be ignored.\n",nco_prg_nm_get(),fnc_nm,ps_nm_tpl,ps_nm_in,ps_nm_tpl,ps_nm_out,ps_nm_in);
+ if(flg_grd_out_hyb && (ps_id_tpl == NC_MIN_INT)) (void)fprintf(stderr,"%s: INFO %s detects spatially varying surface pressure field %s in pure-pressure input data file. %s will be copied directly from pure-pressure grid input dataset to, and used as the reference surface pressure of, the output hybrid sigma-pressure coordinate data file, where it will be named %s.\n",nco_prg_nm_get(),fnc_nm,ps_nm_in,ps_nm_in,ps_nm_out);
+ if(flg_grd_out_hyb && (ps_id_tpl != NC_MIN_INT)) (void)fprintf(stderr,"%s: INFO %s detects spatially varying surface pressure field in both vertical-grid file as %s, and in pure-pressure input data file as %s. The vertical grid-file takes precedence. %s will be copied directly from vertical-grid file to, and used as the reference surface pressure of, the output hybrid sigma-pressure coordinate data file, where it will be named %s. %s in input pure-pressure file will be ignored.\n",nco_prg_nm_get(),fnc_nm,ps_nm_tpl,ps_nm_in,ps_nm_tpl,ps_nm_out,ps_nm_in);
}else{
if(flg_grd_out_hyb && (ps_id_tpl == NC_MIN_INT)){
- (void)fprintf(stderr,"%s: ERROR %s does not find spatially varying surface pressure field %s in pure-pressure input data file or as %s in vertical grid-file for hybrid-pressure output. A surface pressure field must be present in at least one of these files in order to construct the output hybrid-coordinate pressures.\nHINT: Append a valid surface pressure field to the input data file or to the vertical grid-file.\n",nco_prg_nm_get(),fnc_nm,ps_nm_in,ps_nm_tpl);
+ (void)fprintf(stderr,"%s: ERROR %s does not find spatially varying surface pressure field %s in pure-pressure input data file or as %s in vertical grid-file for hybrid sigma-pressure output. A surface pressure field must be present in at least one of these files in order to construct the output hybrid sigma-pressure coordinate pressures.\nHINT: Append a valid surface pressure field to the input data file or to the vertical grid-file.\n",nco_prg_nm_get(),fnc_nm,ps_nm_in,ps_nm_tpl);
nco_exit(EXIT_FAILURE);
} /* !ps_id_tpl */
} /* !ps_id */
@@ -1887,7 +1894,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
} /* flg_grd_in_dpt */
if(flg_grd_in_hyb){
- /* Get input hybrid grid vertical information */
+ /* Get input hybrid sigma-pressure grid vertical information */
rcd=nco_inq_varndims(fl_xtr_id,ps_id,&dmn_nbr_in);
rcd=nco_inq_vardimid(vrt_in_id,hyai_id,&dmn_id_ilev_in);
if(flg_grd_hyb_cameam) rcd=nco_inq_vardimid(vrt_in_id,hyam_id,&dmn_id_lev_in);
@@ -1895,7 +1902,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
rcd=nco_inq_dimlen(vrt_in_id,dmn_id_ilev_in,&ilev_nbr_in);
rcd=nco_inq_dimlen(vrt_in_id,dmn_id_lev_in,&lev_nbr_in);
rcd=nco_inq_dimname(vrt_in_id,dmn_id_ilev_in,dmn_nm);
- /* Copy hybrid coordinate names from dimension names since ilev and lev are 1D coordinates */
+ /* Copy hybrid sigma-pressure coordinate names from dimension names since ilev and lev are 1D coordinates */
//if(ilev_nm_in) ilev_nm_in=(char *)nco_free(ilev_nm_in); // 20221204: Causes double free() in nco_rgr_free()
ilev_nm_in=strdup(dmn_nm); // 20221204: Never free()'d
rcd=nco_inq_dimname(vrt_in_id,dmn_id_lev_in,dmn_nm);
@@ -1914,7 +1921,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
rcd=nco_inq_dimid_flg(in_id,ilev_nm_in,&dmn_id_ilev_in);
rcd=nco_inq_dimid_flg(in_id,lev_nm_in,&dmn_id_lev_in);
if(dmn_id_ilev_in == NC_MIN_INT && dmn_id_lev_in == NC_MIN_INT){
- (void)fprintf(stderr,"%s: ERROR %s (aka \"the regridder\") unable to find at least one hybrid vertical dimension (searched for %s and %s) in input data file. Possible that external vertical grid file uses different dimension names than input data file.\n",nco_prg_nm_get(),fnc_nm,ilev_nm_in,lev_nm_in);
+ (void)fprintf(stderr,"%s: ERROR %s (aka \"the regridder\") unable to find at least one hybrid sigma-pressure vertical dimension (searched for %s and %s) in input data file. Possible that external vertical grid file uses different dimension names than input data file.\n",nco_prg_nm_get(),fnc_nm,ilev_nm_in,lev_nm_in);
nco_exit(EXIT_FAILURE);
} /* !dmn_id_ilev_in */
} /* !vrt_in_id */
@@ -2294,7 +2301,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
rcd=nco_get_var(vrt_in_id,lev_id,lev_in,crd_typ_out);
} /* !flg_grd_in_prs */
- /* Always obtain surface pressure if input or output grid is hybrid */
+ /* Always obtain surface pressure if input or output grid is hybrid sigma-pressure */
if(flg_grd_in_hyb || flg_grd_out_hyb){
/* Copy horizontal grid information from input file
@@ -2302,7 +2309,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if(ps_id_tpl == NC_MIN_INT){
/* NB: dmn_nbr_in/out in this block refer only to horizontal dimensions necessary to define PS */
- rcd=nco_inq_varndims(fl_xtr_id,ps_id,&dmn_nbr_in); /* This is harmlessly repeated for hybrid input files */
+ rcd=nco_inq_varndims(fl_xtr_id,ps_id,&dmn_nbr_in); /* This is harmlessly repeated for hybrid sigma-pressure input files */
dmn_ids_in=(int *)nco_malloc(dmn_nbr_in*sizeof(int));
dmn_cnt_in=(long *)nco_malloc((dmn_nbr_in+1)*sizeof(long));
if(!dmn_srt) dmn_srt=(long *)nco_malloc((dmn_nbr_in+1)*sizeof(long)); /* NB: Allocate dmn_srt only once */
@@ -2318,18 +2325,23 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
for(rec_idx=0;rec_idx<dmn_nbr_rec;rec_idx++)
if(dmn_ids_in[dmn_idx] == dmn_ids_rec[rec_idx])
break;
- if(rec_idx == dmn_nbr_rec || dmn_nbr_in == 1){
- /* This PS dimension is not record dimension, or is sole PS dimension */
+ /* 20250101: Above loop fails to identify temporal dimensions that are fixed not record dimensions
+ NASA MERRA2 pressure-level timeseries contain PS with fixed time dimension
+ Treat dimensions named "[Tt]ime" as temporal */
+ rcd=nco_inq_dimname(fl_xtr_id,dmn_ids_in[dmn_idx],dmn_nm);
+ if(strcasestr(dmn_nm,"time")) flg_dmn_is_fx_tm=True; else flg_dmn_is_fx_tm=False;
+ if(!flg_dmn_is_fx_tm && (rec_idx == dmn_nbr_rec || dmn_nbr_in == 1)){
+ /* This PS dimension is not fixed "time" dimension, and is not record dimension or is sole PS dimension */
grd_sz_in*=dmn_cnt_in[dmn_idx];
dmn_hrz_nbr_in++;
- } /* !rec_idx, !dmn_nbr_in */
- if(rec_idx != dmn_nbr_rec && dmn_nbr_in > 1 && dmn_cnt_in[dmn_idx] > 1L){
+ } /* !flg_dmn_is_fx_tm !rec_idx, !dmn_nbr_in */
+ if((flg_dmn_is_fx_tm || rec_idx != dmn_nbr_rec) && dmn_nbr_in > 1 && dmn_cnt_in[dmn_idx] > 1L){
/* Multi-dimensional PS contains this multi-element record dimension, which we assume is time (not space) */
dmn_id_tm_in=dmn_ids_in[dmn_idx];
dmn_idx_tm_in=dmn_idx;
tm_nbr_in=dmn_cnt_in[dmn_idx_tm_in];
if(tm_nbr_in > 1L) flg_vrt_tm=True;
- } /* !rec_idx, !dmn_nbr_out, !dmn_cnt_out */
+ } /* !flg_dmn_is_fx_tm !rec_idx !dmn_nbr_out !dmn_cnt_out */
dmn_srt[dmn_idx]=0L;
} /* !dmn_idx */
@@ -2348,7 +2360,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
We have already defined grd_sz_out if PS is in template file
We have already defined grd_sz_in and grd_sz_out := grd_sz_in when PS not in template file
We have already defined grd_sz_in if input file is pure-pressure
- However, we have not yet defined grd_sz_in if input file is hybrid
+ However, we have not yet defined grd_sz_in if input file is hybrid sigma-pressure
Expectation is that grd_sz_in (from input file) = grd_sz_out (from template file)
An independent check on this would examine dimension sizes in input file
Such a check would immediately flag horizontal mismatches between vertical file and input file
@@ -2361,8 +2373,8 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
/* Timestep sequencing
NB: tm_nbr_??? variables count timesteps in vertical grid definitions
These are not necessarily the same as the number of timesteps in either file
- Time-invariant hybrid or pure-pressure coordinates are valid vertical grids for timeseries
- Usually hybrid grids have as many timesteps in the grids as in the timeseries
+ Time-invariant hybrid sigma-pressure or pure-pressure coordinates are valid vertical grids for timeseries
+ Usually hybrid sigma-pressure grids have as many timesteps in the grids as in the timeseries
Usually pressure grids are time-invariant (time-varying pure pressure grids have never been supported)
20240326:
ERA5 time-invariant pure pressure grid input file with timeseries variables
@@ -2381,7 +2393,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
ps_in=(double *)nco_malloc_dbg(tm_nbr_in*grd_sz_in*nco_typ_lng(var_typ_rgr),fnc_nm,"Unable to malloc() ps_in value buffer");
- /* Surface pressure comes from either hybrid vertical grid-files, hybrid data files, or pressure data files that provide surface pressure */
+ /* Surface pressure comes from either hybrid sigma-pressure vertical grid-files, hybrid sigma-pressure data files, or pressure data files that provide surface pressure */
if(flg_grd_in_hyb || (flg_grd_in_prs && ps_id_tpl == NC_MIN_INT)) rcd=nco_get_var(fl_xtr_id,ps_id,ps_in,crd_typ_out);
/* ECMWF distributes IFS forecasts with lnsp = log(surface pressure) */
@@ -2524,7 +2536,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
for(size_t idx_out=0;idx_out<tm_hrz_sz;idx_out++) prs_min_out[idx_out]=lev_out_min;
} /* !flg_grd_out_dpt_1D */
if(flg_grd_in_hyb){
- /* Does input hybrid coordinate increase or decrease in index (not geometric) space?
+ /* Does input hybrid sigma-pressure coordinate increase or decrease in index (not geometric) space?
CAM/EAM vertical coordinate increases in index space since model top is at level zero
(CAM/EAM vertical coordinate decreases in geometric space since pressure decreases with height) */
prs_max_in[0]=p0_in*hyam_in[0]+ps_in[0]*hybm_in[0];
@@ -2546,7 +2558,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
} /* !tm_idx */
} /* !flg_grd_in_hyb */
if(flg_grd_out_hyb){
- /* Does output hybrid coordinate increase or decrease in index (not geometric) space?
+ /* Does output hybrid sigma-pressure coordinate increase or decrease in index (not geometric) space?
Modify procedure for input coordinate to allow single-level output */
ncr_idx_out=True;
if(lev_nbr_out > 1){
@@ -2612,7 +2624,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if(plev_nm_in) plev_nm_out=(char *)strdup(plev_nm_in); else plev_nm_out=(char *)strdup("plev");
} /* !rgr->plev_nm_out */
lev_nm_out=(char *)strdup(plev_nm_out);
- /* Hybrid-sigma/pressure interface variables, if any, must also be output to pure-pressure files on lev grid */
+ /* Hybrid sigma-pressure interface variables, if any, must also be output to pure-pressure files on lev grid */
ilev_nm_out=(char *)strdup(plev_nm_out);
} /* !flg_grd_out_prs */
@@ -2800,8 +2812,11 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
int var_id_out; /* [id] Variable ID */
nc_type var_typ_out; /* [enm] Variable type to write to disk */
nco_bool PCK_ATT_CPY=True; /* [flg] Copy attributes "scale_factor", "add_offset" */
+ nco_bool flg_autoconvert=False; /* [flg] May need to demote netCDF4 atomic types */
+ rcd=nco_inq_format(in_id,&fl_in_fmt);
fl_out_fmt=rgr->fl_out_fmt;
+ if(fl_in_fmt == NC_FORMAT_NETCDF4 && fl_out_fmt != NC_FORMAT_NETCDF4) flg_autoconvert=True;
/* Define new coordinates and grid variables in regridded file */
const int dmn_nbr_0D=0; /* [nbr] Rank of 0-D grid variables (scalars) */
@@ -2952,7 +2967,7 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if(!var_rgr_nbr){
(void)fprintf(stdout,"%s: INFO %s reports no variables fit vertical interpolation criteria.",nco_prg_nm_get(),fnc_nm);
if(var_cpy_nbr) (void)fprintf(stdout," The output file will consist of %d geophysical variables that are copied directly from the input (because they lack the vertical coordinate necessary for interpolation), and all grid variables and metadata necessary to describe the destination grid.\n",var_cpy_nbr); else (void)fprintf(stdout," The output file will consist solely of the grid variables and metadata necessary to describe the destination grid.\n");
- (void)fprintf(stdout,"%s: HINT If the name(s) of the input vertical grid dimensions (e.g., ilev and lev) do not match NCO's preset defaults (case-insensitive unambiguous forms and abbreviations of \"ilev\", \"lev\", and/or \"plev\", respectively) then change the dimension names that NCO looks for. Instructions are at http://nco.sf.net/nco.html#regrid. For hybrid-pressure coordinate grids, ensure that the \"ilev\" and \"lev\" variable names are known with, e.g., \"ncks --rgr ilev_nm=interface_level --rgr lev_nm=midpoint_level\" or \"ncremap -R '--rgr ilev=interface_level --rgr lev=midpoint_level'\". For pure pressure grids, ensure the \"plev\" coordinate name is defined with, e.g., \"ncks --rgr plev_nm=pressure_level\" or \"ncremap -R '--rgr plev=pressure_level'\".\n",nco_prg_nm_get());
+ (void)fprintf(stdout,"%s: HINT If the name(s) of the input vertical grid dimensions (e.g., ilev and lev) do not match NCO's preset defaults (case-insensitive unambiguous forms and abbreviations of \"ilev\", \"lev\", and/or \"plev\", respectively) then change the dimension names that NCO looks for. Instructions are at http://nco.sf.net/nco.html#regrid. For hybrid sigma-pressure coordinate grids, ensure that the \"ilev\" and \"lev\" variable names are known with, e.g., \"ncks --rgr ilev_nm=interface_level --rgr lev_nm=midpoint_level\" or \"ncremap -R '--rgr ilev=interface_level --rgr lev=midpoint_level'\". For pure pressure grids, ensure the \"plev\" coordinate name is defined with, e.g., \"ncks --rgr plev_nm=pressure_level\" or \"ncremap -R '--rgr plev=pressure_level'\".\n",nco_prg_nm_get());
} /* !var_rgr_nbr */
if(nco_dbg_lvl_get() >= nco_dbg_fl){
for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
@@ -3102,6 +3117,27 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt_out[dmn_idx],dmn_id_out+dmn_idx);
} /* !rcd */
} /* !dmn_idx */
+ if(flg_autoconvert && var_typ_out == NC_STRING && dmn_nbr_in == 0){
+ char dmn_nm_sng[14];
+ char *var_in_sng_val; /* [sng] Scalar string variable */
+ double sng_sz_log10; /* [nbr] Log10 of scalar string length */
+ int dmn_sz_chr; /* [nbr] Length of character array to hold string + NUL */
+ size_t sng_sz; /* [nbr] Length of scalar string variable */
+ /* Determine and define sufficiently-sized dimension for NC_CHAR output */
+ rcd=nco_get_var(in_id,var_id_in,&var_in_sng_val,var_typ_out);
+ sng_sz=strlen(var_in_sng_val);
+ assert(sng_sz < 10000);
+ sng_sz_log10=(int)log10(sng_sz)+1;
+ dmn_sz_chr=(int)pow(10.0,sng_sz_log10);
+ dmn_nm_sng[0]='\0';
+ (void)sprintf(dmn_nm_sng,"sng_lng_%d",dmn_sz_chr);
+ rcd=nco_inq_dimid_flg(out_id,dmn_nm_sng,dmn_id_out);
+ if(rcd != NC_NOERR) rcd=nco_def_dim(out_id,dmn_nm_sng,dmn_sz_chr,dmn_id_out);
+ /* Input NC_STRING is scalar so output NC_CHAR is 1-D */
+ dmn_nbr_out++;
+ var_typ_out=NC_CHAR;
+ if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s (aka \"the regridder\") will autoconvert scalar NC_STRING to 1-D NC_CHAR for variable \"%s\": val = %s, sng_sz = %ld, dmn_nm = %s\n",nco_prg_nm_get(),fnc_nm,var_nm,var_in_sng_val,sng_sz,dmn_nm_sng);
+ } /* !flg_autoconvert */
} /* !flg_rgr */
rcd=nco_def_var(out_id,var_nm,var_typ_out,dmn_nbr_out,dmn_id_out,&var_id_out);
/* Duplicate netCDF4 compression settings when possible */
@@ -3381,15 +3417,15 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
# endif /* 900 */
#endif /* !__GNUC__ */
#if defined( __INTEL_COMPILER)
-# pragma omp parallel for default(none) firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,fnc_nm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
+# pragma omp parallel for default(none) firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_autoconvert,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,fnc_nm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
#else /* !__INTEL_COMPILER */
# ifdef GXX_OLD_OPENMP_SHARED_TREATMENT
-# pragma omp parallel for default(none) firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,fnc_nm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
+# pragma omp parallel for default(none) firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_autoconvert,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,fnc_nm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
# else /* !old g++ */
# if defined(GXX_WITH_OPENMP5_GPU_SUPPORT) && 0
# pragma omp target teams distribute parallel for
# else
-# pragma omp parallel for firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
+# pragma omp parallel for firstprivate(has_ilev,has_lev,has_tm,var_val_dbl_in,var_val_dbl_out) private(dmn_cnt_in,dmn_cnt_out,dmn_id_in,dmn_id_out,dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dmn_nm,dmn_srt,grd_idx,has_mss_val,idx_fst_in,idx_fst_out,idx_in,idx_out,idx_tbl,in_id,lrv_idx,lrv_nbr,lvl_idx_in,lvl_idx_out,lvl_nbr_in,lvl_nbr_out,mrv_nbr_in,mrv_nbr_out,mss_val_cmp_dbl,mss_val_dbl,ncr_idx_in,ncr_idx_out,prs_ntp_in,prs_ntp_out,rcd,thr_idx,trv,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr) shared(dmn_id_ilev_in,dmn_id_ilev_out,dmn_id_lev_in,dmn_id_lev_out,dmn_id_tm_in,flg_autoconvert,flg_hrz_mrv,flg_ntp_log,flg_vrt_tm,grd_nbr,idx_dbg,ilev_nbr_in,ilev_nbr_out,lev_nbr_in,lev_nbr_out,out_id,mlc_in,mlc_out,prs_mdp_in,prs_mdp_out,prs_ntf_in,prs_ntf_out,tm_idx,xtr_mth)
# endif /* !GCC > 9.0 */
# endif /* !GCC < 4.9 */
#endif /* !__INTEL_COMPILER */
@@ -3403,17 +3439,19 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
#endif /* !_OPENMP */
if(trv.nco_typ == nco_obj_typ_var && trv.flg_xtr){
if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(fp_stdout,"%s%s ",trv.flg_rgr ? "#" : "~",trv.nm);
+ /* Get var_id_in and var_id_out for both regridded and non-regridded variables
+ Use var_typ_out and dmn_nbr_in to determine whether non-regridded variables should be autoconverted */
+ var_nm=trv.nm;
+ var_typ_out=trv.var_typ; /* NB: Output type in file is same as input type */
+ rcd=nco_inq_varid(in_id,var_nm,&var_id_in);
+ rcd=nco_inq_varid(out_id,var_nm,&var_id_out);
+ rcd=nco_inq_varndims(in_id,var_id_in,&dmn_nbr_in);
if(trv.flg_rgr){
/* Interpolate variable */
- var_nm=trv.nm;
if(!strcmp(var_nm,"US") || !strcmp(var_nm,"VS")) (void)fprintf(fp_stdout,"%s: WARNING %s reports attempt to vertically interpolate a variable named \"%s\". If this variable is from a CESM CAM or E3SM EAM output or initial condition file on a rectangular grid (e.g., FV 0.9x1.25), then expect this program to fail and dump core when interpolating US and to produce slightly incorrect answers for VS. The vertical interpolation routine requires that interpolated variables be on the same horizontal grid as the supplied pressure field. However, the CAM/EAM US and VS variables from rectangular grid simulations are often on a horizontal grid, called the staggered grid, that is offset from the rest of the variables including the surface pressure. US usually sits on a grid that is staggered in latitude from, and is a slightly different size than, the surface pressure grid. This leads to a core dump. VS sits on a grid staggered in longitude from, though the same size as, the surface pressure field. The resulting interpolation will be based on surface pressure half a gridcell to the east rather than centered with VS. The correct procedure to vertically interpolate US and VS is to 1) horizontally regrid the supplied surface pressure (often \"PS\") to the staggered grid, then 2) vertically interpolate US and VS to the desired vertical grid based on the surface pressure on the staggered grid, then 3) re-combine the interpolated US and VS with the interpolated versions of the rest of the variables. The best solution to this dilemma is to script this workflow. Contact Charlie if you need help with this.\n",nco_prg_nm_get(),fnc_nm,var_nm);
var_typ_rgr=NC_DOUBLE; /* NB: Perform regridding in double precision */
- var_typ_out=trv.var_typ; /* NB: Output type in file is same as input type */
var_sz_in=1L;
var_sz_out=1L;
- rcd=nco_inq_varid(in_id,var_nm,&var_id_in);
- rcd=nco_inq_varid(out_id,var_nm,&var_id_out);
- rcd=nco_inq_varndims(in_id,var_id_in,&dmn_nbr_in);
rcd=nco_inq_varndims(out_id,var_id_out,&dmn_nbr_out);
dmn_nbr_max= dmn_nbr_in > dmn_nbr_out ? dmn_nbr_in : dmn_nbr_out;
dmn_id_in=(int *)nco_malloc(dmn_nbr_in*sizeof(int));
@@ -3510,13 +3548,15 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
/* Special-case extrapolation methods allowed for all except missing-value extrapolation types */
if(xtr_mth != nco_xtr_fll_msv){
/* 2019: CAM/EAM use T and CMIP uses ta for temperature profiles
- 2019: CAM/EAM use Z3 and CMIP uses zg for geopotential height profiles
+ 2019: CAM/EAM use Z3, and CMIP uses zg for geopotential height profiles
20221012: CSZ uses tpt for temperature profiles
20221031: SCREAM uses T_mid for temperature profiles, VerticalLayerMidpoint for geopotential height profiles
- Assume all variables whose names are "T", "T_mid", or "ta", or start with "tpt" are temperature variables
+ 20250102: MERRA2 uses T for temperature profiles, H for geopotential height profiles
+ 20250102: ERA5 uses t for temperature profiles, and does not generally store geopotential height profiles
+ Assume all regridded variables whose names are "T", "t", "T_mid", or "ta", or start with "tpt" are temperature variables
Use the global lapse rate method to extrapolate them beyond the input domain */
- if(!strcmp(var_nm,"T") || !strcmp(var_nm,"T_mid") || !strcmp(var_nm,"ta") || (strstr(var_nm,"tpt") == var_nm)) xtr_RHS.typ_fll=nco_xtr_fll_tpt;
- else if(!strcmp(var_nm,"Z3") || !strcmp(var_nm,"VerticalLayerMidpoint") || !strcmp(var_nm,"zg")) xtr_LHS.typ_fll=xtr_RHS.typ_fll=nco_xtr_fll_gph;
+ if(!strcasecmp(var_nm,"T") || !strcmp(var_nm,"T_mid") || !strcmp(var_nm,"ta") || (strstr(var_nm,"tpt") == var_nm)) xtr_RHS.typ_fll=nco_xtr_fll_tpt;
+ else if(!strcmp(var_nm,"Z3") || !strcmp(var_nm,"H") || !strcmp(var_nm,"VerticalLayerMidpoint") || !strcmp(var_nm,"zg")) xtr_LHS.typ_fll=xtr_RHS.typ_fll=nco_xtr_fll_gph;
} /* !xtr_mth */
crd_in=(double *)nco_malloc(lvl_nbr_in*sizeof(double));
crd_out=(double *)nco_malloc(lvl_nbr_out*sizeof(double));
@@ -3834,7 +3874,19 @@ nco_ntp_vrt /* [fnc] Interpolate vertically */
if(tm_idx == 0){
#pragma omp critical
{ /* begin OpenMP critical */
- (void)nco_cpy_var_val(in_id,out_id,(FILE *)NULL,(md5_sct *)NULL,trv.nm,trv_tbl);
+ if(flg_autoconvert && var_typ_out == NC_STRING && dmn_nbr_in == 0){
+ char *var_in_sng_val; /* [sng] Scalar string input variable */
+ char *var_out_chr_val; /* [sng] Scalar string output variable */
+ size_t sng_sz; /* [nbr] Length of scalar string variable */
+ rcd=nco_get_var(in_id,var_id_in,&var_in_sng_val,var_typ_out);
+ sng_sz=strlen(var_in_sng_val);
+ var_out_chr_val=(char *)nco_calloc(pow(10.0,(int)log10(sng_sz)+1.0),sizeof(char));
+ (void)strcat(var_out_chr_val,var_in_sng_val);
+ rcd=nco_put_var(out_id,var_id_out,(void *)var_out_chr_val,NC_CHAR);
+ if(var_out_chr_val) var_out_chr_val=(char *)nco_free(var_out_chr_val);
+ }else{
+ (void)nco_cpy_var_val(in_id,out_id,(FILE *)NULL,(md5_sct *)NULL,trv.nm,trv_tbl);
+ } /* !flg_autoconvert */
} /* end OpenMP critical */
} /* !tm_idx */
} /* !flg_rgr */
@@ -3972,6 +4024,7 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
double lat_wgt_ttl=0.0; /* [frc] Actual sum of quadrature weights */
double area_out_ttl=0.0; /* [frc] Exact sum of area */
+ int fl_in_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Input file format */
int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
int fll_md_old; /* [enm] Old fill mode */
int in_id; /* I [id] Input netCDF file ID */
@@ -5771,8 +5824,11 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
nc_type var_typ_out; /* [enm] Variable type to write to disk */
nc_type var_typ_rgr; /* [enm] Variable type used during regridding */
nco_bool PCK_ATT_CPY=True; /* [flg] Copy attributes "scale_factor", "add_offset" */
+ nco_bool flg_autoconvert=False; /* [flg] May need to demote netCDF4 atomic types */
+ rcd=nco_inq_format(in_id,&fl_in_fmt);
fl_out_fmt=rgr->fl_out_fmt;
+ if(fl_in_fmt == NC_FORMAT_NETCDF4 && fl_out_fmt != NC_FORMAT_NETCDF4) flg_autoconvert=True;
/* Define new coordinates and grid variables in regridded file */
if(flg_grd_out_1D){
@@ -6082,6 +6138,27 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt[dmn_idx],dmn_id_out+dmn_idx);
} /* !rcd */
} /* !dmn_idx */
+ if(flg_autoconvert && var_typ_out == NC_STRING && dmn_nbr_in == 0){
+ char dmn_nm_sng[14];
+ char *var_in_sng_val; /* [sng] Scalar string variable */
+ double sng_sz_log10; /* [nbr] Log10 of scalar string length */
+ int dmn_sz_chr; /* [nbr] Length of character array to hold string + NUL */
+ size_t sng_sz; /* [nbr] Length of scalar string variable */
+ /* Determine and define sufficiently-sized dimension for NC_CHAR output */
+ rcd=nco_get_var(in_id,var_id_in,&var_in_sng_val,var_typ_out);
+ sng_sz=strlen(var_in_sng_val);
+ assert(sng_sz < 10000);
+ sng_sz_log10=(int)log10(sng_sz)+1;
+ dmn_sz_chr=(int)pow(10.0,sng_sz_log10);
+ dmn_nm_sng[0]='\0';
+ (void)sprintf(dmn_nm_sng,"sng_lng_%d",dmn_sz_chr);
+ rcd=nco_inq_dimid_flg(out_id,dmn_nm_sng,dmn_id_out);
+ if(rcd != NC_NOERR) rcd=nco_def_dim(out_id,dmn_nm_sng,dmn_sz_chr,dmn_id_out);
+ /* Input NC_STRING is scalar so output NC_CHAR is 1-D */
+ dmn_nbr_out++;
+ var_typ_out=NC_CHAR;
+ if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s (aka \"the regridder\") will autoconvert scalar NC_STRING to 1-D NC_CHAR for variable \"%s\": val = %s, sng_sz = %ld, dmn_nm = %s\n",nco_prg_nm_get(),fnc_nm,var_nm,var_in_sng_val,sng_sz,dmn_nm_sng);
+ } /* !flg_autoconvert */
} /* !flg_rgr */
rcd=nco_def_var(out_id,var_nm,var_typ_out,dmn_nbr_out,dmn_id_out,&var_id_out);
/* Duplicate netCDF4 compression settings when possible */
@@ -6589,27 +6666,27 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
#endif /* !__GNUG__ */
#if defined( __clang__ ) && !defined(NCO_OPENMP_DEFINED)
/* OpenMP clause to build NCO with Clang compilers */
-# pragma omp parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw,wgt_vld_thr)
+# pragma omp parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_autoconvert,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw,wgt_vld_thr)
# define NCO_OPENMP_DEFINED
#endif /* !__clang__ */
#if defined( __INTEL_COMPILER ) && !defined(NCO_OPENMP_DEFINED)
/* OpenMP clause to build NCO with Intel compilers */
-# pragma omp parallel for default(none) firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw,wgt_vld_thr)
+# pragma omp parallel for default(none) firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_autoconvert,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw,wgt_vld_thr)
# define NCO_OPENMP_DEFINED
#endif /* !__INTEL_COMPILER */
#if defined(GCC_LIB_VERSION) && (GCC_LIB_VERSION < 490) && !defined(NCO_OPENMP_DEFINED)
/* Old OpenMP clause to build NCO with GCC compiler versions < 4.9.0 */
-# pragma omp parallel for default(none) firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
+# pragma omp parallel for default(none) firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_autoconvert,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,fnc_nm,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
# define NCO_OPENMP_DEFINED
#endif /* !GCC < 490 */
#if defined(GCC_LIB_VERSION) && (GCC_LIB_VERSION >= 900) && !defined(NCO_OPENMP_DEFINED) && 0
/* Experimental OpenMP clause to build NCO with modern OpenMP5 GPU options */
-# pragma omp target teams distribute parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
+# pragma omp target teams distribute parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_autoconvert,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,flg_rnr,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
# define NCO_OPENMP_DEFINED
#endif /* !GCC with experimental GPU_SUPPORT */
#if defined(GCC_LIB_VERSION) && (GCC_LIB_VERSION >= 490) && !defined(NCO_OPENMP_DEFINED)
/* Standard OpenMP clause to build NCO on modern GCC versions >= 4.9.0 */
-# pragma omp parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
+# pragma omp parallel for firstprivate(caas_tally,caas_wgt_vld_out,dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_cmp_dbl,mss_val_dbl,nllnk_idx,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(caas_sgs_frc_in,caas_sgs_frc_out,col_src_adr,dmn_nbr_hrz_crd,flg_add_fll,flg_autoconvert,flg_frc_nrm,flg_mpt_mss,flg_msk_apl,flg_msk_out,frc_out,lnk_nbr,msk_out,nlcol_src_adr,nllnk_nbr,nlrow_dst_adr,nlwgt_raw,out_id,row_dst_adr,sgs_frc_nm,sgs_frc_in,sgs_frc_out,sgs_msk_nm,wgt_raw)
# define NCO_OPENMP_DEFINED
#endif /* !GCC >= 490 */
for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
@@ -6622,16 +6699,18 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
#endif /* !_OPENMP */
if(trv.nco_typ == nco_obj_typ_var && trv.flg_xtr){
if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(fp_stdout,"%s%s ",trv.flg_rgr ? "#" : "~",trv.nm);
+ /* Get var_id_in and var_id_out for both regridded and non-regridded variables
+ Use var_typ_out and dmn_nbr_in to determine whether non-regridded variables should be autoconverted */
+ var_nm=trv.nm;
+ var_typ_out=trv.var_typ; /* NB: Output type in file is same as input type */
+ rcd=nco_inq_varid(in_id,var_nm,&var_id_in);
+ rcd=nco_inq_varid(out_id,var_nm,&var_id_out);
+ rcd=nco_inq_varndims(in_id,var_id_in,&dmn_nbr_in);
if(trv.flg_rgr){
/* Regrid variable */
- var_nm=trv.nm;
var_typ_rgr=NC_DOUBLE; /* NB: Perform regridding in double precision */
- var_typ_out=trv.var_typ; /* NB: Output type in file is same as input type */
var_sz_in=1L;
var_sz_out=1L;
- rcd=nco_inq_varid(in_id,var_nm,&var_id_in);
- rcd=nco_inq_varid(out_id,var_nm,&var_id_out);
- rcd=nco_inq_varndims(in_id,var_id_in,&dmn_nbr_in);
rcd=nco_inq_varndims(out_id,var_id_out,&dmn_nbr_out);
dmn_nbr_max= dmn_nbr_in > dmn_nbr_out ? dmn_nbr_in : dmn_nbr_out;
dmn_id_in=(int *)nco_malloc(dmn_nbr_in*sizeof(int));
@@ -7209,7 +7288,19 @@ nco_rgr_wgt /* [fnc] Regrid with external weights */
/* Use standard NCO copy routine for variables that are not regridded */
#pragma omp critical
{ /* begin OpenMP critical */
- (void)nco_cpy_var_val(in_id,out_id,(FILE *)NULL,(md5_sct *)NULL,trv.nm,trv_tbl);
+ if(flg_autoconvert && var_typ_out == NC_STRING && dmn_nbr_in == 0){
+ char *var_in_sng_val; /* [sng] Scalar string input variable */
+ char *var_out_chr_val; /* [sng] Scalar string output variable */
+ size_t sng_sz; /* [nbr] Length of scalar string variable */
+ rcd=nco_get_var(in_id,var_id_in,&var_in_sng_val,var_typ_out);
+ sng_sz=strlen(var_in_sng_val);
+ var_out_chr_val=(char *)nco_calloc(pow(10.0,(int)log10(sng_sz)+1.0),sizeof(char));
+ (void)strcat(var_out_chr_val,var_in_sng_val);
+ rcd=nco_put_var(out_id,var_id_out,(void *)var_out_chr_val,NC_CHAR);
+ if(var_out_chr_val) var_out_chr_val=(char *)nco_free(var_out_chr_val);
+ }else{
+ (void)nco_cpy_var_val(in_id,out_id,(FILE *)NULL,(md5_sct *)NULL,trv.nm,trv_tbl);
+ } /* !flg_autoconvert */
} /* end OpenMP critical */
} /* !flg_rgr */
} /* !xtr */
@@ -12413,7 +12504,7 @@ nco_xtr_var_get /* [fnc] Obtain variable specified by [external_path]/var_nm */
char *sls_ptr; /* [sng] Pointer to last slash character (' ') */
sls_ptr=strrchr(var_nm,sls_chr);
if(!sls_ptr){
- if(nco_dbg_lvl_get() >= nco_dbg_fl) (void)fprintf(stderr,"%s: INFO %s (aka \"the regridder\") reports unable to find (required) surface pressure or (optional) depth/height variable var_nm = %s for hybrid grid in input file, and unable to identify filename (ending with slash '/' or backslash '\\', depending on the operating system) portion of that string to serve as local external file for vertical grid input\n",nco_prg_nm_get(),fnc_nm,var_nm);
+ if(nco_dbg_lvl_get() >= nco_dbg_fl) (void)fprintf(stderr,"%s: INFO %s (aka \"the regridder\") reports unable to find (required) surface pressure or (optional) depth/height variable var_nm = %s for hybrid sigma-pressure grid in input file, and unable to identify filename (ending with slash '/' or backslash '\\', depending on the operating system) portion of that string to serve as local external file for vertical grid input\n",nco_prg_nm_get(),fnc_nm,var_nm);
return rcd;
} /* !sls_ptr */
=====================================
src/nco/nco_s1d.c
=====================================
@@ -223,11 +223,11 @@ nco_s1d_unpack /* [fnc] Unpack sparse-1D ELM/CLM variables into full file */
long int tpo_idx;
nco_bool *lut_vld_flg=NULL; /* [flg] Landunit types for which columns in this variable contain valid values */
- nco_string *pft_sng_out=NULL; /* [sng] Coordinate array of PFT strings */
nco_bool flg_var_mpt; /* [flg] Variable has no valid values */
nco_bool flg_snw_ocn=rgr->flg_snw_ocn; /* [flg] Unpack S1D snow fields into sane (ocean-like) level order */
nco_bool flg_snw_rdr; /* [flg] Re-arrange snow layer order for this variable using snl_var */
nco_lut_out_enm lut_out=(nco_lut_out_enm)(rgr->lut_out); /* [enm] Landunit type(s) for S1D column output */
+ nco_string *pft_sng_out=NULL; /* [sng] Coordinate array of PFT strings */
size_t idx_dbg=rgr->idx_dbg; /* [idx] User-specifiable debugging location */
size_t idx_in; /* [idx] Input grid index */
=====================================
src/nco/nco_scm.c
=====================================
@@ -150,7 +150,7 @@ void
nco_cpy_prn(void) /* [fnc] Print copyright notice */
{
/* Purpose: Print copyright notice */
- (void)fprintf(stderr,"Copyright (C) 1995--2024 Charlie Zender\n");
+ (void)fprintf(stderr,"Copyright (C) 1995--2025 Charlie Zender\n");
(void)fprintf(stdout,"This program is part of NCO, the netCDF Operators.\nNCO is free software and comes with a BIG FAT KISS and ABSOLUTELY NO WARRANTY\nYou may redistribute and/or modify NCO under the terms of the\n3-Clause BSD License with exceptions described in the LICENSE file\nBSD: https://opensource.org/licenses/BSD-3-Clause\nLICENSE: https://github.com/nco/nco/tree/master/LICENSE\n");
} /* end copyright_prn() */
@@ -210,7 +210,7 @@ nco_nmn_get(void) /* [fnc] Return mnemonic that describes current NCO version */
/* Purpose: Return mnemonic describing current NCO version
20191221: ncremap/ncclimo print left quote and first word of this string, so one-word strings look best
20200117: fixed this limitation, multi-word versions work fine */
- return "Awkward Self-Haircut";
+ return "Dark Sunset (Palisades Lost)";
} /* !nco_nmn_get() */
void
=====================================
src/nco/nco_var_utl.c
=====================================
@@ -550,7 +550,7 @@ nco_cpy_var_val_lmt /* [fnc] Copy variable data from input to output file, simpl
/* Purpose: Copy variable data from input netCDF file to output netCDF file
Truncate dimensions in variable definition in output file according to user-specified limits
Copy variable-by-variable, old-style,
- Routine was used by ncks until MSA implementation in ~2005
+ Routine was used by all of ncks until MSA implementation in ~2005
Functionality now extended and superceded by nco_cpy_var_val_mlt_lmt() */
nco_bool SRD=False;
View it on GitLab: https://salsa.debian.org/debian-gis-team/nco/-/commit/0721c213d3c4b80627ec67f29514aaf23718a4f2
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/nco/-/commit/0721c213d3c4b80627ec67f29514aaf23718a4f2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250113/7904ee19/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list