[Git][debian-gis-team/nco][upstream] New upstream version 5.3.8
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Sat Apr 11 15:03:45 BST 2026
Bas Couwenberg pushed to branch upstream at Debian GIS Project / nco
Commits:
a0fbd2f9 by Bas Couwenberg at 2026-04-11T15:49:00+02:00
New upstream version 5.3.8
- - - - -
27 changed files:
- bld/nco.spec
- bld/nco_dst.pl
- configure
- configure.ac
- data/ncclimo
- data/ncremap
- debian/changelog
- doc/ANNOUNCE
- doc/ChangeLog
- doc/VERSION
- doc/debian.txt
- doc/index.shtml
- doc/nco.texi
- src/nco++/fmc_all_cls.cc
- src/nco/ncks.c
- src/nco/nco.h
- src/nco/nco_cln_utl.c
- src/nco/nco_cln_utl.h
- src/nco/nco_cnv_csm.c
- src/nco/nco_cnv_csm.h
- src/nco/nco_grp_utl.c
- src/nco/nco_rgr.c
- src/nco/nco_rth_utl.c
- src/nco/nco_scm.c
- src/nco/nco_var_lst.c
- src/nco/nco_var_utl.c
- src/nco/ncra.c
Changes:
=====================================
bld/nco.spec
=====================================
@@ -108,6 +108,9 @@ fi
# %{_libdir}/libnco++.so
%changelog
+* Fri Apr 10 2026 Charlie Zender <zender at uci.edu> - 5.3.8-1
+- new upstream 5.3.8
+
* Tue Mar 31 2026 Charlie Zender <zender at uci.edu> - 5.3.7-1
- new upstream 5.3.7
=====================================
bld/nco_dst.pl
=====================================
@@ -5,20 +5,20 @@
# Usage:
# Export tagged, public versions
-# /usr/bin/scp ${DATA}/nco-5.3.7.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.7 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-5.3.7 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-5.3.7 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-5.3.7 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-5.3.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-5.3.7
+# /usr/bin/scp ${DATA}/nco-5.3.8.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.8 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-5.3.8 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-5.3.8 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-5.3.8 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-5.3.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-5.3.8
# 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.7/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.8/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.7.
+# Generated by GNU Autoconf 2.72 for NCO netCDF Operators 5.3.8.
#
# 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.7'
-PACKAGE_STRING='NCO netCDF Operators 5.3.7'
+PACKAGE_VERSION='5.3.8'
+PACKAGE_STRING='NCO netCDF Operators 5.3.8'
PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
PACKAGE_URL=''
@@ -1429,7 +1429,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.7 to adapt to many kinds of systems.
+'configure' configures NCO netCDF Operators 5.3.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1501,7 +1501,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of NCO netCDF Operators 5.3.7:";;
+ short | recursive ) echo "Configuration of NCO netCDF Operators 5.3.8:";;
esac
cat <<\_ACEOF
@@ -1674,7 +1674,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-NCO netCDF Operators configure 5.3.7
+NCO netCDF Operators configure 5.3.8
generated by GNU Autoconf 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2453,7 +2453,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.7, which was
+It was created by NCO netCDF Operators $as_me 5.3.8, which was
generated by GNU Autoconf 2.72. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4560,7 +4560,7 @@ fi
# Define the identity of the package.
PACKAGE='nco'
- VERSION='5.3.7'
+ VERSION='5.3.8'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -23320,7 +23320,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.7, which was
+This file was extended by NCO netCDF Operators $as_me 5.3.8, which was
generated by GNU Autoconf 2.72. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23388,7 +23388,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.7
+NCO netCDF Operators config.status 5.3.8
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.7],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[5.3.8],[nco-bugs at lists.sourceforge.net],[nco])
# Print GNU copyright in configure script
AC_COPYRIGHT
=====================================
data/ncclimo
=====================================
@@ -314,26 +314,26 @@ fi # !hrd_pth && !NCO_PATH_OVERRIDE
# ncclimo -v temperature -c hist -s 2 -e 3 -m ocn -i /gpfs/alpine/cli112/proj-shared/golaz/ACME_simulations/20160121.A_B2000ATMMOD.ne30_oEC.titan.a00/run -r ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -o ${DATA}/mpas/clm > ~/ncclimo.out 2>&1 &
# ncclimo -v iceAreaCell -c hist -s 2 -e 3 -m ice -i /gpfs/alpine/cli112/proj-shared/golaz/ACME_simulations/20160121.A_B2000ATMMOD.ne30_oEC.titan.a00/run -r ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -o ${DATA}/mpas/clm > ~/ncclimo.out 2>&1 &
# Split pipe:
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=FSNT,AODVIS --drc_out=${DATA}/ne30/clm
# Split redirection:
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc > ~/foo;ncclimo --split --dbg=1 -s 1 -e 2 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm < ~/foo
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc > ~/foo;ncclimo --split --dbg=1 -s 1 -e 2 --var=FSNT,AODVIS --drc_out=${DATA}/ne30/clm < ~/foo
# Split stdin switch:
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc | ncclimo --split --dbg=1 --stdin -s 1 -e 2 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc | ncclimo --split --dbg=1 --stdin -s 1 -e 2 --var=FSNT,AODVIS --drc_out=${DATA}/ne30/clm
# Split positional arguments:
-# ncclimo --split --dbg=1 -s 1 -e 1 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm ${DATA}/ne30/raw/20180129.DECKv1b_piControl.ne30_oEC.edison.cam.h0.0001-??.nc
+# ncclimo --split --dbg=1 -s 1 -e 1 --var=FSNT,AODVIS,T --drc_out=${DATA}/ne30/clm ${DATA}/ne30/raw/20180129.DECKv1b_piControl.ne30_oEC.edison.cam.h0.0001-??.nc
# Split directory:
-# ncclimo --dbg=1 --ypf=50 -s 1 -e 2 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_in=${DATA}/ne30/raw --drc_out=${DATA}/ne30/clm
+# ncclimo --dbg=1 --ypf=50 -s 1 -e 2 --var=FSNT,AODVIS --drc_in=${DATA}/ne30/raw --drc_out=${DATA}/ne30/clm
# Split global mean
# cd ${DATA}/ne30/raw;ls 2018*000[12]-??*.nc | ncclimo --split --dbg=1 --rgn_avg -s 1 -e 2 --var=FSNT,AODVIS,TREFHT --drc_out=${DATA}/ne30/clm
# Split global sum
# ncclimo -P elm --split --rgn_stt=sum --sum_scl=1.0e6*3600*24*365/1.0e12 -v GPP -c v3.LR.piControl -s 460 -e 461 --var=GPP --drc_in=${DATA}/ne30/raw --drc_out=${DATA}/ne30/clm
# Split all:
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --drc_out=${DATA}/ne30/clm
# Split ELM:
# ncclimo --split --dbg=1 -s 2000 -e 2000 --var=FSDS,TBOT --drc_out=${DATA}/ne30/clm ${DATA}/ne30/raw/F_acmev03_enso_camse_clm45bgc_ne30_co2cycle.clm2.h0.2000-??.nc
# Split vertical:
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=T --vrt_out=${DATA}/grids/vrt_prs_ncep_L17.nc --drc_out=${DATA}/ne30/clm
-# cd ${DATA}/ne30/raw;ls *000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=T --vrt_out=${DATA}/grids/vrt_prs_ncep_L17.nc --vrt_xtr=mss_val --drc_out=${DATA}/ne30/clm # Missing value interpolation
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=T --vrt_out=${DATA}/grids/vrt_prs_ncep_L17.nc --drc_out=${DATA}/ne30/clm
+# cd ${DATA}/ne30/raw;ls *piControl*000[12]-??*.nc | ncclimo --split --dbg=1 -s 1 -e 2 --var=T --vrt_out=${DATA}/grids/vrt_prs_ncep_L17.nc --vrt_xtr=mss_val --drc_out=${DATA}/ne30/clm # Missing value interpolation
# Split production:
# cd /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run;ls *cam.h0.000[1-9]* | ncclimo --split --dbg=1 --yr_srt=1 --yr_end=9 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
# cd /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run;ls *cam.h0.0[012]??* | ncclimo --split --dbg=1 --yr_srt=1 --yr_end=250 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_cmip6_180x360_nco.20190601.nc --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
@@ -690,7 +690,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
echo "${fnt_rvr}-p${fnt_nrm} ${fnt_bld}par_typ${fnt_nrm} Parallelism type for files (default ${fnt_bld}${par_typ}${fnt_nrm}) [${fnt_tlc}par_typ, par_md, parallel_type, parallel_mode, parallel${fnt_nrm}] [${fnt_tlc}serial | background | mpi${fnt_nrm}]"
echo " ${fnt_bld}--qnt_prc${fnt_nrm} Quantization precision (empty means none) (default ${fnt_bld}${qnt_prc}${fnt_nrm}) [${fnt_tlc}qnt, qnt_prc, ppc, ppc_prc, precision, quantize${fnt_nrm}]"
echo "${fnt_rvr}-R${fnt_nrm} ${fnt_bld}rgr_opt${fnt_nrm} Regrid options (empty means none) (default ${fnt_bld}${rgr_opt}${fnt_nrm}) [${fnt_tlc}rgr_opt, regrid_options${fnt_nrm}]"
- echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rgr_map${fnt_nrm} Regrid map-file (horizontal) (empty means none) (default ${fnt_bld}${rgr_map}${fnt_nrm}) [${fnt_tlc}rgr_map, regrid_map, map, map_file, map_fl${fnt_nrm}]"
+ echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rgr_map${fnt_nrm} Regrid map-file (horizontal) (empty means none) (default ${fnt_bld}${rgr_map}${fnt_nrm}) [${fnt_tlc}rgr_map, regrid_map, map, map_fl, map_file${fnt_nrm}]"
echo " ${fnt_bld}--rgn_avg${fnt_nrm} Regional/global average timeseries (default ${fnt_bld}${rgn_avg}${fnt_nrm}) [${fnt_tlc}rgn_avg, glb_avg, hms_avg, regional_average${fnt_nrm}]"
echo " ${fnt_bld}--rgn_stt${fnt_nrm} Regional/global statistical timeseries (default ${fnt_bld}${rgn_stt}${fnt_nrm}) [${fnt_tlc}rgn_stt, glb_stt, hms_stt, regional_statistic, global_statistic${fnt_nrm}] (avg|sum)"
echo "${fnt_rvr}-S${fnt_nrm} ${fnt_bld}yr_srt${fnt_nrm} Start year previous climo (empty means none) (default ${fnt_bld}${yr_srt_prv}${fnt_nrm}) [${fnt_tlc}yr_srt_prv, prv_yr_srt, previous_start${fnt_nrm}]"
@@ -816,6 +816,15 @@ csn_nfo_get()
return 1
fi
+ # Validate and convert to base-10 to avoid octal interpretation
+ yr_srt=$((10#${yr_srt}))
+ mth_srt=$((10#${mth_srt}))
+ yr_end=$((10#${yr_end}))
+ mth_end=$((10#${mth_end}))
+ csn_srt_idx=$((10#${csn_srt_idx}))
+ csn_end_idx=$((10#${csn_end_idx}))
+ rtn_enm=$((10#${rtn_enm}))
+
# Compute data range boundaries
yyyymm_srt=$((yr_srt*100+mth_srt))
yyyymm_end=$((yr_end*100+mth_end))
@@ -1002,7 +1011,7 @@ while getopts :34567a:C:c:d:E:e:f:h:i:j:L:l:m:n:O:o:P:p:R:r:S:s:t:v:X:x:Y:y:-: O
rgn_avg=?* | glb_avg=?* | hms_avg=?* | regional_average=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Regional average timeseries
rgn_stt=?* | glb_stt=?* | hms_stt=?* | global_statistic=?* | regional_statistic=?* ) rgn_stt="${LONG_OPTARG}" ;; # # Regional/global statistical timeseries
rgr_opt=?* | regrid_options=?* ) rgr_opt_usr="${LONG_OPTARG}" ;; # -R # Regridding options
- rgr_map=?* | regrid_map=?* | map=?* ) rgr_map="${LONG_OPTARG}" ;; # -r # Regridding map (horizontal)
+ rgr_map=?* | regrid_map=?* | map=?* | map_fl=?* | map_file=?* ) rgr_map="${LONG_OPTARG}" ;; # -r # Regridding map (horizontal)
yr_srt_prv=?* | prv_yr_srt=?* | previous_start=?* ) yr_srt_prv="${LONG_OPTARG}" ;; # -S # Start year previous
yr_srt=?* | start_yr=?* | year_start=?* | start_year=?* | start=?* ) yr_srt="${LONG_OPTARG}" ;; # -s # Start year
seasons=?* | csn_lst=?* | csn=?* | season=?* ) csn_lst="${LONG_OPTARG}" ;; # # Seasons to output
@@ -1289,7 +1298,12 @@ mth_end_rth=${sng_trm}
mm_end=`printf "%02d" ${mth_end_rth}`
let mth_nbr=${yr_end_rth}*12+${mth_end_rth}-${yr_srt_rth}*12-${mth_srt_rth}+1
let yr_nbr=${mth_nbr}/12
-let jan_fst=${mth_srt_rth}-1 # [nbr] Starting month offset in months from January
+# How many files/months from first month to first January?
+if [ ${mth_srt_rth} -eq 1 ]; then
+ jan_fst=0 # [nbr] Offset of January from starting month
+else
+ jan_fst=$(( 12 - ${mth_srt_rth} + 1 ))
+fi # mth_srt_rth
let mth_srtm1=${mth_srt_rth}-1 # [idx] 1-based index of month preceding start month
let mth_endp1=${mth_end_rth}+1
if [ ${mth_srtm1} -eq 0 ]; then
@@ -1601,6 +1615,7 @@ if [ ${inp_aut} = 'Yes' ] && [ ${clm_md} = 'mth' ] || [ ${clm_md} = 'ann' ]; the
fl_nbr=0
yr_srt_all=${yyyy_srt}
yr_end_all=${yyyy_end}
+ # Bash brace expansion like {1..12} only works with naked numbers. Variables must use seq().
for yr in `seq ${yr_srt_all} ${yr_end_all}`; do
YYYY=`printf "%04d" ${yr}`
clm_idx=0
@@ -1613,8 +1628,9 @@ if [ ${inp_aut} = 'Yes' ] && [ ${clm_md} = 'mth' ] || [ ${clm_md} = 'ann' ]; the
let clm_idx=${clm_idx}+1
MM=`printf "%02d" ${clm_idx}`
# Only construct filenames for months that are used
- if [ ${mth_flg} = 'Yes' ] && [ ${yr} = ${yr_srt_all} ] && [ ${MM} -lt ${mth_srt_rth} ]; then continue; fi
- if [ ${mth_flg} = 'Yes' ] && [ ${yr} = ${yr_end_all} ] && [ ${MM} -gt ${mth_end_rth} ]; then continue; fi
+ # 20260410 this statements should be triggered during climos!
+ if [ ${mth_flg} = 'Yes' ] && [ ${yr} -eq ${yr_srt_all} ] && [ ${MM} -lt ${mth_srt_rth} ]; then continue; fi
+ if [ ${mth_flg} = 'Yes' ] && [ ${yr} -eq ${yr_end_all} ] && [ ${MM} -gt ${mth_end_rth} ]; then continue; fi
if [ ${nm_typ} = 'cesm' ]; then
fl_in[${fl_nbr}]="${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${MM}.nc"
elif [ ${nm_typ} = 'mpas' ]; then # Use MPAS not CESM conventions
@@ -2484,9 +2500,11 @@ if [ ${dbg_lvl} -ge 2 ]; then
printf "dbg: mdl_typ = ${mdl_typ}\n"
printf "dbg: mpi_flg = ${mpi_flg}\n"
printf "dbg: mpi_nbr = ${mpi_nbr}\n"
+ printf "dbg: mth_srt = ${mth_srt}\n"
printf "dbg: mth_end = ${mth_end}\n"
+ printf "dbg: mth_srt_rth = ${mth_srt_rth}\n"
+ printf "dbg: mth_end_rth = ${mth_end_rth}\n"
printf "dbg: mth_nbr = ${mth_nbr}\n"
- printf "dbg: mth_srt = ${mth_srt}\n"
printf "dbg: nco_opt = ${nco_opt}\n"
printf "dbg: ncr_flg = ${ncr_flg}\n"
printf "dbg: nd_nbr = ${nd_nbr}\n"
@@ -2526,6 +2544,11 @@ if [ ${dbg_lvl} -ge 2 ]; then
printf "dbg: yr_sbs = ${yr_sbs}\n"
printf "dbg: yyyy_end = ${yyyy_end}\n"
printf "dbg: yyyy_srt = ${yyyy_srt}\n"
+ printf "dbg: yyyy_srt = ${yyyy_srt}\n"
+ printf "dbg: yr_srt_rth = ${yr_srt_rth}\n"
+ printf "dbg: yr_end_rth = ${yr_end_rth}\n"
+ printf "dbg: yr_srtm1 = ${yr_srtm1}\n"
+ printf "dbg: yr_endm1 = ${yr_endm1}\n"
if [ "${csn_flg}" = 'Yes' ]; then
for ((csn_idx=0;csn_idx<${csn_nbr};csn_idx++)); do
printf "dbg: Requested season index ${csn_idx} (\"${csn_rqs[${csn_idx}]}\") is defined season index ${map_r2d[${csn_idx}]} (\"${csn_abb[${map_r2d[${csn_idx}]}]}\")\n"
@@ -2535,10 +2558,6 @@ if [ ${dbg_lvl} -ge 2 ]; then
fi # !csn
fi # !dbg
if [ ${dbg_lvl} -ge 2 ]; then
- printf "dbg: yyyy_srt = ${yyyy_srt}\n"
- printf "dbg: yr_srt_rth = ${yr_srt_rth}\n"
- printf "dbg: yr_srtm1 = ${yr_srtm1}\n"
- printf "dbg: yr_endm1 = ${yr_endm1}\n"
if [ ${mpi_flg} = 'Yes' ]; then
for ((nd_idx=0;nd_idx<${nd_nbr};nd_idx++)); do
printf "dbg: nd_nm[${nd_idx}] = ${nd_nm[${nd_idx}]}\n"
@@ -2748,16 +2767,16 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ]; then
for mth in {01..12}; do
let clm_idx=${clm_idx}+1
MM=`printf "%02d" ${clm_idx}`
- # Monthly filenames are every twelfth file from input list (which is assumed to start with January)
+ # The same month-of-year appears every twelve filenames in input list
if [ ${clm_md} = 'mth' ]; then
fl_all=''
for ((yr_idx=0;yr_idx<yr_nbr;yr_idx++)); do
- let fl_idx=$((yr_idx * 12 + clm_idx - 1))
- # 20260323 Adjust fl_idx by January offset
- let fl_idx=${fl_idx}+${jan_fst}
- if [ ${fl_idx} -ge ${fl_nbr} ]; then
- let fl_idx=${fl_idx}-12
- fi # !fl_idx
+ # Initialize fl_idx as if first supplied month were January
+ let fl_idx=$((clm_idx - 1))
+ # 20260323 Adjust fl_idx by January offset, then use modulo twelve to point fl_idx to first occurence of MM in file list
+ let fl_idx=$(( (fl_idx + jan_fst) % 12))
+ # Adjust fl_idx by 12 per year to the current year
+ let fl_idx=$(( fl_idx + yr_idx * 12))
fl_all="${fl_all} ${fl_in[${fl_idx}]}"
done # !yr_idx
@@ -2786,13 +2805,12 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ]; then
fi # !gaa_sng
fl_out[${clm_idx}]="${drc_out}/${out_nm}_${MM}_${yyyy_srt_mth[${clm_idx}]}${MM}_${yyyy_end_mth[${clm_idx}]}${MM}_climo.nc"
-
if [ ${clm_md} = 'hfc' ]; then
# Computing climos from high-freqency data requires many steps:
# A primary goal is to re-use not re-write code, especially existing monthly frequency climo code
# Otherwise code maintainability significantly suffers
# Code-reuse all-but-requires same existing parallelization as monthly frequency climos
- # Difficulty is that traditionaly monthly mean climos equally weight all input records using ncra
+ # Difficulty is that traditionally monthly mean climos equally weight all input records using ncra
# Proposed Algorithm:
# 1. Re-use splitter option ypf for intermediate files so users can prevent excessive intermediate filesizes
# 2. Generate month-aligned intermediate segments containing ypf instances of a single month (and no other months) for all variables
@@ -2868,7 +2886,6 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ]; then
elif [ ${clm_md} = 'mth' ]; then
clm_bnd[${clm_idx}]=${yyyy_srt_mth[${clm_idx}]},${yyyy_end_mth[${clm_idx}]},${clm_idx},${clm_idx},0
cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --clm_bnd=${clm_bnd[${clm_idx}]} -O ${nco_opt} ${gaa_sng[${clm_idx}]} ${ppn_opt} ${fl_all} ${fl_out[${clm_idx}]}"
- # cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --clm_bnd=${yr_srt},${yr_end},${clm_idx},${clm_idx},0 -O ${nco_opt} ${gaa_sng[${clm_idx}]} ${ppn_opt} ${fl_all} ${fl_out[${clm_idx}]}"
# Combine monthly into seasonal and annual means with ncra
cmd_mth2csn='ncra'
cmd_csn2ann='ncra'
@@ -3013,11 +3030,11 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ]; then
# 20260323 Start and end years now depend on start and end months
csn_srt_idx_crr=${csn_srt_idx[${map_r2d[${csn_idx}]}]}
csn_end_idx_crr=${csn_end_idx[${map_r2d[${csn_idx}]}]}
- yyyymm_frs=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_frs})
- yyyymm_lst=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_lst})
- yyyymm_rng=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_rng})
- yyyy_rng=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyy_rng})
- clm_bnd_arg=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_clm_bnd_arg})
+ yyyymm_frs=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_frs})
+ yyyymm_lst=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_lst})
+ yyyymm_rng=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyymm_rng})
+ yyyy_rng=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_yyyy_rng})
+ clm_bnd_arg=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} ${csn_srt_idx_crr} ${csn_end_idx_crr} ${rtn_clm_bnd_arg})
clm_bnd[${clm_idx}]="--clm_bnd=${clm_bnd_arg},${tpd_out}"
if [ -n "${gaa_sng_std}" ]; then
# NB: E3SM diagnostics (e3sm_diagnostics) relies on this attribute
@@ -3030,7 +3047,7 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ]; then
# fl_out[15]="${drc_out}/${out_nm}_SON_${yyyy_srt}09_${yyyy_end}11_climo.nc"
# fl_out[16]="${drc_out}/${out_nm}_DJF_${yyyy_clm_srt_dec}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
if [ "${ann_flg}" = 'Yes' ]; then
- yyyy_rng=$(csn_nfo_get ${yr_srt} ${mth_srt} ${yr_end} ${mth_end} 1 12 ${rtn_yyyy_rng})
+ yyyy_rng=$(csn_nfo_get ${yr_srt_rth} ${mth_srt_rth} ${yr_end_rth} ${mth_end_rth} 1 12 ${rtn_yyyy_rng})
if [ -n "${gaa_sng_std}" ]; then
# NB: E3SM diagnostics (e3sm_diagnostics) relies on this attribute
gaa_sng[${clm_nbr}]="${gaa_sng_std} --gaa yrs_averaged=${yyyy_rng}"
@@ -3774,11 +3791,14 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ] && [ "${bnr_flg}"
fi # !dbg
# Clean-up monthly inputs (important since these file can be huge)
if [ ${clm_md} = 'hfc' ]; then
+# printf "quark1: Temporarily not deleting HFC output files!!!!!!!!!!\n"
+# if false; then
if [ "${fl_nbr}" -eq 1 ]; then
/bin/rm -f ${drc_out}/${out_nm}_[01][0-9]_tms_foo_${yyyy_clm_srt}_${yyyy_clm_end}.nc
else
/bin/rm -f ${drc_out}/${out_nm}_[01][0-9]_tpd[0-9][0-9]_*.nc
fi # !fl_nbr
+# fi # !false
fi # !clm_md
# Block 1: Loop 4: Regrid first twelve files. Load-balance by using idle nodes (nodes not used for seasonal climatologies).
@@ -3949,7 +3969,6 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_hfc_or_mth}" = 'Yes' ] && [ "${bnr_flg}"
printf "Climatological annual mean...\n"
[[ ${dbg_lvl} -ge 1 ]] && date_clm=$(date +"%s")
fl_lst="${fl_out[${clm_csn_mam_idx}]} ${fl_out[${clm_csn_jja_idx}]} ${fl_out[${clm_csn_son_idx}]} ${fl_out[${clm_csn_djf_idx}]}"
-
cmd_clm[${clm_nbr}]="${cmd_mpi[${clm_nbr}]} ${cmd_csn2ann} ${clm_bnd[${clm_nbr}]} -O -w 92,92,91,90 ${nco_opt} ${gaa_sng[${clm_nbr}]} ${fl_lst} ${fl_out[${clm_nbr}]}"
# cmd_clm[17]="${cmd_mpi[17]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${gaa_sng[${clm_idx}]} ${fl_out[13]} ${fl_out[14]} ${fl_out[15]} ${fl_out[16]} ${fl_out[17]}"
if [ ${dbg_lvl} -ge 1 ]; then
=====================================
data/ncremap
=====================================
@@ -709,7 +709,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
echo "${fnt_rvr}-j${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm} Job simultaneity for file-level parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm}) [${fnt_tlc}job_nbr, job_number, jobs${fnt_nrm}]"
echo "${fnt_rvr}-L${fnt_nrm} ${fnt_bld}dfl_lvl${fnt_nrm} Deflate level (empty is none) (default ${fnt_bld}${dfl_lvl}${fnt_nrm}) [${fnt_tlc}dfl_lvl, dfl, deflate${fnt_nrm}]"
echo "${fnt_rvr}-M${fnt_nrm} Multi-map-file toggle (unset means generate one map-file per input file) [${fnt_tlc}mlt_map, no_multimap${fnt_nrm}]"
- echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm} Map-file (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm}) [${fnt_tlc}map_fl, map, map_file, rgr_map, regrid_map${fnt_nrm}]"
+ echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm} Map-file (horizontal regridding) (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm}) [${fnt_tlc}map_fl, map, map_file, rgr_map, regrid_map${fnt_nrm}]"
echo " ${fnt_bld}--mbt_grd_nc4${fnt_nrm} Either grid for MOAB mbconvert to read is netCDF4 format (default ${fnt_bld}${mbt_grd_nc4}${fnt_nrm}) [${fnt_tlc}mbt_grd_nc4, mbt_grd_rd_srl, grd_fmt_nc4$, {fnt_nrm}]"
echo " ${fnt_bld}--mpi_nbr${fnt_nrm} Number of tasks-per-node that MPI-enabled weight generators will request (default ${fnt_bld}${mpi_nbr}${fnt_nrm}) [${fnt_tlc}mpi_nbr, mpi_number, tsk_nbr, task_number${fnt_nrm}]"
echo " ${fnt_bld}--mpi_pfx${fnt_nrm} Prefix for MPI-enabled weight generators (empty means weight generator is not MPI-enabled) (default ${fnt_bld}${mpi_pfx}${fnt_nrm}) [${fnt_tlc}mpi_pfx, mpi_prefix, srun_cmd, srun_command${fnt_nrm}]"
@@ -907,7 +907,7 @@ while getopts :34567a:CD:d:f:g:G:h:I:i:j:L:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-
hrd_pth=?* | hard_path=?* | npo=?* | nco_path_override=?* | NCO_PATH_OVERRIDE=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Use hard-coded paths on known machines
in_fl=?* | in_file=?* | input_file=?* ) in_fl="${LONG_OPTARG}" ;; # -i # Input file
job_nbr=?* | job_number=?* | jobs=?* ) job_usr="${LONG_OPTARG}" ;; # -j # Job simultaneity
- map_fl=?* | map=?* | map_file=?* | rgr_map=?* | regrid_map=?* ) map_fl="${LONG_OPTARG}" ;; # -m # Map-file
+ map_fl=?* | map=?* | map_file=?* | rgr_map=?* | regrid_map=?* ) map_fl="${LONG_OPTARG}" ;; # -m # Map-file (horizontal regridding)
mbt_grd_nc4 | mbt_grd_rd_srl | grd_fmt_nc4 ) mbt_grd_nc4='Yes' ;; # # Either grid for MOAB mbconvert to read is netCDF4 format (so read it in serial)
mbt_grd_nc4=?* | mbt_grd_rd_srl=?* | grd_fmt_nc4=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Either grid for MOAB mbconvert to read is netCDF4 format (so read it in serial)
mem_mb=?* ) mem_mb="${LONG_OPTARG}" ;; # # Megabytes of RAM per srun job in Cori SLURM in MPI mode
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+nco (5.3.8-1) unstable; urgency=low
+
+ * new upstream version Field Trip Fest: all: CF cnv url; ncclimo: flx mth fix, csn/ann yr_rng fix; ncra: cb->bnd_mk, cb->lcn_typ, climo_time_cell_method
+
+ -- Charlie Zender <zender at uci.edu> Fri, 10 Apr 2026 12:26:25 -0700
+
nco (5.3.7-1) unstable; urgency=low
* new upstream version Sleeping Dolphins: all: update NEP API, l2d cnk, LZ4, bebop/improv; ncclimo: csn all, flx mth, salloc xmp; ncks json fix; ncremap: rm PM modules, srun dfl, ps srch fix, mbpart nfr, mbconvert
=====================================
doc/ANNOUNCE
=====================================
@@ -1,143 +1,49 @@
$Header$ -*-text-*-
-netCDF Operators NCO version 5.3.7 beats the buzzer
+netCDF Operators NCO version 5.3.8 mends fences
http://nco.sf.net (Homepage, Mailing lists, Help)
http://github.com/nco/nco (Source Code, Issues, Releases)
What's new?
-Version 5.3.7 contains significant new features and fixes.
-ncremap support for MOAB-TempestRemap (mbtempest) has been refactored
-to optimize parallel weight generation and support new algorithms.
-ncclimo now supports "flexible-months", so input datsets can begin in
-an month, not just January. Additionally, ncclimo understands all
-consectutive 2-month pairs and 3-month trios as valid seasons.
-Other improvements include support for the l2d packing policy
-suggested for CMIP7, and for the NetCDF Expansion Pack v.1.5+ API,
-ncks fixes JSON-format output regressions, and ncclimo fixes automatic
-name generation fixes two corner case bugs.
-
-Users should consider upgrading to exploit these new features.
+Version 5.3.8 contains fixes to ncclimo problems introduced with 5.3.7.
+The ncclimo "flexible-months" feature suffered from incorrect behavior
+for some inputs, and introduced a regression in seasonal filenames.
+The only new feature is that ncclimo now supports generating climos
+from high-frequency input data that are instantaneous (not mean)
+values. Documentation now reflects the new CF Convention Homepage URL.
+
+Users who upgraded to 5.3.7 should upgrade to 5.3.8, and 5.3.7 should
+not be used anymore.
Enjoy,
Charlie
NEW FEATURES (full details always in ChangeLog):
-A. ncremap support for mbtempest is better optimized and more fully
-parallel. mbconvert runs in parallel for input grids of type True
-Exodus and netCDF3, and in serial for types netCDF4 and TR Exodus.
-mbpart now uses --inferred to optimize partitioning of destination
-grid.
-
-ncremap --mpi_nbr=8 -a traave --src_grd=src.g --dst_grd=dst.nc -m map.nc
-
-http://nco.sf.net/nco.html#moab
-Thanks to Vijay Mahadevan of ANL for advice on MOAB's workflow.
-
-B. ncremap in vertical interpolation mode for hybrid sigma-pressure
-coordinates now searches for the surface pressure in the input
-datafile before searching any input vertical grid file. When reading
-the hybrid coordinate grid from a separate file, ncremap previously
-expected the surface pressure to also be in that file. Now ps can
-be with the data itself, apart from the input coordinate grid.
-
-ncremap -P eamxx --vrt_in=vrt_L128.nc --vrt_out=vrt_ncep.nc in.nc out.nc
-
-http://nco.sf.net/nco.html#vrt
-Thanks to Jill Zhang of PNNL for reporting this issue.
-
-C. ncclimo now supports climos that begin in any month, not just
-January! We call this "flexible month" support. Previously all
-climatologies needed to begin with January (or December, with the
---wnt_md=scd option), so no starting month argument was needed.
-Now input files can begin in any start month, and the --wnt_md option
-is replaced by simply supplying datasets that start with December.
-Use the --mth_srt and --mth_end options to specify the starting and
-ending months, otherwise January and December will be assumed.
-This feature works for High-Frequency-Climos (HFC) as well.
-(Note that at least 12 months of data must still be supplied).
-
-ncclimo -c caseid -s 2013 -e 2014 --mth_srt=7 --mth_end=6 -i drc_in -o drc_out
-
+A. ncclimo now supports generating climos from high-frequency input
+data that are instantaneous (not mean) values. This mainly means that
+that the time bounds and climatology bounds variables now use the
+instantaneous time from the original time coordinate input, rather
+than the average value of the time coordinate input.
+Thanks to Jill Zhang (LLNL) for feature testing and feedback.
http://nco.sf.net/nco.html#ncclimo
-(thanks to Copilot for assisting)
-D. ncclimo has all consecutive two-month and three-month seasons
-defined internally, so users can select any. Two-month seasons
-are, e.g., Jan-Feb, Feb-Mar, ... Dec-Jan. Three-month seasons are,
-e.g., Jan-Feb-Mar, Feb-Mar-Apr, ... Dec-Jan-Feb. The seasonal
-names are simply the two or three letter conjunctions formed by
-the first letters of the constituent months, e.g., jf, amj:
+B. All links to documentation now point to the newish CF Homepage
+at https://cf-convention.github.io/cf-conventions.
-ncclimo ... --csn=jas,ond,jfm,amj,nd,nj -i drc_in -o drc_out
+BUG FIXES:
+A. ncclimo flexible months mode introduced in 5.3.7 sometimes
+generated read datasets in the wrong order.
+Thanks to Jill Zhang (LLNL) for identifying this issue.
http://nco.sf.net/nco.html#ncclimo
-E. The l2d chunking policy is available on all operators.
-This policy forces all variables with one or two dimensions into a
-single chunk. It is inspired by the chunking policy followed by
-the cmip7repack tool (https://github.com/NCAS-CMS/cmip7_repack).
-It is used like any other packing policy, and has the virtue of
-being recommended for CMIP7 datasets. NB: When NCO repacks a
-dataset, it automatically consolidates the internal metadata.
-
-ncks --cnk_plc l2d in.nc out.nc
-
-http://nco.sf.net/nco.html#chunking
-http://nco.sf.net/nco.html#cnk_l2d
-http://nco.sf.net/nco.html#ncpdq
-Thanks to Ezequiel Cimadevilla and David Hassell of NCAS for
-contributing this.
-
-F. NCO now supports the NetCDF Expansion Pack v.1.5+ API.
-Support for the v.1.0 API has been dropped. Original NEP features
-like the LZ4 codec are now supported. Newer NEP features such as
-reading GRIB2 and GeoTIFF files should also be supported.
-If the host NEP package is installed correctly for NCO to build
-with and link to at runtime, then NCO will be able to read
-GeoTIFF and Grib2 and CDF files (depending on NEP configureation).
-Our goal is to make this occur automagically via Conda and Spack
-packaging.
-
-ncks --cmp='gbr|shf|lz4' in.nc out.nc # LZ4 compression via NEP
-
-https://github.com/Intelligent-Data-Design-Inc/NEP
-Thanks to Ed Hartnett for creating NEP.
-
-G. The ncremap tutorial on the E3SM Confluence page
-https://e3sm.atlassian.net/wiki/spaces/DOC/pages/edit-v2/754286611
-contains still more documentation on how to exploit the three types
-of parallelism (node-, workflow-, and thread-level) supported by
-ncremap.
-
-BUG FIXES:
-
-A. Conversion of input files to JSON has been subtly broken
-for some time, as pointed out by Andrew Barna. Variables
-were missing their "type" and "shape" specifiers, and attributes
-could not add these not matter what --jsn_fmt option was given.
-This has been fixed. The workaround is to use an earlier version
-of NCO. The solution is to upgrade.
-http://nco.sf.net/nco.html#json
-http://nco.sf.net/nco.html#jsn_fmt
-
-B. In all previous versions ncclimo failed to handle
-starting and ending years specified as 0, 00, or 000.
-Year zero had to be specified as 0000. That is now fixed.
-The workaround is to use 0000 for year 0. The solution is
-to upgrade.
-
-C. Since about 2024 the ncclimo automatic name generation
-feature has prepended "${caseid}." to the MPAS model default
-filenames. This inadvertently prepended just a period when
-the --caseid option was not specified. This period is an
-unwanted character, and broke the automatic feature from
-correctly generating MPAS v1 and v2 filenames. This has
-been fixed. The workaround is to create symbolic links
-that contain the period to the actual v1 and v2 filenames.
-The solution is to upgrade. Thanks to Qi Tang for reporting
-this issue.
+B. ncclimo flexible months mode introduced in 5.3.7 sometimes
+caused input years with leading zeros to be interpreted as octal
+numbers and therefore generate inaccurate filenames.
+Thanks to Xylar Asay-Davis (ANL) for reporting this issue.
+http://nco.sf.net/nco.html#ncclimo
Full release statement at http://nco.sf.net/ANNOUNCE
@@ -145,7 +51,7 @@ KNOWN PROBLEMS DUE TO NCO:
This section of ANNOUNCE reports and reminds users of the
existence and severity of known, not yet fixed, problems.
-These problems occur with NCO 5.3.7 built/tested under
+These problems occur with NCO 5.3.8 built/tested under
MacOS 26.3 with netCDF 4.10.1-development on HDF5 2.1.1
and with Linux FC42 with netCDF 4.9.2 on HDF5 1.14.4.
=====================================
doc/ChangeLog
=====================================
@@ -1,3 +1,65 @@
+2026-04-10 Charlie Zender <zender at uci.edu>
+
+ * NCO 5.3.8 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.8: Field Trip Fest';git push
+ git tag -a 5.3.8 -m 'all: CF cnv url; ncclimo: flx mth fix, csn/ann yr_rng fix; ncra: cb->bnd_mk, cb->lcn_typ, climo_time_cell_method';git push --tags
+
+ * NCO 5.3.8-alpha03 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.8-alpha03: Practicum';git push
+ git tag -a 5.3.8-alpha03 -m 'ncclimo: fix csn/ann yr_rng octal bug';git push --tags
+
+ * Failed to understand why old EAMxx HFC data generates out-of-range errors in nco_put_var()
+
+ * ncclimo use numeric comparison in inp_aut filename generation (fixes fl_nbr miscount)
+
+ * Fix nco_clm_nfo_to_tm_bnds() prototype
+
+ * ncclimo call csn_nfo_get() with trimmed (i.e., _rth) values to prevent octal interpretation
+
+ * Add explicit base-10 conversion for all input parameters after syntax check (Copilot)
+
+2026-04-08 Charlie Zender <zender at uci.edu>
+
+ * NCO 5.3.8-alpha02 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.8-alpha02: 29 Palms';git push
+ git tag -a 5.3.8-alpha02 -m 'all: CF cnv url chg; ncra: cb->bnd_mk, cb->lcn_typ, climo_time_cell_method';git push --tags
+
+ * ncra: Detect climo_time_cell_method in input to cue instantaneous treatment
+
+ * ncra: Add global climo_time_cell_method attribute to instantaneous files
+
+ * ncra: Fix bounds for instant files to accord with CF in all monthly and seasonal climos
+
+ * ncks: CEWI Initialize fexcept_t flg_xcp to 0
+
+ * ncra: Create nco_lcn_typ branches for time and boundary values in nco_clm_nfo_to_tm_bnds()
+
+ * ncra: Add interval-location type enumeration argument to nco_cln_utl.c:nco_clm_nfo_to_tm_bnds()
+
+ * Update CF Conventions homepage from http://cfconventions.org to https://cf-convention.github.io
+
+ * ncra: Put bnd_mk fields into cb structure for potential use by nco_cnv_cf_cll_mth_add()
+
+ * ncra: Create dim2 dimension (if needed) and time_bnds variable when cb->bnd_mk is true
+
+2026-04-07 Charlie Zender <zender at uci.edu>
+
+ * nco_cnv_cf_cll_mth_add() add cell_method="time: point"
+
+2026-04-06 Charlie Zender <zender at uci.edu>
+
+ * ncra add cb->bnd_mk stubs
+
+ * NCO 5.3.8-alpha01 release procedure:
+ cd ~/nco;git commit -a -m 'Version 5.3.8-alpha01: Laguna Lahaina';git push
+ git tag -a 5.3.8-alpha01 -m 'Functionally identical to 5.3.7 except for flexible months fixes';git push --tags
+
+2026-04-03 Charlie Zender <zender at uci.edu>
+
+ * Fix duplicated years in monthly climo file list
+
+ * Fix January offset jan_fst in flexible months
+
2026-03-31 Charlie Zender <zender at uci.edu>
* NCO 5.3.7 release procedure:
=====================================
doc/VERSION
=====================================
@@ -1 +1 @@
-5.3.7
+5.3.8
=====================================
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.3.7
- First we create a clean source distribution of nco and place it in nco-5.3.7
+ For starters, we wish to create .debs of tagged releases, e.g., nco-5.3.8
+ First we create a clean source distribution of nco and place it in nco-5.3.8
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.3.7
-/bin/rm nco.tar.gz;tar cvzf nco-5.3.7.tar.gz ./nco-5.3.7/*
-cd ~/nco/nco-5.3.7
-dh_make -e zender at uci.edu -f ../nco-5.3.7.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-5.3.8
+/bin/rm nco.tar.gz;tar cvzf nco-5.3.8.tar.gz ./nco-5.3.8/*
+cd ~/nco/nco-5.3.8
+dh_make -e zender at uci.edu -f ../nco-5.3.8.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.3.7.tar.gz
from previous build
cd ~/nco;/bin/rm *.gz
- cd ~/nco/nco-5.3.7
+ cd ~/nco/nco-5.3.8
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.3.7 with X.Y.Z+1
+# tags-query replace 5.3.8 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.3.7-1 # Update changelog (-b forces this version number)
+ cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 5.3.8-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.3.7
+ ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-5.3.8
# Upload tarball to SF https://sourceforge.net/projects/nco/files
- cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-5.3.7.tar.gz .
+ cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-5.3.8.tar.gz .
7. Ubuntu PPA
https://help.launchpad.net/Packaging/PPA
-dput NCO nco_5.3.7-2~ppa1_source.changes
+dput NCO nco_5.3.8-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.3.7-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_5.3.7-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_5.3.7-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_5.3.7-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_5.3.7.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_5.3.8-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_5.3.8-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_5.3.8-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_5.3.8-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_5.3.8.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.3.7 ${DATA}/nco_5.3.7* ${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.7-1 -d nco-5.3.7 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.7 nco # Export most recent
-tar cvzf ./nco_5.3.7.orig.tar.gz --exclude='nco-5.3.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.7
-/bin/rm -rf ${DATA}/nco-5.3.7 # Remove cvs-exported directory
-tar xvzf ./nco_5.3.7.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-5.3.7/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-5.3.7/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-5.3.7/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-5.3.8 ${DATA}/nco_5.3.8* ${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.8-1 -d nco-5.3.8 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.8 nco # Export most recent
+tar cvzf ./nco_5.3.8.orig.tar.gz --exclude='nco-5.3.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.8
+/bin/rm -rf ${DATA}/nco-5.3.8 # Remove cvs-exported directory
+tar xvzf ./nco_5.3.8.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-5.3.8/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-5.3.8/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-5.3.8/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.3.7;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-5.3.7;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes
-cd ${DATA}/nco-5.3.7;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-5.3.8;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-5.3.8;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes
+cd ${DATA}/nco-5.3.8;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_5.3.7-1_*.deb
+sudo dpkg --install ${DATA}/nco_5.3.8-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.3.7-1_*.deb
-ls -l ${DATA}/nco_5.3.7*
+lintian ${DATA}/nco_5.3.8-1_*.deb
+ls -l ${DATA}/nco_5.3.8*
m ~/foo.nco
# Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_5.3.7* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_5.3.7* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_5.3.8* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_5.3.8* 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.3.7-1_*.changes
+# cd ${DATA};dupload -t mentors nco_5.3.8-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.3.7* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_5.3.8* # 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.3.7-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_5.3.7-1_*.changes
-lintian /var/cache/pbuilder/result/nco_5.3.7-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_5.3.8-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_5.3.8-1_*.changes
+lintian /var/cache/pbuilder/result/nco_5.3.8-1_*.deb
sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_5.3.7-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_5.3.8-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.3.7-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_5.3.8-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.3.7 ${DATA}/nco-5.3.7* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-5.3.8 ${DATA}/nco-5.3.8* # Cleanup last build
${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-5.3.7 \
-${rpm_root}/RPMS/i386/nco-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.3.7-?.i386.rpm \
-${rpm_root}/SOURCES/nco-5.3.7.tar.gz \
-${rpm_root}/SPECS/nco-5.3.7.spec \
-${rpm_root}/SRPMS/nco-5.3.7-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.7-1 -d nco-5.3.7 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-5.3.7.spec
-tar cvzf ./nco-5.3.7.tar.gz --exclude='nco-5.3.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.7
-${sudo_sng} /bin/cp ${DATA}/nco-5.3.7.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-5.3.8 \
+${rpm_root}/RPMS/i386/nco-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.8-?.i386.rpm \
+${rpm_root}/SOURCES/nco-5.3.8.tar.gz \
+${rpm_root}/SPECS/nco-5.3.8.spec \
+${rpm_root}/SRPMS/nco-5.3.8-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.8-1 -d nco-5.3.8 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-5.3.8.spec
+tar cvzf ./nco-5.3.8.tar.gz --exclude='nco-5.3.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.8
+${sudo_sng} /bin/cp ${DATA}/nco-5.3.8.tar.gz ${rpm_root}/SOURCES
cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-5.3.7.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-5.3.8.spec > ~/foo.nco 2>&1
scp \
-${rpm_root}/RPMS/i386/nco-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.3.7-?.i386.rpm \
-${rpm_root}/SRPMS/nco-5.3.7-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.8-?.i386.rpm \
+${rpm_root}/SRPMS/nco-5.3.8-?.src.rpm \
dust.ess.uci.edu:/var/www/html/nco/src
scp \
-${rpm_root}/RPMS/i386/nco-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-5.3.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-5.3.7-?.i386.rpm \
-${rpm_root}/SRPMS/nco-5.3.7-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-5.3.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-5.3.8-?.i386.rpm \
+${rpm_root}/SRPMS/nco-5.3.8-?.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.3.7 ${DATA}/nco-5.3.7* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-5.3.8 ${DATA}/nco-5.3.8* # Cleanup last build
/bin/rm -r -f \
-${rpm_root}/nco-5.3.7-?.src.rpm \
-${rpm_root}/nco-5.3.7.spec \
-${rpm_root}/nco-5.3.7.tar.gz \
-${rpm_root}/*/nco-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-devel-5.3.7-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.7-1 -d nco-5.3.7 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.7 nco # Export most recent and build as 5.3.7-1
-tar cvzf ./nco-5.3.7.tar.gz --exclude='nco-5.3.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.7
-/bin/cp ${DATA}/nco-5.3.7.tar.gz ${rpm_root}
+${rpm_root}/nco-5.3.8-?.src.rpm \
+${rpm_root}/nco-5.3.8.spec \
+${rpm_root}/nco-5.3.8.tar.gz \
+${rpm_root}/*/nco-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.8-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-5.3.8-1 -d nco-5.3.8 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.8 nco # Export most recent and build as 5.3.8-1
+tar cvzf ./nco-5.3.8.tar.gz --exclude='nco-5.3.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-5.3.8
+/bin/cp ${DATA}/nco-5.3.8.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.3.7-?.*.rpm
+rpmlint ${rpm_root}/*/nco-5.3.8-?.*.rpm
sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-5.3.7-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-5.3.8-?.*.rpm
scp \
-${rpm_root}/*/nco-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-devel-5.3.7-?.*.rpm \
-${rpm_root}/nco-5.3.7-?.*.src.rpm \
+${rpm_root}/*/nco-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.8-?.*.rpm \
+${rpm_root}/nco-5.3.8-?.*.src.rpm \
dust.ess.uci.edu:/var/www/html/nco/src
scp \
-${rpm_root}/*/nco-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-5.3.7-?.*.rpm \
-${rpm_root}/*/nco-devel-5.3.7-?.*.rpm \
-${rpm_root}/nco-5.3.7-?.*.src.rpm \
+${rpm_root}/*/nco-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-5.3.8-?.*.rpm \
+${rpm_root}/*/nco-devel-5.3.8-?.*.rpm \
+${rpm_root}/nco-5.3.8-?.*.src.rpm \
zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
=====================================
doc/index.shtml
=====================================
@@ -58,7 +58,7 @@ Try to disable Spammers' machines:
<td align="right" valign="top">
[<a href="https://acme-climate.atlassian.net/wiki/display/ACME/ACME+Home">ACME</a>]
[<a href="http://www.antlr.org">ANTLR</a>]
-[<a href="http://cfconventions.org/1.6.html">CF</a>]
+[<a href="https://cf-convention.github.io">CF</a>]
[<a href="https://wiki.earthdata.nasa.gov/display/ESDSWG/Dataset+Interoperability+Working+Group">DIWG</a>]
[<a href="http://www.gnu.org/software/gsl">GSL</a>]
[<a href="http://www.unidata.ucar.edu/software/netcdf">netCDF</a>]
@@ -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.7 released <!--#flastmod file="src/nco-5.3.7.tar.gz"-->
+Current stable NCO version is 5.3.8 released <!--#flastmod file="src/nco-5.3.8.tar.gz"-->
</h2>
<table border=0 width=100%>
@@ -155,7 +155,8 @@ and
<h2>Recent Releases & Milestones</h2>
<ul>
-<li>2026 Apr ??: 5.3.8 <i>In Progress...</i>
+<li>2026 May 10: 5.3.9 <i>In Progress...</i>
+<li>2026 Apr 10: 5.3.8 Instantaneous climos
<li>2026 Mar 31: 5.3.7 Flexible months
<li>2025 Oct 28: 5.3.6 E3SM-Unified 1.12
<li>2025 Sep 25: 5.3.5 GCC OpenMP
@@ -668,18 +669,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.7 http://github.com/nco/nco.git nco-5.3.7</tt></a>.
+<tt>git clone -b 5.3.8 http://github.com/nco/nco.git nco-5.3.8</tt></a>.
<ul>
-<li><b>NCO 5.3.9</b>: (<i>Future</i>)
+<li><b>NCO 5.4.0</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> Gracefully autoconvert N-D NC_STRING->(N+1)-D NC_CHAR variables;
<tt>ncremap</tt> small-circle weights;
-<li><b>NCO 5.3.8</b>: (<i>In Progress, features in-progress or complete include</i>)
+<li><b>NCO 5.3.9</b>: (<i>In Progress, features in-progress or complete include</i>)
<tt>ncremap --vrt</tt> works with 3D pressure fields (e.g., MERRA2)</li>
-<li><b>NCO 5.3.7</b>: (<i>Current Stable Release</i>)
+<li><b>NCO 5.3.8</b>: (<i>Current Stable Release</i>)
+<tt>ncclimo</tt> High-Frequency instantaneous climos;
+<tt>ncclimo</tt> Flexible months bugfixes</li>
+<li><b>NCO 5.3.7</b>:
<tt>ncks --l2d</tt> L2D chunking policy;
<tt>ncclimo --mth_srt/end</tt> Flexible month climos;
<tt>ncclimo --csn=dj,fma</tt> All 2/3-month seasons supported;
@@ -898,7 +902,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.7</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-5.3.8</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>
@@ -907,7 +911,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.7</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.8</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.
@@ -915,8 +919,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.7-1_i386.deb</tt>’):</dt>
-<li><a href="https://launchpad.net/ubuntu/+source/nco/5.3.7-1">nco_5.3.7-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.8-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/5.3.8-1">nco_5.3.8-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.
@@ -958,12 +962,12 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
<h3><a href="http://www.apple.com/macosx/">MacOS Darwin</a></h3>
<ul>
<!--
-# MacOS 26.3 (Sequoia) systems (sastrugi, spectral):
+# MacOS 26.3 (Tahoe) systems (maluhia, 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.7.macos.26.3.tar.gz nc*;scp ${DATA}/nco-5.3.7.macos.26.3.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-5.3.8.macos.26.3.tar.gz nc*;scp ${DATA}/nco-5.3.8.macos.26.3.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.7.macos.26.3.tar.gz">nco-5.3.7.macos.26.3.tar.gz</a> (<!--#fsize file="src/nco-5.3.7.macos.26.3.tar.gz"-->): Executables MacOS 26.3-compatible (last updated <!--#flastmod file="src/nco-5.3.7.macos.26.3.tar.gz"-->). Maintained by NCO Project.</li>
+<li><a href="src/nco-5.3.8.macos.26.3.tar.gz">nco-5.3.8.macos.26.3.tar.gz</a> (<!--#fsize file="src/nco-5.3.8.macos.26.3.tar.gz"-->): Executables MacOS 26.3-compatible (last updated <!--#flastmod file="src/nco-5.3.8.macos.26.3.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>
@@ -1166,12 +1170,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.7.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="https://github.com/nco/nco/archive/5.3.7.tar.gz">nco-5.3.7.tar.gz</a>
-(<!--#fsize file="src/nco-5.3.7.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-5.3.7.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-5.3.7.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha256 src/nco-5.3.7.tar.gz"-->
+<!-- scp ${DATA}/nco-5.3.8.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/5.3.8.tar.gz">nco-5.3.8.tar.gz</a>
+(<!--#fsize file="src/nco-5.3.8.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-5.3.8.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-5.3.8.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha256 src/nco-5.3.8.tar.gz"-->
</li>
</ul>
@@ -1192,8 +1196,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.7</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 5.3.7</tt></p>
+then checks out NCO version <tt>5.3.8</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 5.3.8</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
@@ -1203,12 +1207,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.7</tt>) and the development version is that the
+(e.g., <tt>5.3.8</tt>) and the development version is that the
tagged release operators will print a valid version number (e.g.,
-<tt>5.3.7</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>5.3.8</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.7-alpha06</tt>).
+information (e.g., <tt>5.3.8-alpha06</tt>).
<!--
<a name="doxy"></a>
@@ -1392,9 +1396,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.7.tar.gz</dt>
-<dt>tar xvzf 5.3.7.tar.gz</dt>
-<dt>cd nco-5.3.7</dt>
+<dt>wget https://github.com/nco/nco/archive/5.3.8.tar.gz</dt>
+<dt>tar xvzf 5.3.8.tar.gz</dt>
+<dt>cd nco-5.3.8</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.7
- at set doc-edition 5.3.7
+ at set nco-edition 5.3.8
+ at set doc-edition 5.3.8
@set copyright-years 1995--2026
@set update-year 2026
- at set update-date 31 March 2026
- at set update-month March 2026
+ at set update-date 10 April 2026
+ at set update-month April 2026
@settitle @acronym{NCO} @value{nco-edition} User Guide
@@ -6745,7 +6745,7 @@ the @command{ncap2} @code{where} statement for such grids
This feature works on datasets that associate coordinate variables to
grid-mappings using the @acronym{CF}-convention (@pxref{CF Conventions})
@code{coordinates} and @code{standard_name} attributes described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-system, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#coordinate-system, here}.
Currently, @acronym{NCO} understands auxiliary coordinate variables
pointed to by the @code{standard_name} attributes for @var{latitude} and
@var{longitude}.
@@ -13399,7 +13399,7 @@ metadata.
Skip this section if you never work with @acronym{CF} metadata.
The latest @acronym{CF} netCDF conventions are described
- at uref{http://cfconventions.org/1.10.html, here}.
+ at uref{https://cf-convention.github.io/1.10.html, here}.
Most @acronym{CF} netCDF conventions are transparent to @acronym{NCO}.
There are no known pitfalls associated with using any @acronym{NCO}
operator on files adhering to these conventions.
@@ -13563,7 +13563,7 @@ or alter the @code{Conventions} attribute.
As of @acronym{NCO} version 4.0.8 (April, 2011), @acronym{NCO}
supports the @acronym{CF} @code{bounds} convention for cell boundaries
described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#cell-boundaries, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#cell-boundaries, here}.
This convention allows coordinate variables (including multidimensional
coordinates) to describe the boundaries of their cells.
This is done by naming the variable which contains the bounds in
@@ -13600,7 +13600,7 @@ whenever the @code{lev} coordinate is also output.
As of @acronym{NCO} version 4.4.9 (May, 2015), @acronym{NCO}
supports the @acronym{CF} @code{climatology} convention for climatological
statistics described
- at uref{http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#climatological-statistics, here}.
+ at uref{https://cf-convention.github.io/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#climatological-statistics, here}.
This convention allows coordinate variables (including multidimensional
coordinates) to describe the (possibly nested) periods and statistical
methods of their associated statistics.
@@ -13626,7 +13626,7 @@ Climatology variables are subject to the user-specified override switches
As of @acronym{NCO} version 4.4.5 (July, 2014), @acronym{NCO}
supports the @acronym{CF} @code{ancillary_variables} convention for
described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#ancillary-data, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#ancillary-data, here}.
This convention allows ancillary variables to be associated with one or
more primary variables.
@acronym{NCO} attaches any such variables to the extraction list along
@@ -13648,7 +13648,7 @@ Ancillary variables are subject to the user-specified override switches
As of @acronym{NCO} version 4.6.4 (January, 2017), @acronym{NCO}
supports the @acronym{CF} @code{cell_measures} convention
described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#cell-measures, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#cell-measures, here}.
This convention allows variables to indicate which other variable or
variables contains area or volume information about a gridcell.
These measures variables are pointed to by the @code{cell_measures}
@@ -13692,7 +13692,7 @@ These options are available in all operators that perform subsetting
As of @acronym{NCO} version 4.6.4 (January, 2017), @acronym{NCO}
supports the @acronym{CF} @code{formula_terms} convention
described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#formula-terms, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#formula-terms, here}.
This convention encodes formulas used to construct (usually vertical)
coordinate grids.
The @acronym{CDL} specification of a vertical coordinate formula for
@@ -13737,7 +13737,7 @@ These options are available in all operators that perform subsetting
As of @acronym{NCO} version 4.6.0 (May, 2016), @acronym{NCO}
supports the @acronym{CF} @code{grid_mapping} convention for
described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#grid-mappings-and-projections, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#grid-mappings-and-projections, here}.
This convention allows descriptions of map-projections to be associated
with variables.
@acronym{NCO} attaches any such map-projection variables to the
@@ -13764,7 +13764,7 @@ switches (including @samp{-c} and @samp{-C}) described in
@cindex @code{--crd}
As of @acronym{NCO} version 3.9.6 (January, 2009), @acronym{NCO}
supports the @acronym{CF} @code{coordinates} convention described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-system, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#coordinate-system, here}.
This convention allows variables to specify additional coordinates
(including mult-idimensional coordinates) in a space-separated string
attribute named @code{coordinates}.
@@ -13783,7 +13783,7 @@ In particular, @command{ncwa} eliminates from the @code{coordinates}
attribute any dimension that it collapses, e.g., by averaging.
The former presence of this dimension will usually be indicated by the
@acronym{CF} @code{cell_methods} convention described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#cell-methods, here}.
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#cell-methods, here}.
Hence the @acronym{CF} @code{cell_methods} and @code{coordinates}
conventions can be said to work in tandem to characterize the state and
history of a variable's analysis.
@@ -13803,7 +13803,7 @@ history of a variable's analysis.
@cindex cell methods convention
As of @acronym{NCO} version 4.4.2 (February, 2014), @acronym{NCO}
supports some of the @acronym{CF} @code{cell_methods}
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#cell-methods, convention}
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#cell-methods, convention}
to describe the analysis procedures that have been applied to data.
The convention creates (or appends to an existing) @code{cell_methods}
attribute a space-separated list of couplets of the form @var{dmn: op}
@@ -29433,7 +29433,7 @@ The @samp{-V} option tells @command{ncremap} to use the same grid as
@var{var_rgr} in the input file.
If @var{var_rgr} adheres to the @acronym{CF} @code{coordinates}
convention described
- at uref{http://cfconventions.org/cf-conventions/cf-conventions.html#coordinate-system, here},
+ at uref{https://cf-convention.github.io/cf-conventions/cf-conventions.html#coordinate-system, here},
then @command{ncclimo} will infer the grid as represented by those
coordinate variables.
This option simplifies inferring grids when the grid coordinate names
=====================================
src/nco++/fmc_all_cls.cc
=====================================
@@ -6084,8 +6084,10 @@ var_sct *udunits_cls::clbtime_fnd(bool &, std::vector<RefAST> &args_vtr, fmc_cls
(void) fprintf(stderr,"unt_sng=%s cln_sng=%s\n", str_vtr[0].c_str(), str_vtr[1].c_str());
}
{
+ nco_lcn_typ lcn_typ=nco_lcn_typ_ctr;
iret = nco_clm_nfo_to_tm_bnds( var_md[0]->val.ip[0], var_md[1]->val.ip[0], var_md[2]->val.ip[0],
var_md[3]->val.ip[0], var_md[4]->val.ip[0],
+ lcn_typ,
str_vtr[0].c_str(), str_vtr[1].c_str(),
(var_md[7]->nbr_dim==2 ? var_md[7]->val.dp: NULL ), (var_md[7]->nbr_dim==1 ? var_md[7]->val.dp: NULL )
);
=====================================
src/nco/ncks.c
=====================================
@@ -776,7 +776,7 @@ main(int argc,char **argv)
if(!strcmp(opt_crr,"fpe") || !strcmp(opt_crr,"floating_point_exceptions")){
flg_fpe=True;
/* https://www.tutorialspoint.com/c_standard_library/c_function_fesetexceptflag.htm */
- fexcept_t flg_xcp;
+ fexcept_t flg_xcp=0;
// Clear all exceptions
feclearexcept(FE_ALL_EXCEPT);
if(fesetexceptflag(&flg_xcp,FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW) != 0){
=====================================
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 7
+# define NCO_VERSION_PATCH 8
#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.7"
+# define NCO_VERSION "5.3.8"
#endif /* !NCO_VERSION */
/* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -731,6 +731,8 @@ extern "C" {
nco_op_mebs, /* [enm] Mean absolute value */
nco_op_mibs, /* [enm] Minimum absolute value */
nco_op_tabs, /* [enm] Total absolute value */
+ // 20260406 Do not add nco_op_pnt yet as it requires further thought
+ // nco_op_pnt, /* [enm] Point value */
nco_op_nil /* [enm] Nil or undefined operation type */
}; /* !nco_op_typ enum */
@@ -750,6 +752,13 @@ extern "C" {
nco_obj_typ_nonatomic_var /* 2, Variable of non-atomic type (vlen, opaque, enum, compound, user-defined) */
} nco_obj_typ;
+ typedef enum nco_lcn_typ_enm{ /* [enm] Location of value within interval: lhs, ctr, rhs */
+ nco_lcn_typ_err=-1, /* -1 Invalid type for initialization */
+ nco_lcn_typ_lhs, /* 0, Value is at LHS of cell interval */
+ nco_lcn_typ_ctr, /* 1, Value is centered in cell interval */
+ nco_lcn_typ_rhs /* 2, Value is at RHS of cell interval */
+ } nco_lcn_typ;
+
enum nco_fmt_xtn{ /* [enm] Extended or underlying filetype */
/* 20131222: Tokens defined as of netCDF 4.3.1-rc7 */
nco_fmt_xtn_nil=NC_FORMAT_UNDEFINED, /* 0 Undefined (more precisely, not yet defined) */
=====================================
src/nco/nco_cln_utl.c
=====================================
@@ -469,6 +469,7 @@ nco_clm_nfo_to_tm_bnds /* [fnc] Compute and return climatological time and bound
int mth_srt, /* I [mth] Month at climo start [1..12] format */
int mth_end, /* I [mth] Month at climo end [1..12] format */
int tpd, /* I [nbr] Timesteps per day [0=monthly, 1=daily, 2, 3, 4, 6, 8, 12, 24=hourly, ...] */
+ nco_lcn_typ lcn_typ, /* I [enm] Time-value location within time interval */
const char *unt_sng, /* I [sng] Units of time coordinate (UDUnits format) */
const char *cln_sng, /* I [sng] Calendar string of time coordinate (UDUnits format, NULL=none) */
double *bnd_val, /* O [frc] Climatology bounds variable values */
@@ -494,7 +495,7 @@ nco_clm_nfo_to_tm_bnds /* [fnc] Compute and return climatological time and bound
if(!cln_sng){
(void)fprintf(stdout,"%s: WARNING %s called with empty calendar string, will adopt default calendar \"noleap\"\n",nco_prg_nm_get(),fnc_nm);
/* Default to noleap (365-day) calendar used by most ESMs */
- if(!cln_sng) cln_sng=(char *)strdup("noleap");
+ cln_sng=(char *)strdup("noleap");
} /* !cln_sng */
cln_typ=nco_cln_get_cln_typ(cln_sng);
@@ -505,20 +506,22 @@ nco_clm_nfo_to_tm_bnds /* [fnc] Compute and return climatological time and bound
/* Move end forward one month */
if(++mth_end == 13){
mth_end=1;
- yr_end++;
+ yr_end++;
} /* !mth_end */
sprintf(end_sng,"seconds since %d-%d-01",yr_end,mth_end);
+ if(nco_dbg_lvl_get() >= nco_dbg_vrb) (void)fprintf(stderr,"%s: DEBUG %s reports yr_srt = %d, yr_end = %d, mth_srt = %d, mth_end = %d, tpd = %d, lcn_typ = %d, unt_sng = %s, cln_sng = %s\n",nco_prg_nm_get(),fnc_nm,yr_srt,yr_end,mth_srt,mth_end,tpd,(int)lcn_typ,unt_sng,cln_sng);
+
if(tpd == 0){
if(tm_val){
tm_val[0]=0.0;
- /* find day in middle of month - see day_mid */
+ /* Find day in middle of month - see day_mid */
sprintf(md_sng,"seconds since %d-%d-%d",yr_srt,mth_srt,day_mid);
if(nco_cln_clc_dbl_var_dff(md_sng,unt_sng,cln_typ,&tm_val[0],(var_sct *)NULL) != NCO_NOERR)
return NCO_ERR;
- }
+ } /* !tm_val */
if(bnd_val){
bnd_val[0]=0.0;
@@ -539,9 +542,18 @@ nco_clm_nfo_to_tm_bnds /* [fnc] Compute and return climatological time and bound
if(tm_val){
var_tmp->sz=tpd;
- for(idx=0;idx<tpd;idx++)
- tm_val[idx]=(step/2 + step*idx)*3600;
+ /* 20260408: Normal (cell_methods = mean) time coordinate values are midpoints of time interval
+ Use lcn_typ to place time coordinate values at beginning or end of time interval
+ This is a kludge that causes time values to match EAMxx instantaneous timeseries that tend
+ to be output regularly at hours, e.g., 6, 12, 18, 24 in each day.
+ If values are instead output at hours 0, 6, 12, 18 in each day then use enumerated flag */
+ for(idx=0;idx<tpd;idx++){
+ if(lcn_typ == nco_lcn_typ_ctr) tm_val[idx]=(step/2 + step*idx)*3600;
+ else if(lcn_typ == nco_lcn_typ_rhs) tm_val[idx]=step*(idx+1)*3600;
+ else if(lcn_typ == nco_lcn_typ_lhs) tm_val[idx]=step*idx*3600;
+ } /* !idx */
+
cast_void_nctype(NC_DOUBLE,&var_tmp->val);
var_tmp->val.dp=tm_val;
cast_nctype_void(NC_DOUBLE,&var_tmp->val);
@@ -564,9 +576,31 @@ nco_clm_nfo_to_tm_bnds /* [fnc] Compute and return climatological time and bound
var_tmp->sz=tpd*2;
+ /* Most relevant CF example is at
+ https://cf-convention.github.io/Data/cf-conventions/cf-conventions-1.13/cf-conventions.html#temperature-each-hour-of-climatological-day-ex */
for(idx=0;idx<tpd;idx++){
- bnd_val[2*idx]=(step*idx)*3600;
- bnd_val[2*idx+1]=bnd_val[2*idx]+srt_end_dff;
+ switch(lcn_typ){
+ case nco_lcn_typ_ctr:
+ // tm_val[idx]=(step/2 + step*idx)*3600;
+ bnd_val[2*idx]=(step*idx)*3600;
+ bnd_val[2*idx+1]=bnd_val[2*idx]+srt_end_dff;
+ break;
+ case nco_lcn_typ_rhs:
+ // For instantaneous data: Place same hour of day at end of month
+ // tm_val[idx]=step*(idx+1)*3600;
+ bnd_val[2*idx]=step*(idx+1)*3600;
+ bnd_val[2*idx+1]=bnd_val[2*idx]+srt_end_dff-step*3600;
+ break;
+ case nco_lcn_typ_lhs:
+ // tm_val[idx]=step*idx*3600;
+ bnd_val[2*idx]=step*idx*3600;
+ bnd_val[2*idx+1]=bnd_val[2*idx]+srt_end_dff-step*3600;
+ break;
+ default:
+ (void)fprintf(stderr,"%s: ERROR %s reports unknown interval location type\n",nco_prg_nm_get(),fnc_nm);
+ nco_dfl_case_generic_err((int)lcn_typ);
+ break;
+ } /* !lcn_typ */
} /* !idx */
cast_void_nctype(NC_DOUBLE,&var_tmp->val);
@@ -903,7 +937,7 @@ var_sct *var) /* I/O [var_sct] var values modified - can be NULL */
rcd=NCO_NOERR;
return rcd;
-} /* end UDUnits2 nco_cln_clc_dbl_var_dff() */
+} /* ! UDUnits2 nco_cln_clc_dbl_var_dff() */
/* This should be your first port of call to replicate the UDUnits2 command line application functionality
* val_unt_sng takes the form "value units" where val is interpreted as a double
=====================================
src/nco/nco_cln_utl.h
=====================================
@@ -180,6 +180,7 @@ extern "C" {
int mth_srt, /* I [mth] Month at climo start [1..12] format */
int mth_end, /* I [mth] Month at climo end [1..12] format */
int tpd, /* I [nbr] Timesteps per day [0=monthly, 1=daily, 2, 3, 4, 6, 8, 12, 24=hourly, ...] */
+ nco_lcn_typ lcn_typ, /* I [enm] Time value location within time interval */
const char *unt_sng, /* I [sng] Units of time coordinate (UDUnits format) */
const char *cln_sng, /* I [sng] Calendar string of time coordinate (UDUnits format, NULL=none) */
double *bnd_val, /* O [frc] Climatology bounds variable values */
=====================================
src/nco/nco_cnv_csm.c
=====================================
@@ -604,7 +604,7 @@ nco_cnv_cf_cll_mth_add /* [fnc] Add cell_methods attributes */
const trv_tbl_sct * const trv_tbl) /* I [sct] Traversal table */
{
/* Purpose: Add/modify CF cell_methods attribute
- http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#cell-methods
+ https://cf-convention.github.io/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#cell-methods
cell_methods values and description:
point : Data values are representative of points in space or time (instantaneous)
@@ -681,8 +681,9 @@ nco_cnv_cf_cll_mth_add /* [fnc] Add cell_methods attributes */
if(cb->tpd > 1) cll_mth_clm=strdup("time: mean within days time: mean within years time: mean over years");
else if(cb->bnd2clm || cb->clm2clm) cll_mth_clm=strdup("time: mean within years time: mean over years");
else if(cb->clm2bnd) cll_mth_clm=strdup("time: mean");
+ else if(cb->bnd_mk) cll_mth_clm=strdup("time: point");
else{
- (void)fprintf(stdout,"%s: ERROR %s reports climatology bounds error with variable %s\n",nco_prg_nm_get(),fnc_nm,var_trv->nm);
+ (void)fprintf(stdout,"%s: ERROR %s reports climatology bounds error with variable %s\n",nco_prg_nm_get(),fnc_nm,var_trv->nm); /* 20260407: var_trv is undefined here */
nco_exit(EXIT_FAILURE);
} /* !cb->tpd */
} /* !cb */
@@ -760,7 +761,7 @@ nco_cnv_cf_cll_mth_add /* [fnc] Add cell_methods attributes */
case nco_op_max: strcpy(att_op_sng,"maximum"); break;
case nco_op_ttl: strcpy(att_op_sng,"sum"); break;
case nco_op_avgsqr: strcpy(att_op_sng,"variance"); break; /* Mean of sum of squares */
- /* Remaining operations are supported by NCO yet are not in CF Conventions */
+ /* Remaining operations are supported by NCO yet were not originally in CF Conventions */
case nco_op_mabs: strcpy(att_op_sng,"maximum_absolute_value"); break; /* Maximum absolute value */
case nco_op_mebs: strcpy(att_op_sng,"mean_absolute_value"); break; /* Mean absolute value */
case nco_op_mibs: strcpy(att_op_sng,"minimum_absolute_value"); break; /* Minimum absolute value */
@@ -835,7 +836,7 @@ nco_cnv_cf_cll_mth_add /* [fnc] Add cell_methods attributes */
Four-step methods (e.g., climatological ANN) with one timestep should have time-bounds attribute
cell_methods = "time: mean"
20200809:
- http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#climatological-statistics Example 7.13
+ https://cf-convention.github.io/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#climatological-statistics Example 7.13
Two-step methods with multiple timesteps (e.g., climatological diurnal cycle for March) should have climatology-bounds attribute
cell_methods = "time: cell_methods="time: mean within days time: mean over days time: mean over years";
Three-step methods with multiple timesteps (e.g., climatological diurnal cycle for MAM) should have climatology-bounds attribute
=====================================
src/nco/nco_cnv_csm.h
=====================================
@@ -34,10 +34,11 @@ extern "C" {
/* Climatology bounds structure (20160503: Used only in ncra.c for climos) */
typedef struct{ /* clm_bnd_sct */
- char *bnd_dmn_nm; /* [sng] Bounds dimension name name */
+ char *bnd_dmn_nm; /* [sng] Bounds dimension name */
char *clm_bnd_nm; /* [sng] Climatology bounds variable name (to create) */
char *tm_bnd_nm; /* [sng] Time bounds variable name (to delete) */
char *tm_crd_nm; /* [sng] Name of time coordinate variable */
+ char *cll_mth_val; /* [sng] Cell methods value */
char *cln_val; /* [sng] Bounds calendar value */
char *unt_val; /* [sng] Bounds units value */
double *tm_val; /* [frc] Time coordinate variable values */
@@ -57,11 +58,14 @@ extern "C" {
long dmn_srt_srt[2]; /* [idx] Start indices for retrieving start bounds */
long dmn_srt_end[2]; /* [idx] Start indices for retrieving end bounds */
nc_type type; /* [enm] Type of (time and) climatology bounds variable(s) */
+ nco_bool bnd_mk; /* [flg] Create time bounds from clm_nfo_sng */
nco_bool bnd2clm; /* [flg] Convert time bounds to climatology bounds */
nco_bool clm2bnd; /* [flg] Convert climatology bounds to time bounds */
nco_bool clm2clm; /* [flg] Convert climatology bounds to climatology bounds */
nco_bool clm_bnd_in; /* [flg] Climatology bounds appear in input */
+ nco_bool cll_mth_pnt; /* [flg] Assume values cell_method is "time: point" */
nco_bool tm_bnd_in; /* [flg] Time bounds appear in input */
+ nco_lcn_typ lcn_typ; /* [enm] Time-value location within time interval */
} clm_bnd_sct; /* end climatology bounds structure */
int /* O [rcd] Return code */
=====================================
src/nco/nco_grp_utl.c
=====================================
@@ -1475,7 +1475,7 @@ nco_xtr_cf_var_add /* [fnc] Add variables associated (via CF) with specified var
{
/* Detect associated variables specified by CF "ancillary_variables", "bounds", "climatology", "coordinates", "grid_mapping", and "quantization" conventions
Private routine called by nco_xtr_cf_add()
- http://cfconventions.org/1.6.html#ancillary-data
+ https://cf-convention.github.io/1.6.html#ancillary-data
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.1/cf-conventions.html#coordinate-system */
char **cf_lst=NULL_CEWI; /* [sng] 1D array of list elements */
@@ -1513,7 +1513,7 @@ nco_xtr_cf_var_add /* [fnc] Add variables associated (via CF) with specified var
if(att_typ == NC_STRING){
;
// 20230815 NC_STRING Support added, and WARNING deprecated
- // (void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, NCO will skip this attribute.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_trv->nm_fll,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING));
+ // (void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, NCO will skip this attribute.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_trv->nm_fll,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING));
// if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"att_nm = %s, att_typ = %s, att_sz = %ld\n",att_nm,nco_typ_sng(att_typ),att_sz);
}else if(att_typ != NC_CHAR){
(void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s. This violates the CF Conventions which allow only datatypes %s and %s for attribute %s. NCO will skip this attribute.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_trv->nm_fll,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING),cf_nm);
@@ -8760,7 +8760,7 @@ nco_var_has_cf /* [fnc] Variable has CF-compliant attributes ("ancillary_variabl
(void)nco_inq_att(grp_id,var_id,att_nm,&att_typ,&att_sz);
/* 20230812: NB this routine is superceded by nco_xtr_cf_var_add() and nco_is_spc_in_cf_att() */
if(att_typ != NC_CHAR){
- (void)fprintf(stderr,"%s: WARNING \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_trv->nm_fll,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_trv->nm_fll,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING),fnc_nm);
return NULL;
} /* !att_typ */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
=====================================
src/nco/nco_rgr.c
=====================================
@@ -11556,7 +11556,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
double lon_dff; /* [dgr] Current longitude difference between adjacent cells */
double lon_dff_max; /* [dgr] Maximum longitude difference between adjacent cells */
double lon_dff_max_thr; /* [dgr] Threshold maximum longitude difference between adjacent cells for branch cut */
- nco_bool flg_2D_brnch_cut=False; /* [flg] Domain of 2D grid crosses longitude branch cut */
+ // nco_bool flg_2D_brnch_cut=False; /* [flg] Domain of 2D grid crosses longitude branch cut */
idx_ctr=0;
if(has_mss_val_ctr){
/* Find first non-missing value center and thus corners */
@@ -11617,7 +11617,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
if((float)lon_dff_max > lon_dff_max_thr){
(void)fprintf(stderr,"%s: INFO %s Greatest angle between adjacent longitudes in 2D grid exceeds lon_dff_max_thr = %g degrees (lon_dff_max = %g) which implies that this grid crosses the longitudinal branch cut\n",nco_prg_nm_get(),fnc_nm,lon_dff_max_thr,lon_dff_max);
(void)fprintf(stderr,"%s: INFO %s Recomputing longitude span by placing all longitudes on same branch cut\n",nco_prg_nm_get(),fnc_nm);
- flg_2D_brnch_cut=True;
+ //flg_2D_brnch_cut=True;
} /* lon_dff_max */
} /* !flg_grd_2D */
/* Use strict rules for rectangular grids, looser for spans that are inferred, or center-to-center not corner-to-corner */
=====================================
src/nco/nco_rth_utl.c
=====================================
@@ -228,7 +228,7 @@ nco_op_typ_cf_sng /* [fnc] Convert arithmetic operation type enum to string */
(const int nco_op_typ) /* I [enm] Arithmetic operation type */
{
/* Purpose: Convert arithmetic operation type enum to string for use in CF Cell Methods
- http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#cell-methods */
+ https://cf-convention.github.io/Data/cf-conventions/cf-conventions-1.7/build/cf-conventions.html#cell-methods */
switch(nco_op_typ){
case nco_op_avg: return "mean"; break; /* [enm] Average */
case nco_op_min: return "minimum"; break; /* [enm] Minimum value */
=====================================
src/nco/nco_scm.c
=====================================
@@ -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 "Sleeping Dolphins";
+ return "Field Trip Fest";
} /* !nco_nmn_get() */
void
=====================================
src/nco/nco_var_lst.c
=====================================
@@ -314,7 +314,7 @@ nco_var_lst_crd_add /* [fnc] Add all coordinates to extraction list */
/* Yes, get list of specified attributes */
(void)nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return xtr_lst;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -399,7 +399,7 @@ nco_var_lst_crd_add /* [fnc] Add all coordinates to extraction list */
/* Yes, get list of specified attributes */
(void)nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return xtr_lst;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -540,7 +540,7 @@ nco_var_lst_crd_ass_add /* [fnc] Add to extraction list all coordinates associat
/* Yes, get list of specified attributes */
(void)nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return xtr_lst;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -621,7 +621,7 @@ nco_var_lst_crd_ass_add /* [fnc] Add to extraction list all coordinates associat
/* Yes, get list of specified attributes */
(void)nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,xtr_lst[idx_var].nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return xtr_lst;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -1104,7 +1104,7 @@ nco_var_lst_dvd /* [fnc] Divide input lists into output lists */
*var_prc_ptr=(var_sct **)nco_realloc(var_prc,*nbr_var_prc*sizeof(var_sct *));
*var_prc_out_ptr=(var_sct **)nco_realloc(var_prc_out,*nbr_var_prc*sizeof(var_sct *));
-} /* end nco_var_lst_dvd() */
+} /* !nco_var_lst_dvd() */
void
nco_var_lst_dvd_ncbo /* [fnc] Divide input lists into output lists (ncbo only) */
=====================================
src/nco/nco_var_utl.c
=====================================
@@ -1430,7 +1430,7 @@ nco_is_spc_in_cf_att /* [fnc] Variable is listed in this CF attribute, thereby a
if(att_typ == NC_STRING){
// 20230815 NC_STRING Support added, and WARNING deprecated
;
- // if(FIRST_WARNING) (void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, NCO will skip this attribute. NB: To avoid excessive noise, NCO prints this WARNING at most once per dataset.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING));
+ // if(FIRST_WARNING) (void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s, not %s. This violated the CF Conventions for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types) until about CF-1.8 released in 2019, when CF introduced support for attributes of (extended) type %s. NCO support for this feature is currently underway and is trackable at https://github.com/nco/nco/issues/274. Until this support is complete, NCO will skip this attribute. NB: To avoid excessive noise, NCO prints this WARNING at most once per dataset.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING));
}else if(att_typ != NC_CHAR){
if(FIRST_WARNING) (void)fprintf(stderr,"%s: WARNING %s reports \"%s\" attribute for variable %s is type %s. This violates the CF Conventions which allow only datatypes %s and %s for attribute %s. Will skip this attribute. NB: To avoid excessive noise, NCO prints this WARNING at most once per dataset.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),nco_typ_sng(NC_STRING),cf_nm);
FIRST_WARNING=False;
@@ -1630,7 +1630,7 @@ nco_is_spc_in_crd_att /* [fnc] Variable is listed in a "coordinates" attribute *
rcd+=nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
rcd+=nco_inq_varname(nc_id,var_id,var_nm);
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return IS_SPC_IN_CRD_ATT;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -1705,7 +1705,7 @@ nco_is_spc_in_bnd_att /* [fnc] Variable is listed in a "bounds" attribute */
rcd+=nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
rcd+=nco_inq_varname(nc_id,var_id,var_nm);
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return IS_SPC_IN_BND_ATT;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -1781,7 +1781,7 @@ nco_is_spc_in_clm_att /* [fnc] Variable is listed in a "climatology" attribute *
rcd+=nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
rcd+=nco_inq_varname(nc_id,var_id,var_nm);
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return IS_SPC_IN_CLM_ATT;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
@@ -1857,7 +1857,7 @@ nco_is_spc_in_grd_att /* [fnc] Variable is listed in a "grid_mapping" attribute
rcd+=nco_inq_att(nc_id,var_id,att_nm,&att_typ,&att_sz);
if(att_typ != NC_CHAR){
rcd+=nco_inq_varname(nc_id,var_id,var_nm);
- (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (http://cfconventions.org/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
+ (void)fprintf(stderr,"%s: WARNING the \"%s\" attribute for variable %s is type %s, not %s. This violates the CF convention for allowed datatypes (https://cf-convention.github.io/cf-conventions/cf-conventions.html#_data_types). Therefore %s will skip this attribute.\n",nco_prg_nm_get(),att_nm,var_nm,nco_typ_sng(att_typ),nco_typ_sng(NC_CHAR),fnc_nm);
return IS_SPC_IN_GRD_ATT;
} /* end if */
att_val=(char *)nco_malloc((att_sz+1L)*sizeof(char));
=====================================
src/nco/ncra.c
=====================================
@@ -979,12 +979,16 @@ main(int argc,char **argv)
char clm_sng[]="climatology"; /* CF-standard climatology bounds attribute name */
char cln_sng[]="calendar"; /* CF-standard calendar attribute name */
char unt_sng[]="units"; /* NUG-standard units attribute name */
+ char cll_mth_pnt_sng[]="point"; /* CF value for instantaneous/point intervals within cells */
long att_sz;
nc_type att_typ;
cb=(clm_bnd_sct *)nco_malloc(sizeof(clm_bnd_sct));
+ cb->bnd_mk=False; /* [flg] Create time bounds */
cb->bnd2clm=False; /* [flg] Convert time-bounds to climatology bounds */
cb->bnd_val=NULL; /* [frc] Time coordinate variable values */
+ cb->cll_mth_pnt=False; /* [flg] Assume values cell_method is "time: point" */
+ cb->cll_mth_val=NULL; /* [sng] Cell methods value */
cb->clm2bnd=False; /* [flg] Convert climatology bounds to time-bounds */
cb->clm2clm=False; /* [flg] Convert climatology bounds to climatology bounds */
cb->clm_bnd_id_in=NC_MIN_INT; /* [id] Climatology bounds ID */
@@ -994,6 +998,7 @@ main(int argc,char **argv)
cb->cln_val=NULL; /* [sng] Bounds calendar value */
cb->dmn_srt_end[0]=0L;cb->dmn_srt_end[1]=1L;
cb->dmn_srt_srt[0]=0L;cb->dmn_srt_srt[1]=0L;
+ cb->lcn_typ=nco_lcn_typ_ctr; /* [enm] Time-value location within time interval */
cb->mth_end=NC_MIN_INT; /* [mth] Month at climo end [1..12] format */
cb->mth_srt=NC_MIN_INT; /* [mth] Month at climo start [1..12] format */
cb->tm_bnd_id_in=NC_MIN_INT; /* [id] Time-bounds ID */
@@ -1044,9 +1049,21 @@ main(int argc,char **argv)
goto skp_cb;
} /* !(cb->tm_bnd_in && cb->clm_bnd_in) */
if(!cb->tm_bnd_in && !cb->clm_bnd_in){
- (void)fprintf(stderr,"%s: WARNING Climatology bounds invoked on time coordinate with neither time bounds attribute \"%s\" nor climatology bounds attribute \"%s\". No way to obtain bounding time values. Turning-off climatology bounds mode.\n",nco_prg_nm_get(),bnd_sng,clm_sng);
- flg_cb=False;
- goto skp_cb;
+ if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO Climatology bounds invoked on time coordinate with neither time bounds attribute \"%s\" nor climatology bounds attribute \"%s\". Will add bounds attribute to time coordinate, then create the bounds variable with values from clm_nfo_sng argument. Assumption is that the time-varying geophysical fields are instanteous/point data at the RHS of the regular time interval.\n",nco_prg_nm_get(),bnd_sng,clm_sng);
+
+ /* 20260406: Point data with no time_bounds variables end up here
+ Create time_bounds variable in output file based on clm_nfo_sng arguments
+ Set special flag here and do variable creation after main loop to protect traversal table */
+
+ /* fxm: How to make this contingent on method=point when input variables' cell_methods can differ? */
+ cb->bnd_mk=True;
+ cb->cll_mth_pnt=True;
+
+ /* Add Global attribute */
+ char gaa_pnt[]="climo_time_cell_method=point";
+ gaa_arg=(char **)nco_realloc(gaa_arg,(gaa_nbr+1)*sizeof(char *));
+ gaa_arg[gaa_nbr++]=(char *)strdup(gaa_pnt);
+ (void)nco_glb_att_add(out_id,gaa_arg+gaa_nbr-1,1);
} /* !cb->tm_bnd_in && !cb->clm_bnd_in */
}else{ /* !tm_crd_id_in */
@@ -1056,11 +1073,25 @@ main(int argc,char **argv)
goto skp_cb;
} /* !tm_crd_in */
+ /* Was input file derived from instantaneous/point data? */
+ char tm_cll_mth_att[]="climo_time_cell_method";
+ rcd=nco_inq_att_flg(in_id,NC_GLOBAL,tm_cll_mth_att,&att_typ,&att_sz);
+ if(rcd == NC_NOERR && att_typ == NC_CHAR){
+ cb->cll_mth_val=(char *)nco_malloc((att_sz+1L)*nco_typ_lng(att_typ));
+ rcd+=nco_get_att(in_id,NC_GLOBAL,tm_cll_mth_att,cb->cll_mth_val,att_typ);
+ /* NUL-terminate attribute before using strstr() */
+ cb->cll_mth_val[att_sz]='\0';
+
+ if(!strcmp(cb->cll_mth_val,cll_mth_pnt_sng)) cb->cll_mth_pnt=True;
+
+ if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stderr,"%s: INFO Climatology bounds detects that input dataset time and bounds assume geophysical variables have cell_methods=\"time: point\". Derived dataset will adhere to this assumption.\n",nco_prg_nm_get());
+ } /* !rcd */
+
if(cb->tm_bnd_in){
rcd=nco_inq_varid_flg(in_id,cb->tm_bnd_nm,&cb->tm_bnd_id_in);
if(cb->tm_bnd_id_in == NC_MIN_INT){
if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stderr,"%s: WARNING Climatology bounds invoked on dataset with missing time bounds variable \"%s\". Turning-off climatology bounds mode.\n",nco_prg_nm_get(),cb->tm_bnd_nm);
- flg_cb=False;
+ flg_cb=False; /* 20260406: It should be OK to be missing time_bounds */
rcd=NC_NOERR;
goto skp_cb;
} /* !tm_bnd_id_in */
@@ -1076,12 +1107,15 @@ main(int argc,char **argv)
} /* !tm_bnd_id_in */
} /* !clm_bnd_in */
- rcd=nco_inq_varid_flg(out_id,cb->tm_crd_nm,&cb->tm_crd_id_out);
- if(rcd != NC_NOERR){
- if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stderr,"%s: ERROR Climatology bounds did not find time coordinate in output file\n",nco_prg_nm_get());
- nco_exit(EXIT_FAILURE);
- } /* !tm_crd_id_out */
-
+ /* Bounds DNE yet and will be created later iff cb->bnd_mk */
+ if(!cb->bnd_mk){
+ rcd=nco_inq_varid_flg(out_id,cb->tm_crd_nm,&cb->tm_crd_id_out);
+ if(rcd != NC_NOERR){
+ if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stderr,"%s: ERROR Climatology bounds did not find time coordinate in output file\n",nco_prg_nm_get());
+ nco_exit(EXIT_FAILURE);
+ } /* !tm_crd_id_out */
+ } /* !cb->bnd_mk */
+
/* Populate cb structure with information from clm_nfo_sng */
if(clm_nfo_sng) rcd=nco_clm_nfo_get(clm_nfo_sng,cb);
@@ -1142,6 +1176,23 @@ main(int argc,char **argv)
char *att_nm;
char *att_val;
+ if(cb->bnd_mk){
+ /* Add new bounds attribute to existing time coordinate
+ New bounds variable will be created after main loop */
+ att_nm=strdup(bnd_sng);
+ att_val=strdup(cb->tm_bnd_nm);
+ aed_mtd.att_nm=att_nm;
+ aed_mtd.var_nm=cb->tm_crd_nm;
+ aed_mtd.id=cb->tm_crd_id_out;
+ aed_mtd.sz=strlen(att_val);
+ aed_mtd.type=NC_CHAR;
+ aed_mtd.val.cp=att_val;
+ aed_mtd.mode=aed_create;
+ (void)nco_aed_prc(out_id,cb->tm_crd_id_out,aed_mtd);
+ if(att_nm) att_nm=(char *)nco_free(att_nm);
+ if(att_val) att_val=(char *)nco_free(att_val);
+ } /* !bnd_mk */
+
if(cb->bnd2clm || cb->clm2bnd){
/* Add new bounds attribute */
att_nm = (cb->bnd2clm) ? strdup(clm_sng) : strdup(bnd_sng);
@@ -1230,7 +1281,8 @@ main(int argc,char **argv)
} /* !rcd */
/* Combine calendar and units strings with clm_nfo_sng to create climatological time and bounds arrays */
- if(clm_nfo_sng) rcd=nco_clm_nfo_to_tm_bnds(cb->yr_srt,cb->yr_end,cb->mth_srt,cb->mth_end,cb->tpd,cb->unt_val,cb->cln_val,cb->bnd_val,cb->tm_val);
+ if(cb->cll_mth_pnt) cb->lcn_typ=nco_lcn_typ_rhs;
+ if(clm_nfo_sng) rcd=nco_clm_nfo_to_tm_bnds(cb->yr_srt,cb->yr_end,cb->mth_srt,cb->mth_end,cb->tpd,cb->lcn_typ,cb->unt_val,cb->cln_val,cb->bnd_val,cb->tm_val);
//assert(rcd != NCO_NOERR);
} /* !flg_cb */
@@ -1241,7 +1293,9 @@ main(int argc,char **argv)
if(!flg_cb)
if(cb) cb=(clm_bnd_sct *)nco_free(cb);
- /* Add cell_methods attributes (before exiting define mode) */
+ /* Add cell_methods attributes (before exiting define mode)
+ 20260408: fxm Also call this for nces/ncfe as used in ncclimo clm_md=hfc?
+ Is not calling this why bounds metadata are simple? */
if(nco_prg_id == ncra){
dmn_sct **dmn=NULL_CEWI;
int nbr_dmn=nbr_rec;
@@ -1816,32 +1870,14 @@ main(int argc,char **argv)
if(rec_usd_cml[idx_rec] <= 0){
(void)fprintf(fp_stdout,"%s: ERROR No records lay within specified hyperslab\n",nco_prg_nm_get());
nco_exit(EXIT_FAILURE);
- } /* end if */
- } /* end if */
+ } /* !rec_usd_cml */
+ } /* !fl_idx */
if(fl_udu_sng) fl_udu_sng=(char*)nco_free(fl_udu_sng);
nco_rgd_arr_lst_free(rgd_arr_bnds_lst,rgd_arr_bnds_nbr);
nco_rgd_arr_lst_free(rgd_arr_climo_lst,rgd_arr_climo_nbr);
- } /* end idx_rec loop over different record variables to process */
-
- if(!clm_nfo_sng && flg_cb && (nco_prg_id == ncra || nco_prg_id == ncrcat)){
- /* Obtain climatology bounds from input file
- 20200822: Deprecate this original method to obtain bounds
- 20160824: Currently dmn_srt_srt and dmn_srt_end indices are 0 and 1, respectively
- This means values are always/only taken for first record in input file
- Thus climatology_bounds are only correct for input files with single timestep
- To fix this requires updating dmn_srt_srt and dmn_srt_end with correct indices
- Correct indices must account for multiple input records per file and hyperslabbing (e.g., -d time,3,5) */
- int var_id_in;
- double val_dbl;
- var_id_in= cb->tm_bnd_in ? cb->tm_bnd_id_in : cb->clm_bnd_id_in;
- rcd=nco_get_var1(in_id,var_id_in,cb->dmn_srt_srt,&val_dbl,(nc_type)NC_DOUBLE);
- if(fl_idx == 0) cb->tm_val[0]=val_dbl;
- if(val_dbl < cb->bnd_val[0]) cb->bnd_val[0]=val_dbl;
- rcd=nco_get_var1(in_id,var_id_in,cb->dmn_srt_end,&val_dbl,(nc_type)NC_DOUBLE);
- if(val_dbl > cb->bnd_val[1]) cb->bnd_val[1]=val_dbl;
- } /* !flg_cb */
+ } /* !idx_rec loop over different record variables to process */
/* End ncra, ncrcat section */
}else if(nco_prg_id == ncfe){ /* ncfe */
@@ -1913,7 +1949,7 @@ main(int argc,char **argv)
/* Free current input buffer */
var_prc[idx]->val.vp=nco_free(var_prc[idx]->val.vp);
- } /* end (OpenMP parallel for) loop over idx */
+ } /* !idx (OpenMP parallel for) */
/* End ncfe section */
}else if(nco_prg_id == ncge){ /* ncge */
@@ -2103,7 +2139,7 @@ main(int argc,char **argv)
}else if(nco_prg_id == ncfe){
/* Edit group name for output */
if(gpe) grp_out_fll=nco_gpe_evl(gpe,var_trv->grp_nm_fll); else grp_out_fll=(char *)strdup(var_trv->grp_nm_fll);
- } /* end else */
+ } /* !ncge, !ncfe */
/* Obtain output group ID */
(void)nco_inq_grp_full_ncid(out_id,grp_out_fll,&grp_out_id);
@@ -2117,11 +2153,11 @@ main(int argc,char **argv)
if(nco_pck_plc == nco_pck_plc_all_new_att) var_prc_out[idx]=nco_put_var_pck(grp_out_id,var_prc_out[idx],nco_pck_plc);
if(var_trv->ppc != NC_MAX_INT){
if(var_trv->flg_nsd) (void)nco_ppc_bitmask(grp_out_id,var_prc_out[idx]->id,var_trv->ppc,var_prc_out[idx]->type,var_prc_out[idx]->sz,var_prc_out[idx]->has_mss_val,var_prc_out[idx]->mss_val,var_prc_out[idx]->val); else (void)nco_ppc_around(var_trv->ppc,var_prc_out[idx]->type,var_prc_out[idx]->sz,var_prc_out[idx]->has_mss_val,var_prc_out[idx]->mss_val,var_prc_out[idx]->val);
- } /* endif ppc */
+ } /* !ppc */
if(var_prc_out[idx]->nbr_dim == 0) (void)nco_put_var1(grp_out_id,var_prc_out[idx]->id,var_prc_out[idx]->srt,var_prc_out[idx]->val.vp,var_prc_out[idx]->type); else (void)nco_put_vara(grp_out_id,var_prc_out[idx]->id,var_prc_out[idx]->srt,var_prc_out[idx]->cnt,var_prc_out[idx]->val.vp,var_prc_out[idx]->type);
- } /* end loop over idx */
- } /* end if ncfe and ncge */
+ } /* !idx */
+ } /* !FLG_BFR_NRM ncfe and ncge */
/* Free averaging, tally, and weight buffers */
if(nco_prg_id == ncra || nco_prg_id == ncfe || nco_prg_id == ncge){
@@ -2129,9 +2165,34 @@ main(int argc,char **argv)
if((wgt_arr || wgt_nm) && var_prc[idx]->has_mss_val) var_prc_out[idx]->wgt_sum=var_prc[idx]->wgt_sum=(double *)nco_free(var_prc[idx]->wgt_sum);
var_prc_out[idx]->tally=var_prc[idx]->tally=(long *)nco_free(var_prc[idx]->tally);
var_prc_out[idx]->val.vp=nco_free(var_prc_out[idx]->val.vp);
- } /* end loop over idx */
- } /* endif ncra || nces */
+ } /* !idx */
+ } /* !ncra || nces */
+ if(flg_cb && cb->bnd_mk){
+ /* 20260407: Create time_bounds variable based on clm_nfo_sng */
+ char dim2_nm[]="dim2"; /* CF-standard time-bounds attribute name */
+ const int dmn_nbr_2D=2; /* [nbr] Rank of 2-D grid variables */
+ int *clm_bnd_dmn_id; /* [ID] Climatology bounds dimension IDs */
+ int dim2_id; /* [ID] Size-2 dimension ID */
+ int tm_crd_dmn_id; /* [ID] Dimension ID of time coordinate */
+
+ rcd+=nco_redef(out_id);
+
+ rcd=nco_inq_dimid_flg(out_id,dim2_nm,&dim2_id);
+ rcd=nco_inq_dimid(out_id,cb->tm_crd_nm,&tm_crd_dmn_id);
+ /* Define dimension of size 2 for bounds arrays */
+ rcd=nco_inq_dimid_flg(out_id,dim2_nm,&dim2_id);
+ if(rcd != NC_NOERR) rcd=nco_def_dim(out_id,dim2_nm,dmn_nbr_2D,&dim2_id);
+ clm_bnd_dmn_id=(int *)nco_malloc(dmn_nbr_2D*sizeof(int));
+ clm_bnd_dmn_id[0]=tm_crd_dmn_id;
+ clm_bnd_dmn_id[1]=dim2_id;
+ rcd=nco_def_var(out_id,cb->tm_bnd_nm,(nc_type)NC_DOUBLE,dmn_nbr_2D,clm_bnd_dmn_id,&cb->clm_bnd_id_out);
+ if(clm_bnd_dmn_id) clm_bnd_dmn_id=(int *)nco_free(clm_bnd_dmn_id);
+
+ /* fxm Copy coordinate attributes to new bounds variable */
+ rcd+=nco_enddef(out_id);
+ } /* !flg_cb */
+
if(flg_cb && (nco_prg_id == ncra || nco_prg_id == ncrcat || nco_prg_id == ncfe)){
rcd=nco_put_var(out_id,cb->tm_crd_id_out,cb->tm_val,(nc_type)NC_DOUBLE);
rcd=nco_put_var(out_id,cb->clm_bnd_id_out,cb->bnd_val,(nc_type)NC_DOUBLE);
View it on GitLab: https://salsa.debian.org/debian-gis-team/nco/-/commit/a0fbd2f9aa7f20545c2629d2d409763d6f5072a8
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/nco/-/commit/a0fbd2f9aa7f20545c2629d2d409763d6f5072a8
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/20260411/badf593d/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list