[nco] 02/06: New upstream version 4.6.8

Bas Couwenberg sebastic at debian.org
Wed Aug 16 19:29:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository nco.

commit 00737a4bcc109c6dfc56014cb502f0e5c531210c
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Aug 16 21:14:21 2017 +0200

    New upstream version 4.6.8
---
 CMakeLists.txt           |   7 +
 Makefile.am              |   1 +
 Makefile.in              |  13 +-
 aclocal.m4               |  50 ++---
 bld/Makefile             |   4 +-
 bld/nco.spec             |  11 +-
 bld/nco_dst.pl           |  30 +--
 bm/NCO_bm.pm             |   3 +-
 bm/NCO_rgr.pm            | 133 ++++++++++--
 configure                |  49 +++--
 configure.ac             |  34 ++-
 configure.eg             |  59 ++---
 data/Makefile.am         |   2 +-
 data/Makefile.in         |   6 +-
 data/bsc_tst.nco         |  32 ++-
 data/buggy.cdl           |  10 +-
 data/clc.cdl             |   2 +-
 data/in.cdl              |  27 ++-
 data/ncclimo             | 550 +++++++++++++++++++++++++++++++++++------------
 data/ncremap             | 147 +++++++++----
 data/nsm.cdl             |   4 +-
 data/string.nco          |  35 +++
 data/tms.cdl             |  73 +++++++
 debian/changelog         |   6 +
 doc/ANNOUNCE             | 205 ++++++++----------
 doc/ChangeLog            | 214 +++++++++++++++++-
 doc/Makefile.in          |   4 +-
 doc/TODO                 |  14 +-
 doc/VERSION              |   2 +-
 doc/debian.txt           | 162 +++++++-------
 doc/index.shtml          | 127 ++++++-----
 doc/nco.texi             | 309 ++++++++++++++++++++------
 man/Makefile.in          |   4 +-
 man/ncap.1               |   2 +-
 man/ncap2.1              |   2 +-
 man/ncbo.1               |   2 +-
 man/ncclimo.1            |   3 +-
 man/ncecat.1             |   2 +-
 man/nces.1               |   2 +-
 man/ncflint.1            |   2 +-
 man/ncks.1               |   2 +-
 man/ncpdq.1              |   2 +-
 man/ncra.1               |   2 +-
 man/ncrcat.1             |   2 +-
 man/ncremap.1            |   5 +-
 man/ncwa.1               |   2 +-
 src/Makefile.in          |   4 +-
 src/nco++/Makefile.in    |   4 +-
 src/nco++/fmc_all_cls.cc |  26 ++-
 src/nco++/fmc_all_cls.hh |   2 +-
 src/nco++/ncap2.cc       |  26 ++-
 src/nco++/ncap2_att.cc   |  42 ++--
 src/nco++/ncap2_utl.cc   |  30 ++-
 src/nco++/ncap2_utl.hh   |   5 +-
 src/nco++/ncoGrammer.g   |  34 ++-
 src/nco++/ncoTree.cpp    |  40 +++-
 src/nco++/ncoTree.hpp    |   2 +-
 src/nco++/prs_cls.cc     |  89 +++++++-
 src/nco++/prs_cls.hh     |  15 +-
 src/nco/Makefile.in      |   4 +-
 src/nco/ncap_lex.l       |   3 +-
 src/nco/ncks.c           |  13 +-
 src/nco/nco.h            |  16 +-
 src/nco/nco_att_utl.c    |   2 +-
 src/nco/nco_cln_utl.c    |  30 +--
 src/nco/nco_cln_utl.h    |   2 +-
 src/nco/nco_cnk.c        |  35 ++-
 src/nco/nco_cnv_csm.c    |   3 +
 src/nco/nco_ctl.c        |  18 +-
 src/nco/nco_fl_utl.c     |   2 +-
 src/nco/nco_grp_utl.c    | 414 ++++++++++++++++++++++++++++++-----
 src/nco/nco_grp_utl.h    |  24 ++-
 src/nco/nco_mmr.c        |   6 +-
 src/nco/nco_msa.c        |  96 ++++++++-
 src/nco/nco_msa.h        |   8 +-
 src/nco/nco_mta.c        |   8 +-
 src/nco/nco_mta.h        |   4 +
 src/nco/nco_netcdf.c     |  18 +-
 src/nco/nco_omp.c        |   2 +-
 src/nco/nco_pck.c        |   9 +-
 src/nco/nco_prn.c        | 217 ++++++-------------
 src/nco/nco_prn.h        |   3 -
 src/nco/nco_rgr.c        | 185 +++++++++++-----
 src/nco/nco_rgr.h        |   1 +
 src/nco/nco_scm.c        |   4 +-
 src/nco/nco_sng_utl.c    |  29 ++-
 src/nco/nco_uthash.h     |  14 +-
 src/nco/nco_var_utl.c    |   6 +-
 src/nco/ncpdq.c          |   2 +-
 src/nco/ncra.c           |   4 +-
 src/nco/ncwa.c           |  22 +-
 src/nco_c++/Makefile.in  |   4 +-
 92 files changed, 2807 insertions(+), 1079 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7d08fb..5f6d8c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,7 @@ set(BUILD_SHARED_LIBRARIES OFF)
 #//////////////////////////
 
 add_definitions(-DHAVE_NETCDF4_H)
+add_definitions(-DENABLE_NETCDF4)
 if (MSVC)
 
   #//////////////////////////
@@ -211,6 +212,9 @@ add_executable(ncflint src/nco/ncflint.c)
 add_executable(ncpdq src/nco/ncpdq.c)
 add_executable(ncra src/nco/ncra.c)
 add_executable(ncrename src/nco/ncrename.c)
+if (MSVC)
+add_executable(ncwa src/nco/ncwa.c)
+endif(MSVC)
 
 set(nco_LIB nco)
 
@@ -221,6 +225,9 @@ target_link_libraries (ncflint ${nco_LIB} ${LIB_DEP})
 target_link_libraries (ncpdq ${nco_LIB} ${LIB_DEP})
 target_link_libraries (ncra ${nco_LIB} ${LIB_DEP})
 target_link_libraries (ncrename ${nco_LIB} ${LIB_DEP})
+if (MSVC)
+target_link_libraries (ncwa ${nco_LIB} ${LIB_DEP})
+endif(MSVC)
 
 #/////////////////////////////////////////////////////////////////////////////////////
 #ncap2 
diff --git a/Makefile.am b/Makefile.am
index cf00923..2b6441f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,7 @@ ACLOCAL_AMFLAGS = -I m4
 test:	tst
 tst:
 	$(MAKE) check
+	cd data && $(MAKE) in_4c.nc && cd ..
 	cd bm && ./nco_bm.pl --regress
 
 regress:	rgr
diff --git a/Makefile.in b/Makefile.in
index 9a090de..d406bd4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -606,7 +606,7 @@ distdir: $(DISTFILES)
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -632,7 +632,7 @@ dist-shar: distdir
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -650,7 +650,7 @@ dist dist-all:
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -660,7 +660,7 @@ distcheck: dist
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
@@ -859,6 +859,7 @@ uninstall-am:
 test:	tst
 tst:
 	$(MAKE) check
+	cd data && $(MAKE) in_4c.nc && cd ..
 	cd bm && ./nco_bm.pl --regress
 
 regress:	rgr
diff --git a/aclocal.m4 b/aclocal.m4
index 39e162d..6c138be 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -645,7 +645,7 @@ fi
 rmdir .tst 2>/dev/null
 AC_SUBST([am__leading_dot])])
 
-# Copyright (C) 1998-2014 Free Software Foundation, Inc.
+# Copyright (C) 1998-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -666,7 +666,7 @@ fi])
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -701,7 +701,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -751,7 +751,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -792,7 +792,7 @@ fi
 # Obsolete and "removed" macros, that must however still report explicit
 # error messages when used, to smooth transition.
 #
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -819,7 +819,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -895,7 +895,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -914,7 +914,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -995,7 +995,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1083,7 +1083,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1102,7 +1102,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/bld/Makefile b/bld/Makefile
index 1f58e47..164ab4a 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -18,14 +18,14 @@
 # cooley.alcf.anl.g  : NCO          Configure All else GCC
 # edison.nersc.gov   : NCO          Configure All else Intel
 # firn.ess.uci.edu   : NCO          Configure All else LLVM
-# frazil.ess.uci.edu : NCO + netCDF Configure All else GCC
+# frazil.ess.uci.edu : NCO          Configure All else GCC
 # givre.ess.uci.edu  : NCO + netCDF Makefile  All else LLVM
 # glace.ess.uci.edu  : NCO          Configure All else GCC
 # grele.ess.uci.edu  : NCO          Makefile  All else GCC
 # neige.ess.uci.edu  : NCO          Makefile  All else GCC
 # rhea.ccs.ornl.gov  : NCO          Makefile  All else GCC
 # roulee.ess.uci.edu : NCO + netCDF Makefile  All else GCC
-# skyglow.ess.uci.edu: NCO          Configure All else GCC
+# skyglow.ess.uci.edu: NCO + netCDF Configure All else GCC
 # travis CI          : NCO          Configure All else gcc,clang,g++
 # yellowstone.ucar.e : NCO          Makefile  All else Intel
 
diff --git a/bld/nco.spec b/bld/nco.spec
index 7c409dc..0eb49ef 100644
--- a/bld/nco.spec
+++ b/bld/nco.spec
@@ -2,17 +2,17 @@
 # http://cvs.fedoraproject.org/viewvc/devel/nco/nco.spec?view=co
 
 Name:           nco
-Version:        4.6.7
+Version:        4.6.8
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.6.7-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.6.8-1 tar.gz from Sourceforge using CVS:
 # cvs -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco login
-# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.6.7-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-4.6.7/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
+# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.6.8-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.6.8/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
 Source0:        nco-%{version}.tar.gz
 #Patch0:		nco_install_C_headers.patch
 #Patch1:         nco_find_udunits-dat.patch
@@ -108,6 +108,9 @@ fi
 # %{_libdir}/libnco++.so
 
 %changelog
+* Wed Aug 16 2017 Charlie Zender <zender at uci.edu> - 4.6.8-1
+- new upstream 4.6.8
+
 * Fri May 26 2017 Charlie Zender <zender at uci.edu> - 4.6.7-1
 - new upstream 4.6.7
 
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index 7e78a19..8b9fb85 100755
--- a/bld/nco_dst.pl
+++ b/bld/nco_dst.pl
@@ -5,20 +5,20 @@
 
 # Usage:
 # Export tagged, public versions
-# /usr/bin/scp ${DATA}/nco-4.6.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-4.6.7 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.6.7 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.6.7 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.6.7 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.6.7
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.6.7
+# /usr/bin/scp ${DATA}/nco-4.6.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-4.6.8 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.6.8 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.6.8 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.6.8 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.6.8
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.6.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-4.6.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-4.6.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
diff --git a/bm/NCO_bm.pm b/bm/NCO_bm.pm
index 80c798f..be1fa1f 100644
--- a/bm/NCO_bm.pm
+++ b/bm/NCO_bm.pm
@@ -183,7 +183,8 @@ sub bm_ntl($$){
 # If libtool created shared libraries, then point to real executables
 # in ../src/nco/.libs
     my $dotlib = '';
-    $dotlib = ".libs/lt-" if `head -1 $MY_BIN_DIR/ncatted` =~ m/sh/;
+# 20170608: Removed at suggestion of Daniel Neumann
+#    $dotlib = ".libs/lt-" if `head -1 $MY_BIN_DIR/ncatted` =~ m/sh/;
     $sym_link{ncdiff}=$dotlib . "ncbo";
     $sym_link{nces}=$dotlib . "ncra";
     $sym_link{ncrcat}=$dotlib . "ncra";
diff --git a/bm/NCO_rgr.pm b/bm/NCO_rgr.pm
index c2f95ea..214dadf 100644
--- a/bm/NCO_rgr.pm
+++ b/bm/NCO_rgr.pm
@@ -102,7 +102,12 @@ sub tst_rgr {
     # 360 (for library 3.x)
     # 410 (for library 4.1.x)
     # 430 (for library 4.3.0)
-    # 433 (for library 4.3.3)
+    # 431 (for library 4.3.1)
+    # 432 (for library 4.3.2)
+    # 433 (for library 4.3.3.x)
+    # 440 (for library 4.4.0)
+    # 441 (for library 4.4.1.x)
+    # 450 (for library 4.5.0)
 
   if($exit_value == 410){print "netCDF version 4.1.x detected\n";}
   if($exit_value == 431){print "netCDF version 4.3.1 detected\n";}
@@ -110,7 +115,8 @@ sub tst_rgr {
   if($exit_value == 433){print "netCDF version 4.3.3 detected\n";}
   if($exit_value == 440){print "netCDF version 4.4.0 detected\n";}
   if($exit_value == 441){print "netCDF version 4.4.1 detected\n";}
-  if($exit_value == 442){print "netCDF version 4.4.2 detected\n";}
+  if($exit_value == 450){print "netCDF version 4.5.0 detected\n";}
+  if($exit_value == 451){print "netCDF version 4.5.1 detected\n";}
 
   if($exit_value >= 400){$RUN_NETCDF4_TESTS=1;}
   if($exit_value >= 431){$RUN_NETCDF4_TESTS_VERSION_GE_431=1;}
@@ -124,7 +130,7 @@ print "\n";
     $USER=$ENV{'USER'};
     $DATA=$ENV{'DATA'};
     $HOME=$ENV{'HOME'};
-if($USER eq 'zender'){
+if($USER =~ /zender/){
 # NB: area variable is not in ACME cube-sphere native output so this answer is not area-weighted
 # ncclimo -v FSNT,AODVIS -c famipc5_ne30_v0.3_00003 -s 1980 -e 1983 -i ${DATA}/ne30/raw -o ${DATA}/ne30/clm
 # ncwa -O ${DATA}/ne30/clm/famipc5_ne30_v0.3_00003_ANN_197912_198311_climo.nc ~/foo.nc
@@ -451,6 +457,13 @@ if($USER eq 'zender'){
     $#tst_cmd=0; # Reset array
 
 
+    $dsc_sng="Run script to to test ncap2 NC_STRING handling (failure expected 2017-06-21)";
+    $tst_cmd[0]="ncap2 -h -O $fl_fmt $nco_D_flg -v -S '../data/string.nco' $in_pth_arg in_4.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v nbr_err_ttl -s '%d' %tmp_fl_00%";
+    $tst_cmd[2]="0";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
 
 
 
@@ -1785,6 +1798,10 @@ if($USER eq 'zender'){
     $#tst_cmd=0; # Reset array
     
 #ncks #18 
+# ncatted -O -a _FillValue,global,c,l,222 ~/nco/data/in.nc ~/foo.nc
+# ncks -O ~/foo.nc ~/foo2.nc
+# ncap2 -v -O -s 'n2=global at _FillValue;' ~/foo2.nc ~/foo3.nc
+# ncks -C -H -s '%d' -v n2 ~/foo3.nc
     $tst_cmd[0]="ncatted -O $fl_fmt $nco_D_flg -a _FillValue,global,c,l,222 $in_pth_arg in.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -O %tmp_fl_00% %tmp_fl_01%";
     $tst_cmd[2]="ncap2 -v -O -s 'n2=global\@_FillValue;' %tmp_fl_01% %tmp_fl_02%";
@@ -2105,10 +2122,10 @@ if($USER eq 'zender'){
     $#tst_cmd=0; # Reset array 			
     
 #ncks #49
-# ncks -O --mk_rec_dmn lat -v three_dmn_var ~/nco/data/in.nc ~/foo.nc
+# ncks -O --no_frm_trm --mk_rec_dmn lat -v three_dmn_var ~/nco/data/in.nc ~/foo.nc
 # ncks -C -m -v lat ~/foo.nc | egrep -o -w 'Record coordinate is lat'
     $dsc_sng="Check --mk_rec_dmn (netCDF3 file)";
-    $tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg --mk_rec_dmn lat -v three_dmn_var $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg --no_frm_trm --mk_rec_dmn lat -v three_dmn_var $in_pth_arg in.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -C -m -v lat %tmp_fl_00% | egrep -o -w 'Record coordinate is lat'";
     $tst_cmd[2]="Record coordinate is lat";
     $tst_cmd[3]="SS_OK";   
@@ -2596,7 +2613,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 # Test -X writing (apply limits to all standard 'lat' 'lon')
 # ncks -O -X 0.,1.,-30.,-29. -g g18g1 -v gds_3dvar ~/nco/data/in_grp_3.nc ~/foo.nc
     $dsc_sng="(Groups) Auxiliary coordinates writing -X 0.,1.,-30.,-29. -g g18g1 -v gds_3dvar";
-    $tst_cmd[0]="ncks $nco_D_flg -X 0.,1.,-30.,-29. -g g18g1 -v gds_3dvar $in_pth_arg in_grp_3.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncks -O $nco_D_flg -X 0.,1.,-30.,-29. -g g18g1 -v gds_3dvar $in_pth_arg in_grp_3.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks $nco_D_flg -v lon_gds_1 %tmp_fl_00%";
     $tst_cmd[2]="gds_crd[0]=1 lon_gds_1[0]=0 degree";
     $tst_cmd[3]="SS_OK";   
@@ -2621,7 +2638,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 # Test -X writing
 # ncks -O -X 0.,1.,-30.,-29. -v gds_3dvar ~/nco/data/in.nc ~/foo.nc
     $dsc_sng="Auxiliary coordinates writing -X 0.,1.,-30.,-29. -v gds_3dvar";
-    $tst_cmd[0]="ncks $nco_D_flg -X 0.,1.,-30.,-29. -v gds_3dvar $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncks -O $nco_D_flg -X 0.,1.,-30.,-29. -v gds_3dvar $in_pth_arg in.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks $nco_D_flg -v gds_crd %tmp_fl_00%";
     $tst_cmd[2]="gds_crd[0]=1 lon_gds[0]=0 degree";
     $tst_cmd[3]="SS_OK";   
@@ -3331,6 +3348,8 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     $#tst_cmd=0; # Reset array
 
 #ncpdq #31
+#ncpdq -O -C -P all_xst -v three_dmn_var_dbl -d time,0,2 -d time,8,9 -d lon,0 -d lon,1 -d lat,1 ~/nco/data/in.nc ~/foo.nc
+#ncks -C -H -s '%i' -v three_dmn_var_dbl -d time,2 -d lon,1 -d lat,0 ~/foo.nc
     ##### TODO 880
     $dsc_sng="Pack 3D variable with MSA -C -P all_xst -v three_dmn_var_dbl -d time,0,2 -d time,8,9 -d lon,0 -d lon,1 -d lat,1"; 
     $tst_cmd[0]="ncpdq $omp_flg -h -O -C $fl_fmt $nco_D_flg -P all_xst -v three_dmn_var_dbl -d time,0,2 -d time,8,9 -d lon,0 -d lon,1 -d lat,1 $in_pth_arg in.nc %tmp_fl_00%";
@@ -3643,7 +3662,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 ####################
 
 #ncrcat #01
-
+    
 #if($mpi_prc == 0){ # fxm test hangs because of ncrcat TODO 593
     $dsc_sng="Concatenate float with double missing values across two files";
     $tst_cmd[0]="ncra -Y ncrcat $omp_flg -h -O $fl_fmt $nco_D_flg -v rec_var_flt_mss_val_dbl $in_pth_arg in.nc in.nc %tmp_fl_00% 2> %tmp_fl_02%";
@@ -4051,7 +4070,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #ncrcat -h --no_tmp_fl --rec_apn -v one_dmn_rec_var ~/nco/data/in_grp.nc in_grp1.nc
 
     $tst_cmd[0]="ncks $omp_flg -h -O $fl_fmt $nco_D_flg -g g4 -v one_dmn_rec_var $in_pth_arg in_grp.nc %tmp_fl_00%";
-    $tst_cmd[1]="ncrcat $omp_flg -h --no_tmp_fl --rec_apn $fl_fmt $nco_D_flg -g g4 -v one_dmn_rec_var $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncra -Y ncrcat $omp_flg -h --no_tmp_fl --rec_apn $fl_fmt $nco_D_flg -g g4 -v one_dmn_rec_var $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[2]="ncks -C -g g4 -v one_dmn_rec_var %tmp_fl_00%";
     $dsc_sng="(Groups) Append records to existing file without copying original (Group with 1 record case)";
     $tst_cmd[3]="time[19]=10 one_dmn_rec_var[19]=10 kelvin";
@@ -4064,7 +4083,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #ncrcat -h --no_tmp_fl --rec_apn -g g5 -v one_dmn_rec_var ~/nco/data/in_grp.nc in_grp1.nc
 
     $tst_cmd[0]="ncks $omp_flg -h -O $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var,time51,time52 $in_pth_arg in_grp.nc %tmp_fl_00%";
-    $tst_cmd[1]="ncrcat $omp_flg -h --no_tmp_fl --rec_apn $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncra -Y ncrcat  $omp_flg -h --no_tmp_fl --rec_apn $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[2]="ncks -C -g g5 -v one_dmn_rec_var %tmp_fl_00%";
     $dsc_sng="(Groups) Append records to existing file without copying original (Group with 2 records case)";
     $tst_cmd[3]="time52[19]=10 one_dmn_rec_var[19]=10 kelvin";
@@ -4078,10 +4097,10 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #ncrcat -O -h -g g5 -v one_dmn_rec_var -p ~/nco/data in_grp1.nc in_grp2.nc ~/foo.nc
 #ncks -C -g g5 -v one_dmn_rec_var ~/foo.nc
 
-	$tst_cmd[0]="ncks $omp_flg -h -O $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var,time51,time52 $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncks $omp_flg -h -O $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var,time51,time52 $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks $omp_flg -h -O $fl_fmt $nco_D_flg -v one_dmn_rec_var,time51,time52 $in_pth_arg in_grp.nc %tmp_fl_01%";
-    $tst_cmd[2]="ncrcat -h -O $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var %tmp_fl_00% %tmp_fl_01% %tmp_fl_02%";
-	$tst_cmd[3]="ncks -C -g g5 -v one_dmn_rec_var %tmp_fl_02%";
+    $tst_cmd[2]="ncra -Y ncrcat  -h -O $fl_fmt $nco_D_flg -g g5 -v one_dmn_rec_var %tmp_fl_00% %tmp_fl_01% %tmp_fl_02%";
+    $tst_cmd[3]="ncks -C -g g5 -v one_dmn_rec_var %tmp_fl_02%";
     $dsc_sng="(Groups) Group with 2 records case";
     $tst_cmd[4]="time52[19]=10 one_dmn_rec_var[19]=10 kelvin";
     $tst_cmd[5]="SS_OK";
@@ -4620,11 +4639,13 @@ if(0){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
+# ncwa -N -O -a lat,lon -w gw ~/nco/data/in.nc ~/foo.nc
+# ncks -C -H -s '%g' -v mask ~/foo.nc
 #ncwa #5
     $dsc_sng="do not normalize by denominator (FAILURE netCDF4 nco946)";
     $tst_cmd[0]="ncwa -N $omp_flg -h -O $fl_fmt $nco_D_flg -a lat,lon -w gw $in_pth_arg in.nc %tmp_fl_00%";
-    $tst_cmd[1]="ncks -C -H -s '%f' -v mask %tmp_fl_00%";
-    $tst_cmd[2]="50";
+    $tst_cmd[1]="ncks -C -H -s '%g' -v mask %tmp_fl_00%";
+    $tst_cmd[2]="40";
     $tst_cmd[3]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
@@ -5342,6 +5363,88 @@ if(0){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array	
 
+#ncwa #70
+# ncwa -O -C -y ttl -v orog -d lat,0.,90. --mask_condition 'ORO > 0.0' ~/nco/data/in.nc ~/foo.nc
+# ncks -H -v orog ~/foo.nc
+    $dsc_sng="Mask condition not in variable list (fixed with nco1138 20170804)";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog -d lat,0.,90. --mask_condition 'ORO > 0.0' $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog %tmp_fl_00%";
+    $tst_cmd[2]="orog = 4";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+#ncwa #71 (pvn 20170717)
+# ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -m lat -M 0.0 -T gt ~/nco/data/in.nc ~/foo.nc
+# ncks -H -v orog2 ~/foo.nc
+    $dsc_sng="Mask condition not in variable list (mask is relative coordinate variable) (fixed with nco1138 20170804)";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog2 -d lat,0.,90. -m lat -M 0.0 -T gt $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog2 %tmp_fl_00%";
+    $tst_cmd[2]="orog2 = 4";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+#ncwa #72 (pvn 20170810)
+# ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -m lat -M 0.0 -T gt ~/nco/data/in.nc ~/foo.nc
+# ncks -H -v orog2 ~/foo.nc
+    $dsc_sng="Mask condition not in variable list (mask is absolute coordinate variable) (fixed with nco1138 20170804)";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog2 -d lat,0.,90. -m /lat -M 0.0 -T gt $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog2 %tmp_fl_00%";
+    $tst_cmd[2]="orog2 = 4";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+# (pvn 20170811), 3 tests for mask, weight, hyperslab combined 
+#data is
+#lat=-90,90;
+#lon=0,90,180,270;
+#orog2=1.,1.,1.,1.,1.,1.,1.,1.;
+#mask=0.,1.,0.,0.,1.,1.,0.,1.;
+#byt_arr=0,1,2,3,4,5,6,7;
+#ncwa -O -C -y ttl -v orog2 -w byt_arr ~/nco/data/in.nc ~/foo.nc ; 28
+#ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr ~/nco/data/in.nc ~/foo.nc ; 22
+#ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr -m mask -M 0.0 -T gt ~/nco/data/in.nc ~/foo.nc ; 16
+# first test, sum all values of byt_arr = 28
+# second test, sum indexes [4,5,6,7] of byt_arr = 22
+# third test, sum indexes [4,5,7] of byt_arr = 16
+
+#ncwa #73 
+# ncwa -O -C -y ttl -v orog2 -w byt_arr ~/nco/data/in.nc ~/foo.nc ; 28
+# ncks -H -v orog2 ~/foo.nc
+    $dsc_sng="Weight without mask and without hyperslab";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog2 -w byt_arr $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog2 %tmp_fl_00%";
+    $tst_cmd[2]="orog2 = 28";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+#ncwa #74
+#ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr ~/nco/data/in.nc ~/foo.nc ; 22
+# ncks -H -v orog2 ~/foo.nc
+    $dsc_sng="Weight without mask and with hyperslab";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog2 %tmp_fl_00%";
+    $tst_cmd[2]="orog2 = 22";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+#ncwa #75
+#ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr -m mask -M 0.0 -T gt ~/nco/data/in.nc ~/foo.nc ; 16
+# ncks -H -v orog2 ~/foo.nc
+    $dsc_sng="Weight with mask and with hyperslab";
+    $tst_cmd[0]="ncwa $omp_flg $nco_D_flg -O -C -y ttl -v orog2 -d lat,0.,90. -w byt_arr -m mask -M 0.0 -T gt $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -H -v orog2 %tmp_fl_00%";
+    $tst_cmd[2]="orog2 = 16";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+
+    
 ####################
 #### ncrename tests #### OK!
 ####################
diff --git a/configure b/configure
index 9915c7a..f421926 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.6.7.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.6.8.
 #
 # Report bugs to <nco-bugs at lists.sourceforge.net>.
 #
@@ -592,8 +592,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='NCO netCDF Operators'
 PACKAGE_TARNAME='nco'
-PACKAGE_VERSION='4.6.7'
-PACKAGE_STRING='NCO netCDF Operators 4.6.7'
+PACKAGE_VERSION='4.6.8'
+PACKAGE_STRING='NCO netCDF Operators 4.6.8'
 PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1394,7 +1394,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 4.6.7 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.6.8 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1465,7 +1465,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of NCO netCDF Operators 4.6.7:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.6.8:";;
    esac
   cat <<\_ACEOF
 
@@ -1633,7 +1633,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NCO netCDF Operators configure 4.6.7
+NCO netCDF Operators configure 4.6.8
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2499,7 +2499,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 4.6.7, which was
+It was created by NCO netCDF Operators $as_me 4.6.8, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2847,7 +2847,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-#AC_INIT([NCO netCDF Operators],[m4_esyscmd([git describe --abbrev=7 --dirty --always --tags])],[nco-bugs at lists.sourceforge.net],[nco])
+#AC_INIT([NCO netCDF Operators],m4_esyscmd([git describe --abbrev=7 --dirty --always --tags | tr -d '\n']),[nco-bugs at lists.sourceforge.net],[nco])
 
 # Print GNU copyright in configure script
 
@@ -3750,7 +3750,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nco'
- VERSION='4.6.7'
+ VERSION='4.6.8'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -19054,15 +19054,15 @@ if test "${enable_ncoxx}" != 'no'; then
 	    ANTLR_LIB="${ANTLR_ROOT}/lib"
 	fi
     fi
-    if test "${ANTLR_BIN}"; then
+    if test -d "${ANTLR_BIN}"; then
 # Add ${ANTLR_BIN}, if present, to binary search path
 	PATH="${PATH}:${ANTLR_BIN}"
     fi
-    if test "${ANTLR_INC}"; then
+    if test -d "${ANTLR_INC}"; then
 # Add ${ANTLR_INC}, if present, to include search path
 	CPPFLAGS="${CPPFLAGS} -I${ANTLR_INC}"
     fi
-    if test "${ANTLR_LIB}"; then
+    if test -d "${ANTLR_LIB}"; then
 # Add ${ANTLR_LIB}, if present, to library search path
 	LDFLAGS="${LDFLAGS} -L${ANTLR_LIB}"
     fi
@@ -19691,10 +19691,8 @@ if test "${enable_gsl}" != 'no'; then
     fi
     if test "${GSL_LIB}"; then
 	LIBS="${LIBS} -L${GSL_LIB}"
-    else
-	GSL_LIB="${GSL_ROOT}/lib"
-	LIBS="${LIBS} `${GSL_CONFIG} --libs`"
     fi
+	LIBS="${LIBS} `${GSL_CONFIG} --libs`"
     { $as_echo "$as_me:${as_lineno-$LINENO}: These GSL library and header tests must succeed for GSL support:" >&5
 $as_echo "$as_me: These GSL library and header tests must succeed for GSL support:" >&6;}
 # fxm: default action of check_lib adds a superfluous -lgsl to $LIBS
@@ -19985,8 +19983,19 @@ fi
 	if test -d "${UDUNITS2_PATH}"; then
 	    # NB: Use ${UDUNITS2_PATH} not ${UDUNITS2_ROOT} because UDUnits software looks for ${UDUNITS2_PATH}
 	    # Add ${UDUNITS2_PATH}/lib to search path if present
-	    nco_udunits2_xml=${UDUNITS2_PATH}/share/udunits/udunits2.xml
-	    LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/lib"
+      # Some systems install 64bit libraries into $prefix/lib64 instead of
+      #  $prefix/lib. If NCO libraries are installed into $prefix/lib64,
+      #  UDUNITS presumably was installed in $UDUNITS2_PATH/lib64 as well.
+      #  Therefore, we take `basename $libdir` (libdir=$prefix/lib|lib64),
+      #  which is 'lib' or 'lib64', and append it to UDUNITS2_PATH. If this
+      #  directory does not exist, we append 'lib' to UDUNITS2_PATH.
+      #   (Daniel Neumann, 3rd June 2017)
+      nco_udunits2_xml=${UDUNITS2_PATH}/share/udunits/udunits2.xml
+      if test -d "${UDUNITS2_PATH}/`basename $libdir`"; then
+        LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/`basename $libdir`"
+      else
+        LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/lib"
+      fi
 	    CPPFLAGS="${CPPFLAGS} -I${UDUNITS2_PATH}/include"
 	else
 	    echo "WARNING: UDUNITS2_PATH location \"${UDUNITS2_PATH}\" does not exist!"
@@ -20291,7 +20300,6 @@ case ${host} in
     i*86-*-linux-gnu | x86_64*-linux* )
 	case ${CC} in
 	    como* ) CFLAGS="${CFLAGS} --c99" ; ;;
-# 20150109: fxm Introduce -D_DEFAULT_SOURCE in place of deprecated (as of gcc 4.9.2) -D_BSD_SOURCE -D_POSIX_SOURCE
 # 20150525: fxm Remove -no-gcc from icc flags as per ocehugo
 #	    icc* ) CFLAGS="${CFLAGS} -std=c99" ; CPPFLAGS="${CPPFLAGS} -D_BSD_SOURCE -D_POSIX_SOURCE -no-gcc" ; ;;
 	    icc* ) CFLAGS="${CFLAGS} -std=c99" ; CPPFLAGS="${CPPFLAGS} -D_BSD_SOURCE -D_POSIX_SOURCE" ; ;;
@@ -20769,6 +20777,7 @@ fi
 # Tell GNU C compiler to use C99 standard (older gcc versions default to C89)
 # fxm: only do this for gcc, not g++
 if test $ac_compiler_gnu = 'yes'; then
+    # 20150109: fxm Introduce -D_DEFAULT_SOURCE in place of deprecated (as of gcc 4.9.2) -D_BSD_SOURCE -D_POSIX_SOURCE
     # _BSD_SOURCE needed for backward compatibility with old GCC
     # 20160418: default cori gcc is 4.3.4 from 2008!
     CFLAGS="${CFLAGS} -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE"
@@ -21495,7 +21504,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 4.6.7, which was
+This file was extended by NCO netCDF Operators $as_me 4.6.8, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21561,7 +21570,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-NCO netCDF Operators config.status 4.6.7
+NCO netCDF Operators config.status 4.6.8
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 46f5760..1771916 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,8 +51,11 @@
 
 # Process configure input with autoconf to produce configure script
 # (package name,version,bug-report-address,tarball name)
-AC_INIT([NCO netCDF Operators],[4.6.7],[nco-bugs at lists.sourceforge.net],[nco])
-#AC_INIT([NCO netCDF Operators],[m4_esyscmd([git describe --abbrev=7 --dirty --always --tags])],[nco-bugs at lists.sourceforge.net],[nco])
+# 20170808: Choose between traditional version and Git-based version
+# If Git, consider that Linux dynamic libraries will have full messy name, MacOSX will not
+# https://stackoverflow.com/questions/43526939/how-to-insert-git-based-version-in-autoconf-managed-project
+AC_INIT([NCO netCDF Operators],[4.6.8],[nco-bugs at lists.sourceforge.net],[nco])
+#AC_INIT([NCO netCDF Operators],m4_esyscmd([git describe --abbrev=7 --dirty --always --tags | tr -d '\n']),[nco-bugs at lists.sourceforge.net],[nco])
 
 # Print GNU copyright in configure script
 AC_COPYRIGHT
@@ -420,15 +423,15 @@ if test "${enable_ncoxx}" != 'no'; then
 	    ANTLR_LIB="${ANTLR_ROOT}/lib"
 	fi
     fi
-    if test "${ANTLR_BIN}"; then
+    if test -d "${ANTLR_BIN}"; then
 # Add ${ANTLR_BIN}, if present, to binary search path
 	PATH="${PATH}:${ANTLR_BIN}"
     fi
-    if test "${ANTLR_INC}"; then
+    if test -d "${ANTLR_INC}"; then
 # Add ${ANTLR_INC}, if present, to include search path
 	CPPFLAGS="${CPPFLAGS} -I${ANTLR_INC}"
     fi
-    if test "${ANTLR_LIB}"; then
+    if test -d "${ANTLR_LIB}"; then
 # Add ${ANTLR_LIB}, if present, to library search path
 	LDFLAGS="${LDFLAGS} -L${ANTLR_LIB}"
     fi
@@ -635,10 +638,8 @@ if test "${enable_gsl}" != 'no'; then
     fi
     if test "${GSL_LIB}"; then
 	LIBS="${LIBS} -L${GSL_LIB}"
-    else
-	GSL_LIB="${GSL_ROOT}/lib"
-	LIBS="${LIBS} `${GSL_CONFIG} --libs`"
     fi
+	LIBS="${LIBS} `${GSL_CONFIG} --libs`"
     AC_MSG_NOTICE([These GSL library and header tests must succeed for GSL support:])
 # fxm: default action of check_lib adds a superfluous -lgsl to $LIBS
     AC_CHECK_LIB([gsl],[gsl_sf_gamma_inc],,enable_gsl=no)
@@ -720,8 +721,19 @@ if test "${enable_udunits2}" != 'no'; then
 	if test -d "${UDUNITS2_PATH}"; then
 	    # NB: Use ${UDUNITS2_PATH} not ${UDUNITS2_ROOT} because UDUnits software looks for ${UDUNITS2_PATH}
 	    # Add ${UDUNITS2_PATH}/lib to search path if present
-	    nco_udunits2_xml=${UDUNITS2_PATH}/share/udunits/udunits2.xml
-	    LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/lib"
+      # Some systems install 64bit libraries into $prefix/lib64 instead of 
+      #  $prefix/lib. If NCO libraries are installed into $prefix/lib64, 
+      #  UDUNITS presumably was installed in $UDUNITS2_PATH/lib64 as well.
+      #  Therefore, we take `basename $libdir` (libdir=$prefix/lib|lib64),
+      #  which is 'lib' or 'lib64', and append it to UDUNITS2_PATH. If this
+      #  directory does not exist, we append 'lib' to UDUNITS2_PATH.
+      #   (Daniel Neumann, 3rd June 2017)
+      nco_udunits2_xml=${UDUNITS2_PATH}/share/udunits/udunits2.xml
+      if test -d "${UDUNITS2_PATH}/`basename $libdir`"; then
+        LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/`basename $libdir`"
+      else
+        LDFLAGS="${LDFLAGS} -L${UDUNITS2_PATH}/lib"
+      fi
 	    CPPFLAGS="${CPPFLAGS} -I${UDUNITS2_PATH}/include"
 	else
 	    echo "WARNING: UDUNITS2_PATH location \"${UDUNITS2_PATH}\" does not exist!"
@@ -806,7 +818,6 @@ case ${host} in
     i*86-*-linux-gnu | x86_64*-linux* )
 	case ${CC} in
 	    como* ) CFLAGS="${CFLAGS} --c99" ; ;;
-# 20150109: fxm Introduce -D_DEFAULT_SOURCE in place of deprecated (as of gcc 4.9.2) -D_BSD_SOURCE -D_POSIX_SOURCE 
 # 20150525: fxm Remove -no-gcc from icc flags as per ocehugo
 #	    icc* ) CFLAGS="${CFLAGS} -std=c99" ; CPPFLAGS="${CPPFLAGS} -D_BSD_SOURCE -D_POSIX_SOURCE -no-gcc" ; ;;
 	    icc* ) CFLAGS="${CFLAGS} -std=c99" ; CPPFLAGS="${CPPFLAGS} -D_BSD_SOURCE -D_POSIX_SOURCE" ; ;;
@@ -1138,6 +1149,7 @@ fi
 # Tell GNU C compiler to use C99 standard (older gcc versions default to C89)
 # fxm: only do this for gcc, not g++
 if test $ac_compiler_gnu = 'yes'; then
+    # 20150109: fxm Introduce -D_DEFAULT_SOURCE in place of deprecated (as of gcc 4.9.2) -D_BSD_SOURCE -D_POSIX_SOURCE 
     # _BSD_SOURCE needed for backward compatibility with old GCC
     # 20160418: default cori gcc is 4.3.4 from 2008!
     CFLAGS="${CFLAGS} -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE"
diff --git a/configure.eg b/configure.eg
index 8efba56..590a672 100644
--- a/configure.eg
+++ b/configure.eg
@@ -238,8 +238,8 @@ Commands for LINUX are the only ones "regularly" used after ~2010
 # Yan Liu <yanliu at illinois.edu> # NCSA Maintainer = Yan Liu (github: yanliu-chn)
 # https://nersc.service-now.com/navpage.do # NERSC Maintainer = Yun (Helen) He
 # https://www.olcf.ornl.gov/support/submit-ticket # OLCF
-# Subject: Please upgrade NCO module to 4.6.6
-# Request: NCO 4.6.6 was released 4/21 and contains many features of interest to your ACME users. Please upgrade the system NCO module to 4.6.6 and make that the default NCO module. Thanks!
+# Subject: Please upgrade NCO module to 4.6.8
+# Request: NCO 4.6.8 was released 5/26 and contains many features of interest to your ACME users. Please upgrade the system NCO module to 4.6.8 and make that the default NCO module. Thanks!
 
 zender at dust:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
 LINUX
@@ -314,7 +314,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 
 # gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cori:
 # Sysadmin upgrade request: https://nersc.service-now.com/navpage.do
-# Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170501 (without ncap2)
+# Latest sysadmin-compiled module usage: module load nco/4.6.7 # 20170612 (without ncap2)
 # Personal recipe last used successfully: 20170411
 module load szip
 module load gsl
@@ -333,15 +333,16 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # acme: http://www.gnu.org/software/automake/manual/automake.html search for "shared by two hosts" use 
 # gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on edison:
 # Sysadmin upgrade request: https://nersc.service-now.com/navpage.do
-# Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170420 (with ncap2)
-# Personal recipe last used successfully: 20170519
+# Latest ticket: INC0106410 on 20170804
+# Latest sysadmin-compiled module usage: module load nco/4.6.7 # 20170809 (with ncap2)
+# Personal recipe last used successfully: 20170807
 module load szip
 module load gsl
-module load udunits
+module load udunits2
 module load cray-netcdf
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
-ANTLR_ROOT='/usr' CC='icc' CXX='icpc' GSL_ROOT='/usr/common/usg/gsl/1.16/intel' NETCDF_INC='/opt/cray/netcdf/4.3.2/INTEL/140/include' NETCDF_LIB='/opt/cray/netcdf/4.3.2/INTEL/140/lib' NETCDF_ROOT='/opt/cray/netcdf/4.3.2' UDUNITS2_PATH='/usr/common/usg/udunits/2.1.24/intel' ./configure --prefix=${HOME} --bindir=${HOME}/bin_edison --datadir=${HOME}/nco/data --libdir=${HOME}/lib_edison --mandir=${HOME}/man > nco.configure.${GNU_TRP}.foo 2>&1
+ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib_edison CC='icc' CXX='icpc' GSL_ROOT='/usr/common/usg/gsl/2.3/intel' NETCDF_INC='/opt/cray/pe/netcdf/4.4.1.1.3/INTEL/16.0/include' NETCDF_LIB='/opt/cray/pe/netcdf/4.4.1.1.3/INTEL/16.0/lib' NETCDF_ROOT='/opt/cray/pe/netcdf/4.4.1.1.3' UDUNITS2_PATH='/usr/common/usg/udunits/2.1.24/intel' ./configure --prefix=${HOME} --bindir=${HOME}/bin_edison --datadir=${HOME}/nco/data --libdir=${HOME}/lib_edison --mandir=${HOME}/man > nco.configure.${GNU_TRP}.foo 2>&1
 /bin/cp -f config.log nco.config.log.${GNU_TRP}.foo
 /bin/cp -f libtool nco.libtool.${GNU_TRP}.foo
 make clean;make > nco.make.${GNU_TRP}.foo 2>&1
@@ -364,9 +365,12 @@ make install >> nco.make.${GNU_TRP}.foo 2>&1
 scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:Sites/nco/rgr
 
 # gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on blues/anvil
+# LCRC uses Spack module written and tested by Adam Stewart: https://github.com/LLNL/spack/pull/4370/files
+# spack install --run-tests nco%gcc ^netcdf at 4.4.0
 # Sysadmin upgrade request: support at lcrc.anl.gov
-# Latest sysadmin-compiled module usage: soft add +nco-4.6.5 # 20170316
-# Personal recipe last used successfully: 20170421
+# Latest ticket: AREQ0159277 on 20170526
+# Latest sysadmin-compiled module usage: soft add +nco-4.6.7 # 20170526
+# Personal recipe last used successfully: 20170526
 # fails to link to udunits...why?
 # nm -a /soft/udunits/2.1.21/lib/libudunits2.a | grep ut_read_xml
 # First use: 20161223 Latest use: 20161223
@@ -397,43 +401,45 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 
 # icc/icpc 20160217 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on yellowstone:
 # Sysadmin upgrade request: cislhelp at ucar.edu
+# Latest ticket: 157798 on 20170526
 # Latest sysadmin-compiled module usage: module load nco/4.5.5 # 20160228
-# Personal recipe last used successfully: 20170421
-module add intel;module add gsl;module add netcdf/4.3.0;
-export PATH=${PATH}:/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/bin # needed for ncgen
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib # needed to run NCO
+# Personal recipe last used successfully: 20170526
+module add intel/16.0.3;module add gsl;module add netcdf/4.4.1;
+export PATH=${PATH}:/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/bin # needed for ncgen
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/lib # needed to run NCO
 cd ~/nco;git reset --hard origin/master
-cd ~/nco/bld;make NETCDF_ROOT='/glade/apps/opt/netcdf/4.3.0/intel/default' UDUNITS_INC='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/include' UDUNITS_LIB='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/lib' OPTS=D allinone;cd -
+cd ~/nco/bld;make NETCDF_ROOT='/glade/apps/opt/netcdf/4.4.1/intel/16.0.3' UDUNITS_INC='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/include' UDUNITS_LIB='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/lib' OPTS=D allinone;cd -
 
 # gcc/g++ 20160107 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
 # Sysadmin upgrade request: https://www.olcf.ornl.gov/support/submit-ticket
-# Latest ticket: 347675 on 20170316
+# Latest ticket: 358890 on 20170526
 # Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170515
-# Personal recipe last used successfully: 20170519
+# Personal recipe last used successfully: 20170814
 export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE'
 export LINUX_CXX='g++ -std=c++11'
 export LINUX_FC='gfortran'
 module unload PE-intel # CSZ 
 module load PE-gnu # CSZ 
 module add gsl hdf5
-export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib':${LD_LIBRARY_PATH}
-export NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' 
-export PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/bin':${PATH}
+module load netcdf/4.4.1
+export LD_LIBRARY_PATH='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib':${LD_LIBRARY_PATH}
+export NETCDF_ROOT='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57' 
+export PATH='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57/bin':${PATH}
 cd ~/nco;git reset --hard origin/master
-cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' SZ=Y SZ_LIB='/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
+cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57' SZ=Y SZ_LIB='/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
 
 # gcc/g++ 20160420 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on titan:
 # Sysadmin upgrade request: https://www.olcf.ornl.gov/support/submit-ticket
 # Latest ticket: 347675 on 20170316
-# Latest sysadmin-compiled module usage: module load nco/4.6.5 # 20170411
-# Personal recipe last used successfully: 20170421
+# Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170411
+# Personal recipe last used successfully: 20170814
 export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE'
 module add gcc # change GCC from v 4.3.4 to 4.9.0
 #module add gsl # not used yet
 #module add cray-netcdf # not used yet
 #module add udunits # not used yet
-export PATH=${PATH}:'/opt/cray/netcdf/4.3.2/bin'
-cd ~/nco/bld;make ANTLR_ROOT=${HOME} GSL=N NETCDF_ROOT='/opt/cray/netcdf/4.3.2' NETCDF_INC='/opt/cray/netcdf/4.3.2/GNU/49/include' NETCDF_LIB='/opt/cray/netcdf/4.3.2/GNU/49/lib' OPTS=D OMP=Y UDUNITS_INC='/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/include' UDUNITS_LIB='/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib -lexpat' allinone;cd -
+export PATH=${PATH}:'/opt/cray/netcdf/4.4.1.1/bin'
+cd ~/nco/bld;make ANTLR_ROOT=${HOME} GSL=N NETCDF_ROOT='/opt/cray/netcdf/4.4.1.1' NETCDF_INC='/opt/cray/netcdf/4.4.1.1/GNU/49/include' NETCDF_LIB='/opt/cray/netcdf/4.4.1.1/GNU/49/lib' OPTS=D OMP=Y UDUNITS_INC='/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/include' UDUNITS_LIB='/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib -lexpat' allinone;cd -
 
 # icc/icpc 20160107 Zender tried and failed to use this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
 export GNU_TRP=`~/nco/autobld/config.guess`
@@ -665,7 +671,10 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # gcc/g++ Zender uses this to debug NCO with pre-built netCDF binaries in /usr (frazil, skyglow)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
-CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
+# Pre-20170810 GCC7 dies on nco_yyget_leng() prototype with --enable-debug-custom option
+#CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
+# 20170810 Produce core dumps and symbols, turn-on -Wall, without using --enable-debug-custom
+CC='gcc' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='g++' CXXFLAGS='-Wall' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-symbols --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
 /bin/cp -f config.log nco.config.log.${GNU_TRP}.foo
 /bin/cp -f libtool nco.libtool.${GNU_TRP}.foo
 make clean;make > nco.make.${GNU_TRP}.foo 2>&1
diff --git a/data/Makefile.am b/data/Makefile.am
index bfbb671..131f57b 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -9,7 +9,7 @@ test_data_netCDF4 = in_4c.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_gr
 	- at PATH_TO_NCGEN@ -o $@ $< 
 
 in_4c.nc : in.cdl
-	-ncks -O -7 --cnk_dmn time,10 in.nc $@
+	- at abs_top_builddir@/src/nco/ncks -O -7 --cnk_dmn time,10 in.nc $@
 # ncgen default chunksize for time = 4 MB produces ~200 MB in_4c.nc file. Avoid that!
 #	- at PATH_TO_NCGEN@ -k hdf5-nc3 -o $@ $< 
 
diff --git a/data/Makefile.in b/data/Makefile.in
index bf259fb..0fe30f4 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -559,7 +559,7 @@ uninstall-am: uninstall-dist_binSCRIPTS
 	- at PATH_TO_NCGEN@ -o $@ $< 
 
 in_4c.nc : in.cdl
-	-ncks -O -7 --cnk_dmn time,10 in.nc $@
+	- at abs_top_builddir@/src/nco/ncks -O -7 --cnk_dmn time,10 in.nc $@
 # ncgen default chunksize for time = 4 MB produces ~200 MB in_4c.nc file. Avoid that!
 #	- at PATH_TO_NCGEN@ -k hdf5-nc3 -o $@ $< 
 
diff --git a/data/bsc_tst.nco b/data/bsc_tst.nco
index 35843a3..346d8dc 100644
--- a/data/bsc_tst.nco
+++ b/data/bsc_tst.nco
@@ -300,7 +300,7 @@ nbr_err_ttl=0;
  b13[lat,lon]={1,2,3,4,5,6,7,8};
  b14[lon,lat]={1,5,2,6,3,7,4,8};
 
- b15=b13*b14; 
+ b15=b14*b13; 
  if( (b15-b13*b13).total() !=0 || b15(0,1) != 4  )
   {
      print("ERROR: b15 b) var_var_op(*) conformance\n");
@@ -308,7 +308,7 @@ nbr_err_ttl=0;
   }
   
  b16=b14+b13; 
- if( (b16-2*b14).total() !=0 || b16(0,1) != 10 )
+ if( (b16-2*b13).total() !=0 || b16(0,1) != 4 )
   {
      print("ERROR: b16 b) var_var_op(+) conformance\n");
      nbr_err++;	
@@ -348,6 +348,34 @@ nbr_err_ttl=0;
   }
  
 
+ // mabs,mibs,mebs 
+ b23[time]={-10.0,-6.0, -0.5,2.0,3.0,4.0,5.0,6.0,7.0,8.0};
+ if( b23.mabs() != 10.0 )   
+  {
+     print("ERROR: b23) error with mabs()\n");
+     nbr_err++;	
+  }
+
+  if( b23.mibs() != 0.5 )   
+  {
+     print("ERROR: b23) error with mibs()\n");
+     nbr_err++;	
+  }
+
+  if( b23.tabs() != 51.5 )   
+  {
+     print("ERROR: b23) error with tabs()\n");
+     nbr_err++;	
+  }
+
+  
+  if( b23.mebs() != 5.15 )   
+  {
+     print("ERROR: b23) error with mebs()\n");
+     nbr_err++;	
+  }
+
+ 
 
   print("RESULTS block b: Num errors="); print(nbr_err,"%d");
   nbr_err_ttl+=nbr_err;
diff --git a/data/buggy.cdl b/data/buggy.cdl
index 6253921..1d2173c 100644
--- a/data/buggy.cdl
+++ b/data/buggy.cdl
@@ -56,7 +56,7 @@ netcdf buggy {
  nan_arr:note4 = "If your NCO build fails because your version of netCDF does not support nan, then cd to the directory that contains the file nco/data/in.cdl and run the command in note5 first and then try to build again";
  nan_arr:note5 = "sed -e 's/nan;/1.0f;/' in.cdl > foo.cdl;ncgen -b -o in.nc foo.cdl";
  nan_arr:note6 = "It is too troublesome to distribute in.cdl with references to NaNs because users always build with old netCDF versions that do not support it. So just comment out nan's for now.";
- nan_arr:_FillValue = nan;
+ nan_arr:_FillValue = nanf;
 
  float nan_scl;
  nan_scl:long_name = "Intended for scalar representation of IEEE NaN";
@@ -64,7 +64,7 @@ netcdf buggy {
  nan_scl:note2 = "20120330 netCDF ncgen on AIX/bluefire chokes on variable/attribute values of nan";
  nan_scl:note3 = "20120625 netCDF ncgen on netCDF 4.1.1 on apparently chokes on variable/attribute values of nan";
  nan_scl:note6 = "It is too troublesome to distribute in.cdl with references to NaNs because users always build with old netCDF versions that do not support it. So just comment out nan's for now.";
- nan_scl:_FillValue = nan;
+ nan_scl:_FillValue = nanf;
 
  float nan_val;
  nan_val:long_name = "Intended for scalar representation of IEEE NaN without missing values";
@@ -120,9 +120,9 @@ netcdf buggy {
 
   lat_time={1,2,3,4,5,6,7,8,9,10},{11,12,13,14,15,16,17,18,19,20};
 
-  nan_arr=0,nan;
-  nan_scl=nan;
-  nan_val=nan;
+  nan_arr=0,nanf;
+  nan_scl=nanf;
+  nan_val=nanf;
   nan_val_dbl=nan;
 
    // 20130208: netCDF 4.2.1.1- fail as nc_get_var1_uint() returns -60 = NetCDF: Numeric conversion not representable on (valid) input values exceeding INT_MAX=2147483647. This was bug netCDF #PUX-602809 fixed in daily snapshot 20130210.
diff --git a/data/clc.cdl b/data/clc.cdl
index 2e6ae06..9b88e6d 100644
--- a/data/clc.cdl
+++ b/data/clc.cdl
@@ -1,7 +1,7 @@
 // ncgen -k netCDF-4 -b -o ~/nco/data/clc.nc ~/nco/data/clc.cdl
 
 netcdf clc {
-  :Conventions = "CF-1.5";
+  :Conventions = "CF-1.5 CF2-Group-2.0";
   :history = "Tue Apr 25 12:46:10 PDT 2017: ncgen -k netCDF-4 -b -o ~/nco/data/clc.nc ~/nco/data/clc.cdl";
   :Purpose = "Demonstrate a collection of related datasets stored in hierarchical format";
 
diff --git a/data/in.cdl b/data/in.cdl
index a39abdb..c6c4a0c 100644
--- a/data/in.cdl
+++ b/data/in.cdl
@@ -12,7 +12,7 @@
 // /usr/local/bin/ncgen -k hdf5-nc3 -b -o in_4c.nc in.cdl
 // /usr/local/bin/ncgen -k hdf5-nc3 -b -o ${HOME}/nco/data/in_4c.nc ${HOME}/nco/data/in.cdl
 
-// URL: 
+// URL:
 // http://dust.ess.uci.edu/nco/in.nc
 // http://dust.ess.uci.edu/nco/in_4.nc
 // http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc
@@ -454,6 +454,11 @@ variables:
 	mss_val_scl:long_name = "scalar missing value";
 	mss_val_scl:_FillValue = 1.0e36f;
 
+	float mss_val_scl_sml;
+	mss_val_scl_sml:long_name = "scalar missing value";
+	mss_val_scl_sml:purpose = "Unlike mss_val_scl, mss_val_scl_sml has a missing value that fits within any packed data type range";
+	mss_val_scl_sml:_FillValue = 1.0e4f;
+
 	float mss_val_fst(lon);
 	mss_val_fst:long_name = "offset partial missing value example";
 	mss_val_fst:_FillValue = -999.0f;
@@ -581,6 +586,7 @@ variables:
 	float scalar_var;
 	scalar_var:long_name = "scalar variable";
 	scalar_var:units = "fraction";
+	scalar_var:_FillValue = 1.0e36f;
 
 	float float_var;
 	float_var:long_name = "float";
@@ -932,6 +938,16 @@ variables:
         orog:cell_measures = "area: areacella" ;
         orog:purpose = "Replicate processing of files produced by CESM and distributed on ESGF" ;
 
+	float orog2(lat,lon);
+	orog2:long_name = "Value of 1 everywhere on latxlon grid";
+	orog2:units = "fraction";
+        orog2:purpose = "debug TODO nco1138" ;
+
+	float orog3(lat,lon);
+	orog3:long_name = "Value of 0 first half, 1 second half on latxlon grid";
+	orog3:units = "fraction";
+        orog3:purpose = "debug TODO nco1138" ;
+
 	float weight(lat);
 	weight:long_name = "Gaussian weight";
 	weight:units = "fraction";
@@ -1410,7 +1426,9 @@ data:
 	var_msk=0.,1.,0.,0.,1.,1.,0.,2.;
 	ORO=0.,1.,0.,0.,1.,1.,0.,2.;
 	orog=0.,1.,0.,0.,1.,1.,0.,2.;
-	mask=0.,1.,0.,0.,1.,1.,0.,2.;
+	orog2=1.,1.,1.,1.,1.,1.,1.,1.;
+	orog3=0.,0.,0.,0.,1.,1.,1.,1.;
+	mask=0.,1.,0.,0.,1.,1.,0.,1.;
 //	mask=0.,0.,0.,0.,0.,0.,0.,0.;
 //	mask=1.,1.,1.,1.,1.,1.,1.,1.;
 	fll_val=73,-999,73,-999;
@@ -1422,9 +1440,10 @@ data:
 	mss_val_all=1.0e36,1.0e36,1.0e36,1.0e36;
 	mss_val_fst=-999,73,-999,73;
 	mss_val_scl=1.0e36;
-	//	nan_arr=0,nan;
+	mss_val_scl_sml=1.0e4;
+	//nan_arr=0,nan;
 	nan_arr=0,73;
-//	nan_scl=nan;
+	//nan_scl=nan;
 	nan_scl=1;
 	negative_one=-1.;
 	nm_pnd=1;
diff --git a/data/ncclimo b/data/ncclimo
index d10eede..0d3b186 100755
--- a/data/ncclimo
+++ b/data/ncclimo
@@ -33,7 +33,7 @@
 # Source: https://github.com/nco/nco/tree/master/data/ncclimo
 # Documentation: http://nco.sf.net/nco.html#ncclimo
 # Additional Documentation:
-# HowTo: https://acme-climate.atlassian.net/wiki/display/ATM/Generating+and+Regridding+Climatologies+%28climo+files%29+with+NCO+and+ncclimo
+# HowTo: https://acme-climate.atlassian.net/wiki/display/SIM/Generate%2C+Regrid%2C+and+Split+Climatologies+%28climo+files%29+with+ncclimo+and+ncremap
 # ACME Climatology Requirements: https://acme-climate.atlassian.net/wiki/display/ATM/Climo+Files+-+v0.3+AMIP+runs
 
 # Insta-install:
@@ -41,6 +41,7 @@
 # scp ~/nco/data/ncclimo blues.lcrc.anl.gov:bin
 # scp ~/nco/data/ncclimo cooley.alcf.anl.gov:bin
 # scp ~/nco/data/ncclimo cori.nersc.gov:bin_cori
+# scp ~/nco/data/ncclimo dust.ess.uci.edu:bin
 # scp ~/nco/data/ncclimo edison.nersc.gov:bin_edison
 # scp ~/nco/data/ncclimo rhea.ccs.ornl.gov:bin_rhea
 # scp ~/nco/data/ncclimo skyglow.ess.uci.edu:bin
@@ -114,7 +115,8 @@ case "${HOSTNAME}" in
 	# Why do cori/edison and rhea require workarounds for different packages?
 	module load gsl
 	module load udunits
-	# On cori, module load ncl installs ERWG in ${NCARG_ROOT}/../intel/bin
+	# On cori and edison, module load ncl installs ERWG 5.2 (from 2012) in ${NCARG_ROOT}/../intel/bin
+	# module load ncl/6.3.0 
 	if [ -n "${NCARG_ROOT}" ]; then
             export PATH="${NCARG_ROOT}/bin:${PATH}"
 	fi # !NCARG_ROOT
@@ -145,21 +147,21 @@ case "${HOSTNAME}" in
             export PATH="${NCL_DIR}/bin:${PATH}"
 	fi # !NCL_DIR
         export PATH='/ccs/home/zender/bin_rhea'\:${PATH}
-	export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib:/ccs/home/zender/lib_rhea'\:${LD_LIBRARY_PATH} ; ;;
+	export LD_LIBRARY_PATH='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib:/ccs/home/zender/lib_rhea'\:${LD_LIBRARY_PATH} ; ;;
     titan* )
 	source ${MODULESHOME}/init/sh # 20150607: PMC Ensures find module commands will be found
 	module load gcc
         export PATH='/ccs/home/zender/bin_titan'\:${PATH}
-	export LD_LIBRARY_PATH='/opt/cray/netcdf/4.3.2/GNU/49/lib:/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib:/ccs/home/zender/lib_titan'\:${LD_LIBRARY_PATH} ; ;;
+	export LD_LIBRARY_PATH='/opt/cray/netcdf/4.4.1.1/GNU/49/lib:/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib:/ccs/home/zender/lib_titan'\:${LD_LIBRARY_PATH} ; ;;
     ys* )
 	# 20151018: Yellowstone support not yet tested in batch mode
-	# On yellowstone, module load ncl installs ERWG in /glade/apps/opt/ncl/6.3.0/intel/12.1.5/bin (not in ${NCARG_ROOT}/bin)
+	# On yellowstone, module load ncl installs ERWG in /glade/apps/opt/ncl/6.4.0/intel/12.1.5/bin (not in ${NCARG_ROOT}/bin)
 	if [ -n "${NCARG_ROOT}" ]; then
 #            export PATH="${NCARG_ROOT}/bin:${PATH}"
-            export PATH="${PATH}:/glade/apps/opt/ncl/6.3.0/intel/12.1.5/bin"
+            export PATH="${PATH}:/glade/apps/opt/ncl/6.4.0/intel/12.1.5/bin"
 	fi # !NCARG_ROOT
         export PATH='/glade/u/home/zender/bin'\:${PATH}
-        export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
+        export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
 esac # !HOSTNAME
 
 # Production usage:
@@ -216,8 +218,13 @@ esac # !HOSTNAME
 # cd /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run;ls *cam.h0.0[012]??* | ncclimo --dbg=1 --yr_srt=1 --yr_end=250 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
 # Daily pipe:
 # cd ${DATA}/ne30/raw;ls *h1*.nc | ncclimo --dbg=1 --job_nbr=8 --caseid=famipc5_ne30_v0.3_00007 --clm_md=dly -s 2001 -e 2002 --var=PRECT,TREFHT --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
-# SGS
+# Diurnal pipe:
+# cd ${DATA}/ne30/raw;ls *h4*.nc | ncclimo --dbg=1 --job_nbr=8 --caseid=famipc5_ne30_v0.3_00007 --clm_md=dly --tpd=8 -s 2001 -e 2002 --var=PRECT,TS,FSDS --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
+# SGS:
 # ncclimo -d 1 -v TBOT -m clm2 -c essgcm14 -s 1 -e 1 -i ${DATA}/essgcm14 -o ~/rgr --map=${DATA}/maps/map_t42_to_fv129x256_aave.20150621.nc
+# Seasons:
+# ncclimo -d 1 --csn_lst=mam,jja,son,djf,jfm,on -v FSNT -c famipc5_ne30_v0.3_00003 -s 1980 -e 1983 -i ${DATA}/ne30/raw -o ${DATA}/ne30/clm -r ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc
+# ncclimo -d 1 --csn_lst=jfm,jas,ann -v FSNT -c famipc5_ne30_v0.3_00003 -s 1980 -e 1983 -i ${DATA}/ne30/raw -o ${DATA}/ne30/clm -r ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc
 
 # Best performance on resolutions finer than ne30 (~1x1 degree) requires a job scheduler/batch processor
 # Cobalt (cooley), SLURM (cori,edison), Maui (a PBS-variant) (blues), Torque (a PBS-variant) (hopper), and PBS (rhea) schedulers allow both interactive and non-interactive (i.e., script) batch jobs
@@ -346,6 +353,12 @@ drc_nco="$( cd -P "$( dirname "${nco_exe}" )" && pwd )"
 nco_vrs=$(ncks --version 2>&1 > /dev/null | grep NCO | awk '{print $5}')
 lbr_vrs=$(ncks --library 2>&1 > /dev/null | awk '{print $6}')
 
+# Detect and warn about mixed modules (for Qi Tang 20170531)
+if [ "${drc_spt}" != "${drc_nco}" ]; then
+    echo "WARNING: Possible mixture of NCO versions from different locations. Script ${spt_nm} is from directory ${drc_spt} while NCO binaries are from directory ${drc_nco}. Normally the script and binaries are from the same executables directory. This WARNING may be safely ignore for customized scripts and/or binaries that the user has intentionally split into different directories."
+    echo "HINT: Conflicting script and binary directories may result from 1) Hardcoding an NCO script and/or binary pathname, 2) Having incomplete NCO installations in one or more directories in the \$PATH environment variable, 3) Loading multiple NCO modules with different locations."
+fi # drc_spt
+
 # When running in a terminal window (not in an non-interactive batch queue)...
 if [ -n "${TERM}" ]; then
     # Set fonts for legibility
@@ -373,6 +386,7 @@ caseid_xmp='famipc5_ne30_v0.3_00003' # [sng] Case ID for examples
 cf_flg='Yes' # [sng] Produce CF climatology attribute?
 clm_flg='Yes' # [sng] Generate climatology
 clm_md='mth' # [sng] Climatology mode ('ann', 'dly', or 'mth')
+csn_lst='mam,jja,son,djf' # [sng] Seasons to output (subset of mam,jja,son,djf,jfm,amj,jas,ond,fm,on)
 dbg_lvl=0 # [nbr] Debugging level
 dec_md='scd' # [sng] December mode ('scd' or 'sdd' as per above)
 drc_in='' # [sng] Input file directory
@@ -454,6 +468,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rgr_map${fnt_nrm}  Regrid map (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}-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}]"
     echo "${fnt_rvr}-s${fnt_nrm} ${fnt_bld}yr_srt${fnt_nrm}   Start year (default ${fnt_bld}${yr_srt}${fnt_nrm}) [${fnt_tlc}yr_srt, start_yr, year_start, start_year, start${fnt_nrm}]"
+    echo " ${fnt_bld}--seasons${fnt_nrm}  Seasons to output ('none' means none) (default ${fnt_bld}${csn_lst}${fnt_nrm}) [${fnt_tlc}csn_lst, csn, seasons${fnt_nrm}]"
     echo " ${fnt_bld}--std_flg${fnt_nrm}  Stdin used for input (default ${fnt_bld}${inp_std}${fnt_nrm}) [${fnt_tlc}stdin, std_flg, inp_std, redirect, standard_input${fnt_nrm}]"
     echo "${fnt_rvr}-t${fnt_nrm} ${fnt_bld}thr_nbr${fnt_nrm}  Thread number for regridder (default ${fnt_bld}${thr_nbr}${fnt_nrm}) [${fnt_tlc}thr_nbr, thread_number, thread, threads${fnt_nrm}]"
     echo " ${fnt_bld}--tpd_out${fnt_nrm}  Timesteps-per-day in output (default ${fnt_bld}${tpd_out}${fnt_nrm}) [${fnt_tlc}tpd_out, tpd, timesteps_per_day${fnt_nrm}]"
@@ -592,6 +607,7 @@ while getopts :a:C:c:d:E:e:f:h:i:j:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
 	       rgr_map=?* | regrid_map=?* | map=?* ) rgr_map="${LONG_OPTARG}" ;; # -r # Regridding map
 	       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
 	       stdin | inp_std | std_flg | redirect | standard_input ) inp_std='Yes' ;; # # Input file list from stdin
 	       stdin=?* | inp_std=?* | std_flg=?* | redirect=?* | standard_input=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Input file list from stdin
 	       thr_nbr=?* | thread_number=?* | thread=?* | threads=?* ) thr_usr="${LONG_OPTARG}" ;; # -t # Thread number
@@ -604,10 +620,10 @@ while getopts :a:C:c:d:E:e:f:h:i:j:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
 	       drc_rgr_prv=?* | drc_prv_rgr=?* | regridded_previous=?* | previous_regridded=?* ) drc_rgr_prv="${LONG_OPTARG}" ;; # -y # Regridded previous climo directory
 	       ypf_max=?* | ypf=?* | years=?* | years_per_file=?* ) ypf_max_usr="${LONG_OPTARG}" ;; # -z # Years-per-output-file maximum
                '' ) break ;; # "--" terminates argument processing
-               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
+               * ) printf "\nERROR: Unrecognized option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
 	   esac ;; # !OPTARG
 	\?) # Unrecognized option
-	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed\n" >&2
+	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not recognized\n" >&2
 	    fnc_usg_prn ;;
     esac # !OPT
 done # !getopts
@@ -620,7 +636,7 @@ if [ ${vrs_prn} = 'Yes' ]; then
     printf "${spt_nm}, the NCO climatology operator, version ${nco_vrs}\n"
     printf "Copyright (C) 2016--2017 Charlie Zender\n"
     printf "This program is part of NCO, the netCDF Operators\n"
-    printf "NCO is free software and comes with a BIG FAT KISS and ABOLUTELY NO WARRANTY\n"
+    printf "NCO is free software and comes with a BIG FAT KISS and ABSOLUTELY NO WARRANTY\n"
     printf "You may redistribute and/or modify NCO under the terms of the\n"
     printf "GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file\n"
     printf "GPL: http://www.gnu.org/copyleft/gpl.html\n"
@@ -697,6 +713,12 @@ if [ -n "${yr_srt_prv}" ]; then
 fi # !yr_srt_prv extended climo
 if [ -n "${clm_md_usr}" ]; then 
     # Climo mode must be explicitly selected with --clm_md when climo input files are piped or positional
+    if [ "${clm_md_usr}" = 'daily' ] || [ "${clm_md_usr}" = 'doy' ] || [ "${clm_md_usr}" = 'day' ] ; then
+	clm_md_usr='dly'
+    fi # !clm_md
+    if [ "${clm_md_usr}" = 'annual' ] || [ "${clm_md_usr}" = 'yearly' ] || [ "${clm_md_usr}" = 'year' ] ; then
+	clm_md_usr='ann'
+    fi # !clm_md
     clm_md="${clm_md_usr}"
     clm_flg='Yes' # redundant (and safe)
 else
@@ -791,6 +813,13 @@ if [[ "${caseid}" =~ ^(.*)([0-9][0-9][0-9][0-9][01][0-9].nc.?)$ ]]; then
     out_nm=${bs_nm}
     bs_sfx="${caseid#*.}"
 fi # !caseid
+if [ -n "${csn_lst}" ]; then
+    csn_flg='Yes'
+    if [ ${csn_lst} = 'none' ]; then
+	csn_nbr=0
+	csn_flg='No'
+    fi # !csn_lst
+fi # !csn_lst
 if [ "${clm_md}" != 'ann' ] && [ "${clm_md}" != 'dly' ] && [ "${clm_md}" != 'mth' ] ; then 
     echo "${spt_nm}: ERROR User-defined climatology mode is ${clm_md}. Valid options are 'ann', 'dly', or 'mth' (default)"
     exit 1
@@ -802,7 +831,7 @@ elif [ "${clm_md}" = 'dly' ]; then
     clm_nbr=${dpy}
     dec_md='sdd'
 elif [ "${clm_md}" = 'mth' ]; then 
-    clm_nbr=17
+    clm_nbr=12
 fi # !clm_md
 if [ -z "${drc_in}" ]; then
     drc_in="${drc_pwd}"
@@ -1009,6 +1038,166 @@ else # !sbs_flg
 
 fi # !sbs_flg
 
+# 20170807 Custom seasons
+if [ "${csn_flg}" = 'Yes' ]; then
+
+    if [ "${clm_md}" != 'mth' ]; then
+	echo "${spt_nm}: ERROR Custom seasons available only in monthly climatology mode"
+	echo "${spt_nm}: HINT Re-run with --clm_md=mth or without --csn_lst/--seasons"
+	exit 1
+    fi # !mth
+
+    # Standard and custom season definitions
+    # Index into season definition table
+    csn_idx_srt=0 # [idx] Starting index for season definitions
+    csn_mam=0
+    csn_jja=1
+    csn_son=2
+    csn_djf=3
+    csn_jfm=4
+    csn_amj=5
+    csn_jas=6
+    csn_ond=7
+    csn_on=8
+    csn_fm=9
+    csn_ann=10
+    csn_nbr_max=11 # [nbr] Maximum number of seasons in definitions database
+
+    # Seasonal abbreviations, uppercase
+    csn_abb[${csn_mam}]='MAM'
+    csn_abb[${csn_jja}]='JJA'
+    csn_abb[${csn_son}]='SON'
+    csn_abb[${csn_djf}]='DJF'
+    csn_abb[${csn_jfm}]='JFM'
+    csn_abb[${csn_amj}]='AMJ'
+    csn_abb[${csn_jas}]='JAS'
+    csn_abb[${csn_ond}]='OND'
+    csn_abb[${csn_on}]='ON'
+    csn_abb[${csn_fm}]='FM'
+    csn_abb[${csn_ann}]='ANN'
+
+    # Seasonal abbreviations, lowercase
+    csn_abb_lc[${csn_mam}]='mam'
+    csn_abb_lc[${csn_jja}]='jja'
+    csn_abb_lc[${csn_son}]='son'
+    csn_abb_lc[${csn_djf}]='djf'
+    csn_abb_lc[${csn_jfm}]='jfm'
+    csn_abb_lc[${csn_amj}]='amj'
+    csn_abb_lc[${csn_jas}]='jas'
+    csn_abb_lc[${csn_ond}]='ond'
+    csn_abb_lc[${csn_on}]='on'
+    csn_abb_lc[${csn_fm}]='fm'
+    csn_abb_lc[${csn_ann}]='ann'
+
+    # Seasonal start-month index (1-based calendar)
+    csn_srt_idx[${csn_mam}]=3
+    csn_srt_idx[${csn_jja}]=6
+    csn_srt_idx[${csn_son}]=9
+    csn_srt_idx[${csn_djf}]=12
+    csn_srt_idx[${csn_jfm}]=1
+    csn_srt_idx[${csn_amj}]=4
+    csn_srt_idx[${csn_jas}]=7
+    csn_srt_idx[${csn_ond}]=10
+    csn_srt_idx[${csn_on}]=10
+    csn_srt_idx[${csn_fm}]=2
+    csn_srt_idx[${csn_ann}]=1
+
+    # Seasonal end-month index (1-based calendar)
+    csn_end_idx[${csn_mam}]=5
+    csn_end_idx[${csn_jja}]=8
+    csn_end_idx[${csn_son}]=11
+    csn_end_idx[${csn_djf}]=2
+    csn_end_idx[${csn_jfm}]=3
+    csn_end_idx[${csn_amj}]=6
+    csn_end_idx[${csn_jas}]=9
+    csn_end_idx[${csn_ond}]=12
+    csn_end_idx[${csn_on}]=11
+    csn_end_idx[${csn_fm}]=3
+    csn_end_idx[${csn_ann}]=12
+
+    for ((csn_idx=0;csn_idx<${csn_nbr_max};csn_idx++)); do
+	csn_srt_mm[${csn_idx}]=`printf "%02d" ${csn_srt_idx[${csn_idx}]}`
+	csn_end_mm[${csn_idx}]=`printf "%02d" ${csn_end_idx[${csn_idx}]}`
+    done # !csn_idx
+
+    # Seasonal number of months
+    csn_nom[${csn_mam}]=3
+    csn_nom[${csn_jja}]=3
+    csn_nom[${csn_son}]=3
+    csn_nom[${csn_djf}]=3
+    csn_nom[${csn_jfm}]=3
+    csn_nom[${csn_amj}]=3
+    csn_nom[${csn_jas}]=3
+    csn_nom[${csn_ond}]=3
+    csn_nom[${csn_on}]=2
+    csn_nom[${csn_fm}]=2
+    csn_nom[${csn_ann}]=12
+
+    # Seasonal monthly weights (ncra -w argument)
+    csn_wgt[${csn_mam}]='31,30,31'
+    csn_wgt[${csn_jja}]='30,31,31'
+    csn_wgt[${csn_son}]='30,31,30'
+    csn_wgt[${csn_djf}]='31,31,28'
+    csn_wgt[${csn_jfm}]='31,28,31'
+    csn_wgt[${csn_amj}]='30,31,30'
+    csn_wgt[${csn_jas}]='31,31,30'
+    csn_wgt[${csn_ond}]='31,30,31'
+    csn_wgt[${csn_on}]='31,30'
+    csn_wgt[${csn_fm}]='28,31'
+    csn_wgt[${csn_ann}]='31,28,31,30,31,30,31,31,30,31,30,31'
+
+    # Which seasons are requested?
+    # http://stackoverflow.com/questions/27702452/loop-through-a-comma-separated-shell-variable
+    csn_nbr=0 # [sng] Number of seasons to compute
+    for csn in ${csn_lst//,/ }; do
+	csn_rqs[${csn_nbr}]=${csn}
+	# NB: Requested seasons are 0-based, defined seasons are 0-based
+	for ((csn_dfn_idx=${csn_idx_srt};csn_dfn_idx<${csn_nbr_max};csn_dfn_idx++)); do
+	    if [[ "${csn}" =~ 'ANN' ]] || [[ "${csn}" =~ 'ann' ]]; then
+		printf "${spt_nm}: ERROR Requested season ${csn} not yet supported\n"
+#		exit 1
+	    fi # !ANN
+	    if [[ "${csn}" =~ "${csn_abb[${csn_dfn_idx}]}" ]] || [[ "${csn}" =~ "${csn_abb_lc[${csn_dfn_idx}]}" ]]; then
+		# Map requested to defined (r2d) seasons and inverse (d2r)
+		# map_r2d[0]=3 means first season that user requested (i.e., in csn_lst) is fourth defined in table
+		# map_d2r[3]=0 means fourth defined season is first requested
+		map_r2d[${csn_nbr}]=${csn_dfn_idx}
+		map_d2r[${csn_dfn_idx}]=${csn_nbr}
+		let csn_nbr=${csn_nbr}+1
+		break
+	    fi # !match
+	done # !csn_dfn_idx
+	if [ "${csn_dfn_idx}" -eq "${csn_nbr_max}" ]; then
+	    printf "${spt_nm}: ERROR Requested season ${csn} not defined\n"
+	    exit 1
+	fi # !match
+    done # !csn_lst
+
+    # Were all four seasons requested so annual mean can be computed from seasons?
+    ann_flg='No'
+    ann_nbr=0
+    if [[ ${csn_lst} =~ 'mam' ]] || [[ ${csn_lst} =~ 'MAM' ]]; then
+	let clm_csn_mam_idx=${map_d2r[${csn_mam}]}+12+1
+	if [[ ${csn_lst} =~ 'jja' ]] || [[ ${csn_lst} =~ 'JJA' ]]; then
+	    let clm_csn_jja_idx=${map_d2r[${csn_jja}]}+12+1
+	    if [[ ${csn_lst} =~ 'son' ]] || [[ ${csn_lst} =~ 'SON' ]]; then
+		let clm_csn_son_idx=${map_d2r[${csn_son}]}+12+1
+		if [[ ${csn_lst} =~ 'djf' ]] || [[ ${csn_lst} =~ 'DJF' ]]; then
+		    let clm_csn_djf_idx=${map_d2r[${csn_djf}]}+12+1
+		    ann_flg='Yes'
+		    ann_nbr=1
+		fi # !djf
+	    fi # !son
+	fi # !jja
+    fi # !mam
+
+    # Account for season number in climatology command number and parallelism
+    let clm_csn_srt_idx=12+1
+    let clm_csn_end_idx=12+${csn_nbr}
+    let clm_nbr=12+${csn_nbr}+${ann_nbr}
+    
+fi # !csn_flg
+    
 if [ "${mpi_flg}" = 'Yes' ]; then
     if [ -n "${COBALT_NODEFILE}" ]; then 
 	nd_fl="${COBALT_NODEFILE}"
@@ -1092,6 +1281,8 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: clm_flg  = ${clm_flg}\n"
     printf "dbg: clm_md   = ${clm_md}\n"
     printf "dbg: clm_nbr  = ${clm_nbr}\n"
+    printf "dbg: csn_lst  = ${csn_lst}\n"
+    printf "dbg: csn_nbr  = ${csn_nbr}\n"
     printf "dbg: dec_md   = ${dec_md}\n"
     printf "dbg: dbg_lvl  = ${dbg_lvl}\n"
     printf "dbg: drc_in   = ${drc_in}\n"
@@ -1133,6 +1324,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"
+    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"
+	done # !csn_idx
+    fi # !csn
     if [ "${sbs_flg}" = 'Yes' ]; then
 	printf "dbg: Will split into files for ${var_nbr} variables:\n"
 	for ((var_idx=0;var_idx<${var_nbr};var_idx++)); do
@@ -1251,7 +1447,9 @@ if [ "${clm_flg}" = 'Yes' ]; then
     elif [ ${clm_md} = 'mth' ]; then 
 	printf "Each input file assumed to contain mean of one month\n"
     fi # !mth
-    if [ ${clm_md} = 'mth' ]; then 
+    if [ ${csn_flg} = 'No' ]; then 
+	printf "Seasons and therefore annual means have been turned-off and will not be computed\n"
+    elif [ ${clm_md} = 'mth' ]; then 
 	if [ ${dec_md} = 'scd' ]; then 
 	    printf "Winter statistics based on seasonally contiguous December (scd-mode): DJF sequences are consecutive and cross calendar-year boundaries\n"
 	else
@@ -1325,12 +1523,27 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ]; then
     done # !mth
 
     # Monthly output filenames constructed above; specify remaining (seasonal, annual) output names
-    fl_out[13]="${drc_out}/${out_nm}_MAM_${yyyy_srt}03_${yyyy_end}05_climo.nc"
-    fl_out[14]="${drc_out}/${out_nm}_JJA_${yyyy_srt}06_${yyyy_end}08_climo.nc"
-    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"
-    fl_out[17]="${drc_out}/${out_nm}_ANN_${yyyy_clm_srt_dec}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
-    # Derive all seventeen regridded and AMWG names from output names
+    for ((csn_idx=0;csn_idx<${csn_nbr};csn_idx++)); do
+	# Produces names like "${out_nm}_MAM_${yyyy_srt}03_${yyyy_end}05_climo.nc"
+	let clm_idx=1+12+${csn_idx}
+	fl_out[${clm_idx}]="${drc_out}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_srt}${csn_srt_mm[${map_r2d[${csn_idx}]}]}_${yyyy_end}${csn_end_mm[${map_r2d[${csn_idx}]}]}_climo.nc"
+	if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'DJF' ]; then
+	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
+	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
+	fi # !DJF
+	if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'ANN' ]; then
+	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+	fi # !DJF
+    done # !csn_idx
+#    fl_out[13]="${drc_out}/${out_nm}_MAM_${yyyy_srt}03_${yyyy_end}05_climo.nc"
+#    fl_out[14]="${drc_out}/${out_nm}_JJA_${yyyy_srt}06_${yyyy_end}08_climo.nc"
+#    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
+	fl_out[${clm_nbr}]="${drc_out}/${out_nm}_ANN_${yyyy_clm_srt_dec}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+    fi # !ann_flg
+    # Derive all regridded and AMWG names from output names
     for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 	fl_amwg[${clm_idx}]=`expr match "${fl_out[${clm_idx}]}" '\(.*\)_.*_.*_climo.nc'` # Prune _YYYYYMM_YYYYMM_climo.nc
 	fl_amwg[${clm_idx}]="${fl_amwg[${clm_idx}]}_climo.nc" # Replace with _climo.nc
@@ -1382,7 +1595,6 @@ if [ "${sbs_flg}" = 'Yes' ]; then
 	    yyyy_srt_sgm[${sgm_idx}]=`printf "%04d" ${yr_srt_sgm}`
 	    yyyy_end_sgm[${sgm_idx}]=`printf "%04d" ${yr_end_sgm}`
 	done # !fl_idx
-	#printf "dbg: fxm fl_sgm[${sgm_idx}]=${fl_sgm[${sgm_idx}]}\n"
 
 	for fl_crr in ${fl_sgm[${sgm_idx}]} ; do
 	    if [ ! -f "${fl_crr}" ]; then
@@ -1641,7 +1853,6 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'dly' ]; then
     let srd=${dpy}*${tpd_out}
     drn=${tpd_out}
     
-    # fxm stormy
     yyyy_srt=`printf "%04d" ${yr_srt}`
     yyyy_end=`printf "%04d" ${yr_end}`
     clm_idx=0
@@ -1650,10 +1861,16 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'dly' ]; then
 	for day in `seq 1 ${dpm[${mth}]}`; do
 	    DD=`printf "%02d" ${day}`
 	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${yyyy_srt}${MM}${DD}_${yyyy_end}${MM}${DD}_climo.nc"
+	    fl_cat[${clm_idx}]="${drc_out}/${out_nm}_${yyyy_srt}${MM}${DD}_${yyyy_end}${MM}${DD}_ncrcat.nc"
 	    fl_rgr[${clm_idx}]="${fl_out[${clm_idx}]/${drc_out}/${drc_rgr}}"
 	    tm_srt="${yyyy_srt}-${MM}-${DD} 00:00:00"
 	    tm_end="${yyyy_end}-${MM}-${DD} 23:59:59"
-	    cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},${drn} ${fl_all} -p ${drc_in} ${fl_out[${clm_idx}]}"
+	    if [ ${tpd_out} -eq 1 ]; then
+		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},1 -p ${drc_in} ${fl_all} ${fl_out[${clm_idx}]}"
+	    else
+		# 20170619: Diurnal mode is really slow on MacOSX (UDUnits parsing sluggishness?)
+		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncrcat -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},${drn} -p ${drc_in} ${fl_all} ${fl_cat[${clm_idx}]};/bin/rm -f ${fl_out[${clm_idx}]};for srt in `seq 0 $((tpd_out-1))`; do ncra --rec_apn -d time,\${srt},,${tpd_out} ${nco_opt} ${gaa_sng} ${fl_cat[${clm_idx}]} ${fl_out[${clm_idx}]};done;/bin/rm -f ${fl_cat[${clm_idx}]}"
+	    fi # !tpd
 	    let clm_idx=${clm_idx}+1
 	done # !day
     done # !mth
@@ -1851,6 +2068,7 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No'
 	    fi # !err
 	done # !clm_idx
     fi # !par_opt
+    # fxm: 20170809 what does this next line wait for? superfluous?
     wait
     
     # Block 1: Loop 4: Regrid first twelve files. Load-balance by using idle nodes (nodes not used for seasonal climatologies).
@@ -1858,9 +2076,9 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No'
 	printf "Regrid monthly data...\n"
 	for ((clm_idx=1;clm_idx<=12;clm_idx++)); do
 	    # NB: Months, seasons, files are 1-based ([1..12], [13..16], [1..17]), nodes are 0-based ([0..11])
-	    let nd_idx=$(((clm_idx-1+4) % nd_nbr))
-	    if [ ${nd_idx} -lt 4 ]; then
-		let nd_idx=${nd_idx}+4
+	    let nd_idx=$(((clm_idx-1+csn_nbr) % nd_nbr))
+	    if [ ${nd_idx} -lt ${csn_nbr} ]; then
+		let nd_idx=${nd_idx}+${csn_nbr}
 	    fi # !nd
 	    cmd_rgr[${clm_idx}]="${cmd_mpi[${nd_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${clm_idx}]} ${fl_rgr[${clm_idx}]}"
 	    if [ "${mdl_typ}" = 'mpas' ]; then
@@ -1881,36 +2099,50 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No'
 		    rgr_pid[${clm_idx}]=$!
 		fi # !par_opt
 	    fi # !dbg
-	done 
+	done # !clm_idx
 	# Start seasonal means first, then wait() for monthly regridding to finish
     fi # !rgr_map
     
     # Block 2: Climatological seasonal means
-    # Block 2 Loop 1: Generate seasonal commands
-    printf "Climatological seasonal means...\n"
-    cmd_clm[13]="${cmd_mpi[13]} ncra --cb -O -w 31,30,31 ${nco_opt} ${gaa_sng} ${fl_out[3]} ${fl_out[4]} ${fl_out[5]} ${fl_out[13]}"
-    cmd_clm[14]="${cmd_mpi[14]} ncra --cb -O -w 30,31,31 ${nco_opt} ${gaa_sng} ${fl_out[6]} ${fl_out[7]} ${fl_out[8]} ${fl_out[14]}"
-    cmd_clm[15]="${cmd_mpi[15]} ncra --cb -O -w 30,31,30 ${nco_opt} ${gaa_sng} ${fl_out[9]} ${fl_out[10]} ${fl_out[11]} ${fl_out[15]}"
-    cmd_clm[16]="${cmd_mpi[16]} ncra --cb -O -w 31,31,28 ${nco_opt} ${gaa_sng} ${fl_out[12]} ${fl_out[1]} ${fl_out[2]} ${fl_out[16]}"
-
-    # Block 2 Loop 2: Execute and/or echo seasonal climatology commands
-    for ((clm_idx=13;clm_idx<=16;clm_idx++)); do
-	if [ ${dbg_lvl} -ge 1 ]; then
-	    echo ${cmd_clm[${clm_idx}]}
-	fi # !dbg
-	if [ ${dbg_lvl} -le 1 ]; then
-	    if [ -z "${par_opt}" ]; then
-		eval ${cmd_clm[${clm_idx}]}
-		if [ $? -ne 0 ]; then
-		    printf "${spt_nm}: ERROR seasonal climo cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
-		    exit 1
-		fi # !err
-	    else # !par_opt
-		eval ${cmd_clm[${clm_idx}]} ${par_opt}
-		clm_pid[${clm_idx}]=$!
-	    fi # !par_opt
-	fi # !dbg
-    done # !clm_idx
+    if [ "${csn_flg}" = 'Yes' ]; then
+	# Block 2 Loop 1: Generate seasonal commands
+	for ((csn_idx=0;csn_idx<${csn_nbr};csn_idx++)); do
+	    printf "Climatological seasonal mean for ${csn_abb[${map_r2d[${csn_idx}]}]} ...\n"
+	    let clm_idx=1+12+${csn_idx}
+	    fl_lst=''
+	    for ((mth_idx=${csn_srt_idx[${map_r2d[${csn_idx}]}]};mth_idx<=${csn_end_idx[${map_r2d[${csn_idx}]}]};mth_idx++)); do
+		fl_lst="${fl_lst} ${fl_out[${mth_idx}]}"
+	    done # !mth_idx
+	    cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --cb -O -w ${csn_wgt[${map_r2d[${csn_idx}]}]} ${nco_opt} ${gaa_sng} ${fl_lst} ${fl_out[${clm_idx}]}"
+	    # DJF specified as exception since month-order is non-consecutive (12,1,2)
+	    if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'DJF' ]; then
+		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --cb -O -w 31,31,28 ${nco_opt} ${gaa_sng} ${fl_out[12]} ${fl_out[1]} ${fl_out[2]} ${fl_out[${clm_idx}]}"
+	    fi # !DJF
+	done # !csn_idx
+	# cmd_clm[13]="${cmd_mpi[13]} ncra --cb -O -w 31,30,31 ${nco_opt} ${gaa_sng} ${fl_out[3]} ${fl_out[4]} ${fl_out[5]} ${fl_out[13]}"
+	# cmd_clm[14]="${cmd_mpi[14]} ncra --cb -O -w 30,31,31 ${nco_opt} ${gaa_sng} ${fl_out[6]} ${fl_out[7]} ${fl_out[8]} ${fl_out[14]}"
+	# cmd_clm[15]="${cmd_mpi[15]} ncra --cb -O -w 30,31,30 ${nco_opt} ${gaa_sng} ${fl_out[9]} ${fl_out[10]} ${fl_out[11]} ${fl_out[15]}"
+	# cmd_clm[16]="${cmd_mpi[16]} ncra --cb -O -w 31,31,28 ${nco_opt} ${gaa_sng} ${fl_out[12]} ${fl_out[1]} ${fl_out[2]} ${fl_out[16]}"
+
+	# Block 2 Loop 2: Execute and/or echo seasonal climatology commands
+	for ((clm_idx=${clm_csn_srt_idx};clm_idx<=${clm_csn_end_idx};clm_idx++)); do
+	    if [ ${dbg_lvl} -ge 1 ]; then
+		echo ${cmd_clm[${clm_idx}]}
+	    fi # !dbg
+	    if [ ${dbg_lvl} -le 1 ]; then
+		if [ -z "${par_opt}" ]; then
+		    eval ${cmd_clm[${clm_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR seasonal climo cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
+			exit 1
+		    fi # !err
+		else # !par_opt
+		    eval ${cmd_clm[${clm_idx}]} ${par_opt}
+		    clm_pid[${clm_idx}]=$!
+		fi # !par_opt
+	    fi # !dbg
+	done # !clm_idx
+    fi # !csn_flg
     # wait() for monthly regridding, if any, to finish
     if [ -n "${rgr_map}" ]; then 
 	if [ -n "${par_opt}" ]; then
@@ -1924,91 +2156,103 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No'
 	fi # !par_opt
     fi # !rgr_map
     # wait() for seasonal climatologies to finish
-    if [ -n "${par_opt}" ]; then
-	for ((clm_idx=13;clm_idx<=16;clm_idx++)); do
-	    wait ${clm_pid[${clm_idx}]}
-	    if [ $? -ne 0 ]; then
-		printf "${spt_nm}: ERROR seasonal climo cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
-		exit 1
-	    fi # !err
-	done # !clm_idx
-    fi # !par_opt
+    if [ "${csn_flg}" = 'Yes' ]; then
+	if [ -n "${par_opt}" ]; then
+	    for ((clm_idx=${clm_csn_srt_idx};clm_idx<=${clm_csn_end_idx};clm_idx++)); do
+		wait ${clm_pid[${clm_idx}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR seasonal climo cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
+		    exit 1
+		fi # !err
+	    done # !clm_idx
+	fi # !par_opt
+    fi # !csn_flg
+    # fxm: 20170809 what does this next line wait for? superfluous?
     wait
     
     # Block 2: Loop 4: Regrid seasonal files. Load-balance by using idle nodes (nodes not used for annual mean).
-    if [ -n "${rgr_map}" ]; then 
-	printf "Regrid seasonal data...\n"
-	for ((clm_idx=13;clm_idx<=16;clm_idx++)); do
-	    let nd_idx=$(((clm_idx-1+4) % nd_nbr))
-	    if [ ${nd_idx} -lt 4 ]; then
-		let nd_idx=${nd_idx}+4
-	    fi # !nd
-	    cmd_rgr[${clm_idx}]="${cmd_mpi[${nd_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${clm_idx}]} ${fl_rgr[${clm_idx}]}"
-	    if [ "${mdl_typ}" = 'mpas' ]; then
-		cmd_rgr[${clm_idx}]="${cmd_mpi[${nd_idx}]} ncremap -C -u .pid${spt_pid}.climo.${clm_idx}.tmp -P mpas -t ${thr_nbr} -m ${rgr_map} -i ${fl_out[${clm_idx}]} -o ${fl_rgr[${clm_idx}]}"
-	    fi # !mdl_typ
-	    if [ ${dbg_lvl} -ge 1 ]; then
-		echo ${cmd_rgr[${clm_idx}]}
-	    fi # !dbg
-	    if [ ${dbg_lvl} -le 1 ]; then
-		if [ -z "${par_opt}" ]; then
-		    eval ${cmd_rgr[${clm_idx}]}
+    if [ "${csn_flg}" = 'Yes' ]; then
+	if [ -n "${rgr_map}" ]; then 
+	    printf "Regrid seasonal data...\n"
+	    for ((clm_idx=${clm_csn_srt_idx};clm_idx<=${clm_csn_end_idx};clm_idx++)); do
+		let nd_idx=$(((clm_idx-1+csn_nbr) % nd_nbr))
+		if [ ${nd_idx} -lt ${csn_nbr} ]; then
+		    let nd_idx=${nd_idx}+${csn_nbr}
+		fi # !nd
+		cmd_rgr[${clm_idx}]="${cmd_mpi[${nd_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${clm_idx}]} ${fl_rgr[${clm_idx}]}"
+		if [ "${mdl_typ}" = 'mpas' ]; then
+		    cmd_rgr[${clm_idx}]="${cmd_mpi[${nd_idx}]} ncremap -C -u .pid${spt_pid}.climo.${clm_idx}.tmp -P mpas -t ${thr_nbr} -m ${rgr_map} -i ${fl_out[${clm_idx}]} -o ${fl_rgr[${clm_idx}]}"
+		fi # !mdl_typ
+		if [ ${dbg_lvl} -ge 1 ]; then
+		    echo ${cmd_rgr[${clm_idx}]}
+		fi # !dbg
+		if [ ${dbg_lvl} -le 1 ]; then
+		    if [ -z "${par_opt}" ]; then
+			eval ${cmd_rgr[${clm_idx}]}
+			if [ $? -ne 0 ]; then
+			    printf "${spt_nm}: ERROR seasonal regrid cmd_rgr[${clm_idx}] failed. Debug this:\n${cmd_rgr[${clm_idx}]}\n"
+			    exit 1
+			fi # !err
+		    else # !par_opt
+			eval ${cmd_rgr[${clm_idx}]} ${par_opt}
+			rgr_pid[${clm_idx}]=$!
+		    fi # !par_opt
+		fi # !dbg
+	    done # !clm_idx
+	    # Start annual mean first, then wait() for seasonal regridding to finish
+	fi # !rgr_map
+    fi # !csn_flg
+    
+    # Block 3: Climatological annual mean
+    if [ "${ann_flg}" = 'Yes' ]; then
+	printf "Climatological annual mean...\n"
+	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}]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${gaa_sng} ${fl_lst} ${fl_out[${clm_nbr}]}"
+	#    cmd_clm[17]="${cmd_mpi[17]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${gaa_sng} ${fl_out[13]} ${fl_out[14]} ${fl_out[15]} ${fl_out[16]} ${fl_out[17]}"
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_clm[${clm_nbr}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -le 1 ]; then
+	    if [ -z "${par_opt}" ]; then
+		eval ${cmd_clm[${clm_nbr}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR annual climo cmd_clm[${clm_nbr}] failed. Debug this:\n${cmd_clm[${clm_nbr}]}\n"
+		    exit 1
+		fi # !err
+	    else # !par_opt
+		eval ${cmd_clm[${clm_nbr}]} ${par_opt}
+		clm_pid[${clm_nbr}]=$!
+	    fi # !par_opt
+	fi # !dbg
+    fi # !ann_flg
+    # wait() for seasonal regridding, if any, to finish
+    if [ "${csn_flg}" = 'Yes' ]; then
+	if [ -n "${rgr_map}" ]; then 
+	    if [ -n "${par_opt}" ]; then
+		for ((clm_idx=${clm_csn_srt_idx};clm_idx<=${clm_csn_end_idx};clm_idx++)); do
+		    wait ${rgr_pid[${clm_idx}]}
 		    if [ $? -ne 0 ]; then
 			printf "${spt_nm}: ERROR seasonal regrid cmd_rgr[${clm_idx}] failed. Debug this:\n${cmd_rgr[${clm_idx}]}\n"
 			exit 1
 		    fi # !err
-		else # !par_opt
-		    eval ${cmd_rgr[${clm_idx}]} ${par_opt}
-		    rgr_pid[${clm_idx}]=$!
-		fi # !par_opt
-	    fi # !dbg
-	done 
-	# Start annual mean first, then wait() for seasonal regridding to finish
-    fi # !rgr_map
-    
-    # Block 3: Climatological annual mean (seventeenth file)
-    printf "Climatological annual mean...\n"
-    cmd_clm[17]="${cmd_mpi[17]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${gaa_sng} ${fl_out[13]} ${fl_out[14]} ${fl_out[15]} ${fl_out[16]} ${fl_out[17]}"
-    if [ ${dbg_lvl} -ge 1 ]; then
-	echo ${cmd_clm[17]}
-    fi # !dbg
-    if [ ${dbg_lvl} -le 1 ]; then
-	if [ -z "${par_opt}" ]; then
-	    eval ${cmd_clm[17]}
+		done # !clm_idx
+	    fi # !par_opt
+	fi # !rgr_map
+    fi # !csn_flg
+    if [ "${ann_flg}" = 'Yes' ]; then
+	clm_idx=${clm_nbr}
+	# wait() for annual climatology to finish
+	if [ -n "${par_opt}" ]; then
+	    wait ${clm_pid[${clm_idx}]}
 	    if [ $? -ne 0 ]; then
-		printf "${spt_nm}: ERROR annual climo cmd_clm[17] failed. Debug this:\n${cmd_clm[17]}\n"
+		printf "${spt_nm}: ERROR annual climo cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
 		exit 1
 	    fi # !err
-	else # !par_opt
-	    eval ${cmd_clm[17]} ${par_opt}
-	    clm_pid[17]=$!
 	fi # !par_opt
-    fi # !dbg
-    # wait() for seasonal regridding, if any, to finish
-    if [ -n "${rgr_map}" ]; then 
-	if [ -n "${par_opt}" ]; then
-	    for ((clm_idx=13;clm_idx<=16;clm_idx++)); do
-		wait ${rgr_pid[${clm_idx}]}
-		if [ $? -ne 0 ]; then
-		    printf "${spt_nm}: ERROR seasonal regrid cmd_rgr[${clm_idx}] failed. Debug this:\n${cmd_rgr[${clm_idx}]}\n"
-		    exit 1
-		fi # !err
-	    done # !clm_idx
-	fi # !par_opt
-    fi # !rgr_map
-    # wait() for annual climatology to finish
-    if [ -n "${par_opt}" ]; then
-	wait ${clm_pid[17]}
-	if [ $? -ne 0 ]; then
-	    printf "${spt_nm}: ERROR annual climo cmd_clm[17] failed. Debug this:\n${cmd_clm[17]}\n"
-	    exit 1
-	fi # !err
-    fi # !par_opt
-    
-    # Block 5: Regrid climatological annual mean
-    if [ -n "${rgr_map}" ]; then 
-	printf "Regrid annual data...\n"
-	for ((clm_idx=17;clm_idx<=17;clm_idx++)); do
+	
+	# Block 5: Regrid climatological annual mean
+	if [ -n "${rgr_map}" ]; then 
+	    printf "Regrid annual data...\n"
 	    cmd_rgr[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${clm_idx}]} ${fl_rgr[${clm_idx}]}"
 	    if [ "${mdl_typ}" = 'mpas' ]; then
 		cmd_rgr[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncremap -C -u .pid${spt_pid}.climo.${clm_idx}.tmp -P mpas -t ${thr_nbr} -m ${rgr_map} -i ${fl_out[${clm_idx}]} -o ${fl_rgr[${clm_idx}]}"
@@ -2017,15 +2261,15 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No'
 		echo ${cmd_rgr[${clm_idx}]}
 	    fi # !dbg
 	    if [ ${dbg_lvl} -le 1 ]; then
-		# NB: Do not background climatological mean regridding
+		# NB: Do not background climatological mean regridding since it is last step
 		eval ${cmd_rgr[${clm_idx}]}
 		if [ $? -ne 0 ]; then
 		    printf "${spt_nm}: ERROR annual regrid cmd_rgr[${clm_idx}] failed. Debug this:\n${cmd_rgr[${clm_idx}]}\n"
 		    exit 1
 		fi # !err
 	    fi # !dbg
-	done 
-    fi # !rgr_map
+	fi # !rgr_map
+    fi # !ann_flg
     
     # Link ACME-climo to AMWG-climo filenames
     # drc_pwd is always fully qualified path but drc_out and drc_rgr may be relative paths
@@ -2112,19 +2356,36 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${xtn_flg}" = 'Yes' ]; then
 	    fl_xtn[${clm_idx}]="${drc_xtn}/${out_nm}_${MM}_${yyyy_clm_srt_dec_prv}${MM}_${yyyy_clm_end_dec}${MM}_climo.nc"
 	fi # !scd
 	
-	fl_prv[13]="${drc_prv}/${out_nm}_MAM_${yyyy_srt_prv}03_${yyyy_end_prv}05_climo.nc"
-	fl_prv[14]="${drc_prv}/${out_nm}_JJA_${yyyy_srt_prv}06_${yyyy_end_prv}08_climo.nc"
-	fl_prv[15]="${drc_prv}/${out_nm}_SON_${yyyy_srt_prv}09_${yyyy_end_prv}11_climo.nc"
-	fl_prv[16]="${drc_prv}/${out_nm}_DJF_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end_prv}${mm_djf_end}_climo.nc"
-	fl_prv[17]="${drc_prv}/${out_nm}_ANN_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end_prv}${mm_ann_end}_climo.nc"
+	for ((csn_idx=0;csn_idx<${csn_nbr};csn_idx++)); do
+	    # Produce names like "${out_nm}_MAM_${yyyy_srt_prv}03_${yyyy_end_prv}05_climo.nc"
+	    let clm_idx=1+12+${csn_idx}
+	    fl_prv[${clm_idx}]="${drc_prv}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_srt_prv}${csn_srt_mm[${map_r2d[${csn_idx}]}]}_${yyyy_end_prv}${csn_end_mm[${map_r2d[${csn_idx}]}]}_climo.nc"
+	    fl_xtn[${clm_idx}]="${drc_xtn}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_srt_prv}${csn_srt_mm[${map_r2d[${csn_idx}]}]}_${yyyy_end}${csn_end_mm[${map_r2d[${csn_idx}]}]}_climo.nc"
+	    if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'DJF' ]; then
+		fl_prv[${clm_idx}]="${drc_prv}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end_prv}${mm_djf_end}_climo.nc"
+		fl_xtn[${clm_idx}]="${drc_xtn}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
+	    fi # !DJF
+	    if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'ANN' ]; then
+		fl_prv[${clm_idx}]="${drc_prv}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end_prv}${mm_ann_end}_climo.nc"
+		fl_xtn[${clm_idx}]="${drc_xtn}/${out_nm}_${csn_abb[${map_r2d[${csn_idx}]}]}_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+	    fi # !DJF
+	done # !csn_idx
+
+#	fl_prv[13]="${drc_prv}/${out_nm}_MAM_${yyyy_srt_prv}03_${yyyy_end_prv}05_climo.nc"
+#	fl_prv[14]="${drc_prv}/${out_nm}_JJA_${yyyy_srt_prv}06_${yyyy_end_prv}08_climo.nc"
+#	fl_prv[15]="${drc_prv}/${out_nm}_SON_${yyyy_srt_prv}09_${yyyy_end_prv}11_climo.nc"
+#	fl_prv[16]="${drc_prv}/${out_nm}_DJF_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end_prv}${mm_djf_end}_climo.nc"
+#	fl_xtn[13]="${drc_xtn}/${out_nm}_MAM_${yyyy_srt_prv}03_${yyyy_end}05_climo.nc"
+#	fl_xtn[14]="${drc_xtn}/${out_nm}_JJA_${yyyy_srt_prv}06_${yyyy_end}08_climo.nc"
+#	fl_xtn[15]="${drc_xtn}/${out_nm}_SON_${yyyy_srt_prv}09_${yyyy_end}11_climo.nc"
+#	fl_xtn[16]="${drc_xtn}/${out_nm}_DJF_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
 	
-	fl_xtn[13]="${drc_xtn}/${out_nm}_MAM_${yyyy_srt_prv}03_${yyyy_end}05_climo.nc"
-	fl_xtn[14]="${drc_xtn}/${out_nm}_JJA_${yyyy_srt_prv}06_${yyyy_end}08_climo.nc"
-	fl_xtn[15]="${drc_xtn}/${out_nm}_SON_${yyyy_srt_prv}09_${yyyy_end}11_climo.nc"
-	fl_xtn[16]="${drc_xtn}/${out_nm}_DJF_${yyyy_clm_srt_dec_prv}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
-	fl_xtn[17]="${drc_xtn}/${out_nm}_ANN_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+	if [ "${ann_flg}" = 'Yes' ]; then
+	    fl_prv[${clm_nbr}]="${drc_prv}/${out_nm}_ANN_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end_prv}${mm_ann_end}_climo.nc"
+	    fl_xtn[${clm_nbr}]="${drc_xtn}/${out_nm}_ANN_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
+	fi # !ann_flg
 	
-	# Derive all seventeen regridded and AMWG names from output names
+	# Derive all regridded and AMWG names from output names
 	for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 	    fl_rgr_prv[${clm_idx}]="${fl_rgr[${clm_idx}]/${drc_rgr}/${drc_rgr_prv}}"
 	    fl_rgr_prv[${clm_idx}]="${fl_rgr_prv[${clm_idx}]/_${yyyy_srt}/_${yyyy_srt_prv}}"
@@ -2138,7 +2399,14 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${xtn_flg}" = 'Yes' ]; then
 	    fl_amwg_xtn[${clm_idx}]="${fl_amwg[${clm_idx}]/${drc_xtn}\//}" # Delete prepended path to ease symlinking
 	    if [ ${dec_md} = 'scd' ] ; then
 		# Handle Dec, DJF, and ANN
-		if [ ${clm_idx} -eq 12 ] || [ ${clm_idx} -eq 16 ] || [ ${clm_idx} -eq 17 ] ; then 
+		let csn_idx=${clm_idx}-12-1
+		let ann_idx=${clm_csn_end_idx}+1
+		if [ ${csn_idx} -ge 0 ]; then
+		    if [ "${csn_abb[${map_r2d[${csn_idx}]}]}" = 'DJF' ] || [ ${clm_idx} -eq ${ann_idx} ] ; then
+			flg_djf_or_ann='Yes'
+		    fi # !djf or ann
+		fi # !csn_idx
+		if [ ${clm_idx} -eq 12 ] || [ ${flg_djf_or_ann} = 'Yes' ] ; then 
 		    fl_rgr_prv[${clm_idx}]="${fl_rgr[${clm_idx}]/${drc_rgr}/${drc_rgr_prv}}"
 		    fl_rgr_prv[${clm_idx}]="${fl_rgr_prv[${clm_idx}]/_${yyyy_clm_srt_dec}/_${yyyy_clm_srt_dec_prv}}"
 		    if [ ${clm_idx} -eq 12 ] ; then 
@@ -2259,7 +2527,7 @@ if [ "${clm_flg}" = 'Yes' ]; then
 	echo "Quick plots of last climatological daily mean:"
 	let idx_lst=${clm_nbr}-1
     else
-	echo "Quick plots of climatological annual mean:"
+	echo "Quick plots of last computed climatology:"
 	let idx_lst=${clm_nbr}
     fi # !dly
     
diff --git a/data/ncremap b/data/ncremap
index 08a77b7..75bc5ab 100755
--- a/data/ncremap
+++ b/data/ncremap
@@ -26,14 +26,17 @@
 # University of California, Irvine
 # Irvine, CA 92697-3100
 
+# Prerequisites: Bash, NCO
+# Script could use other shells, e.g., dash (Debian default) after rewriting function definition and looping constructs
+# For full functionality also install ESMF_RegridWeightGen and/or TempestRemap
+
 # Source: https://github.com/nco/nco/tree/master/data/ncremap
 # Documentation: http://nco.sf.net/nco.html#ncremap
+# Additional Documentation:
+# HowTo: https://acme-climate.atlassian.net/wiki/display/SIM/Generate%2C+Regrid%2C+and+Split+Climatologies+%28climo+files%29+with+ncclimo+and+ncremap
+# ACME Climatology Requirements: https://acme-climate.atlassian.net/wiki/display/ATM/Climo+Files+-+v0.3+AMIP+runs
 
-# Prerequisites: Bash and NCO
-# For full functionality also install ESMF_RegridWeightGen and/or TempestRemap
-# Script could use other shells, e.g., dash (Debian default) after re-writing function definition and looping constructs
-
-# Script runs in one of four modes:
+# Regridder works in one of four modes:
 # 1. Free-will: Infer source and destination grids to generate map-file, then regrid
 # 2. Old Grid: Use known-good destination grid to generate map-file then regrid
 # 3. New Grid: Generate source-grid from ncks parameter string
@@ -81,27 +84,37 @@ fi # HOSTNAME
 # Default input and output directory is ${DATA}
 if [ -z "${DATA}" ]; then
     case "${HOSTNAME}" in 
-	cooley* | cc* | mira* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN, 384 GB/node 
-	cori* | edison* | nid* ) DATA="${SCRATCH}" ; ;; # NERSC edison compute nodes named nidNNNNN, 24|64 cores|GB/node; cori 32|128 cores|GB/node
+	constance* | node* ) DATA='/scratch' ; ;; # PNNL
+	blues* | blogin* | b[0123456789][0123456789][0123456789] ) DATA="/lcrc/project/ACME/${USER}" ; ;; # ALCF blues compute nodes named bNNN, 16|64 cores|GB/node 
+	cooley* | cc[0123456789][0123456789][0123456789] | mira* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN, 384 GB/node 
+	cori* | edison* ) DATA="${SCRATCH}" ; ;; # NERSC cori/edison compute nodes all named nidNNNNN, edison 24|64 cores|GB/node; cori 32|128 cores|GB/node (cori login nodes 512 GB)
 	pileus* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF CADES
 	rhea* | titan* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF rhea compute nodes named rheaNNN, 128 GB/node
 	ys* ) DATA="/glade/p/work/${USER}" ; ;; # NCAR yellowstone compute nodes named ysNNN, 32 GB/node
 	* ) DATA='/tmp' ; ;; # Other
     esac # !HOSTNAME
 fi # DATA
-# Ensure batch jobs access correct 'mpirun' (or, on cori/edison, 'srun') command, netCDF library, and NCO executables and library:
+# Ensure batch jobs access correct 'mpirun' (or, with SLURM, 'srun') command, netCDF library, and NCO executables and library:
 case "${HOSTNAME}" in 
     aims* )
 	export PATH='/export/zender1/bin'\:${PATH}
         export LD_LIBRARY_PATH='/export/zender1/lib'\:${LD_LIBRARY_PATH} ; ;;
-    cooley* | cc* | mira* )
+    blues* | blogin* | b[0123456789][0123456789][0123456789] )
+	soft add @openmpi-gcc
+	export PATH='/home/zender/bin'\:${PATH}
+	export LD_LIBRARY_PATH='/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
+    cooley* )
+	# 20160421: Split cooley from mira binary locations to allow for different system libraries
 	# http://www.mcs.anl.gov/hs/software/systems/softenv/softenv-intro.html
 	soft add +mvapich2 
         export PBS_NUM_PPN=12 # Spoof PBS on Soft (which knows nothing about node capabilities)
-	export PATH='/home/zender/bin'\:${PATH}
-	export LD_LIBRARY_PATH='/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
-    # 20160407: Split cori from edison binary locations to allow for different system libraries
+	export PATH='/home/zender/bin_cooley'\:${PATH}
+	export LD_LIBRARY_PATH='/home/zender/lib_cooley'\:${LD_LIBRARY_PATH} ; ;;
+    mira* )
+	export PATH='/home/zender/bin_mira'\:${PATH}
+	export LD_LIBRARY_PATH='/soft/libraries/netcdf/current/library:/home/zender/lib_mira'\:${LD_LIBRARY_PATH} ; ;;
     cori* )
+	# 20160407: Separate cori from edison binary locations to allow for different system libraries
 	# 20160420: module load gsl, udunits required for non-interactive batch submissions by Wuyin Lin
 	# Not necessary for interactive, nor for CSZ non-interactive, batch submisssions
 	# Must be due to home environment differences between CSZ and other users
@@ -110,7 +123,8 @@ case "${HOSTNAME}" in
 	# Why do cori/edison and rhea require workarounds for different packages?
 	module load gsl
 	module load udunits
-	# On cori and edison, module load ncl installs ERWG in ${NCARG_ROOT}/../intel/bin
+	# On cori and edison, module load ncl installs ERWG 5.2 (from 2012) in ${NCARG_ROOT}/../intel/bin
+	# module load ncl/6.3.0 
 	if [ -n "${NCARG_ROOT}" ]; then
             export PATH="${NCARG_ROOT}/bin:${PATH}"
 	fi # !NCARG_ROOT
@@ -119,7 +133,8 @@ case "${HOSTNAME}" in
     edison* )
 	module load gsl
 	module load udunits
-	# On cori and edison, module load ncl installs ERWG in ${NCARG_ROOT}/../intel/bin
+	# On cori and edison, module load ncl installs ERWG 5.2 (from 2012) in ${NCARG_ROOT}/../intel/bin
+	# module load ncl/6.3.0 
 	if [ -n "${NCARG_ROOT}" ]; then
             export PATH="${NCARG_ROOT}/bin:${PATH}"
 	fi # !NCARG_ROOT
@@ -145,28 +160,29 @@ case "${HOSTNAME}" in
             export PATH="${NCL_DIR}/bin:${PATH}"
 	fi # !NCL_DIR
         export PATH='/ccs/home/zender/bin_rhea'\:${PATH}
-	export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib:/ccs/home/zender/lib_rhea'\:${LD_LIBRARY_PATH} ; ;;
+	export LD_LIBRARY_PATH='/autofs/nccs-svm1_sw/rhea/.swci/0-core/opt/spack/20170224/linux-rhel6-x86_64/gcc-4.4.7/netcdf-4.4.1-uroyzcwi6fc3kerfidguoof7g2vimo57/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib:/ccs/home/zender/lib_rhea'\:${LD_LIBRARY_PATH} ; ;;
     titan* )
 	source ${MODULESHOME}/init/sh # 20150607: PMC Ensures find module commands will be found
 	module load gcc
         export PATH='/ccs/home/zender/bin_titan'\:${PATH}
-	export LD_LIBRARY_PATH='/opt/cray/netcdf/4.3.2/GNU/49/lib:/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib:/ccs/home/zender/lib_titan'\:${LD_LIBRARY_PATH} ; ;;
+	export LD_LIBRARY_PATH='/opt/cray/netcdf/4.4.1.1/GNU/49/lib:/sw/xk6/udunits/2.1.24/sl_gcc4.5.3/lib:/ccs/home/zender/lib_titan'\:${LD_LIBRARY_PATH} ; ;;
     ys* )
 	# 20151018: Yellowstone support not yet tested in batch mode
-	# On yellowstone, module load ncl installs ERWG in /glade/apps/opt/ncl/6.3.0/intel/12.1.5/bin (not in ${NCARG_ROOT}/bin)
+	# On yellowstone, module load ncl installs ERWG in /glade/apps/opt/ncl/6.4.0/intel/12.1.5/bin (not in ${NCARG_ROOT}/bin)
 	if [ -n "${NCARG_ROOT}" ]; then
 #            export PATH="${NCARG_ROOT}/bin:${PATH}"
-            export PATH="${PATH}:/glade/apps/opt/ncl/6.3.0/intel/12.1.5/bin"
+            export PATH="${PATH}:/glade/apps/opt/ncl/6.4.0/intel/12.1.5/bin"
 	fi # !NCARG_ROOT
         export PATH='/glade/u/home/zender/bin'\:${PATH}
-        export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
+        export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.4.1/intel/16.0.3/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
 esac # !HOSTNAME
 
 # Test cases (for Charlie's machines)
 # Map-only:
-# ncremap -s ${DATA}/grids/oEC60to30.SCRIP.150729.nc -g ${DATA}/grids/t62_SCRIP.20150901.nc -m ~/map.nc -a bilinear -a bilinear
+# ncremap -s ${DATA}/grids/oEC60to30.SCRIP.150729.nc -g ${DATA}/grids/t62_SCRIP.20150901.nc -m ~/map.nc -a bilinear
 # ncremap -s ${DATA}/grids/oEC60to30.SCRIP.150729.nc -g ${DATA}/grids/t62_SCRIP.20150901.nc -m ~/map.nc -a tempest
 # ncremap -s ${DATA}/grids/oEC60to30.SCRIP.150729.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -m ~/map.nc -a tempest
+# ncremap -s ${DATA}/grids/128x256_SCRIP.20160301.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -m ~/map.nc -a tempest
 # Regrid:
 # ls ${DATA}/ne30/raw/*1979*.nc | ncremap -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
 # ncremap -a conserve -v FSNT -I ${DATA}/ne30/raw -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
@@ -196,8 +212,8 @@ esac # !HOSTNAME
 # ncremap -P mpas -i ${DATA}/hdf/mpaso.hist.am.timeSeriesStatsMonthly.0001-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
 # ncremap -P mpas -i ${DATA}/hdf/mpascice.hist.am.timeSeriesStatsMonthly.0251-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
 # ACME benchmarks:
-# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
-# ncremap -v FSNT,AODVIS -a bilinear    -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
+# ncremap -v FSNT,AODVIS -a conserve -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
+# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
 # ncremap -v FSNT,AODVIS -a tempest -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
 # Positional arguments:
 # ncremap --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=~/rgr ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-??.nc
@@ -212,11 +228,13 @@ esac # !HOSTNAME
 # ncremap --vrb=3 -P sgs --var=area,FSDS,landfrac,landmask,TBOT -i ${DATA}/ne30/rgr/F_acmev03_enso_camse_clm45bgc_ne30_co2cycle.clm2.h0.2000-01.nc -d ${DATA}/essgcm14/essgcm14.cam2.h0.0000-01.nc -o ~/fv09_rgr.nc # 20170510 2D->2D bilinear works and conserve ~2% wrong, infer S and D
 # ncremap --vrb=3 -P sgs --var=area,FSDS,landfrac,landmask,TBOT -i ${DATA}/ne30/rgr/F_acmev03_enso_camse_clm45bgc_ne30_co2cycle.clm2.h0.2000-01.nc -d ${HOME}/skl_t42.nc -o ~/fv09_rgr.nc # 20170510 2D->2D works bilinear and conserve ~2% wrong, infer S and D
 # ncremap --vrb=3 -p nil -P sgs -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ${DATA}/ne30/rgr ${DATA}/ne30/raw/F_acmev03_enso_camse_clm45bgc_ne30_co2cycle.clm2.h0.2000-??.nc > ~/ncremap.out 2>&1 &
-# ncremap --vrb=3 -P sgs -a conserve --sgs_frc=aice --sgs_msk=tmask --sgs_nrm=100 --var=hi,uvel,aice,aisnap,albsno,blkmask,evap,evap_ai,fswabs,fswabs_ai,fswdn,fswthru,fswthru_ai,ice_present,snow,snow_ai,tarea,tmask,uarea -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -s ${DATA}/grids/gx1v7_151008.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/cice_rgr.nc # 20170525 normalization required to get mask right
+# ncremap --vrb=3 -a conserve --sgs_frc=aice --sgs_msk=tmask --sgs_nrm=100 --var=hi,uvel,aice,aisnap,albsno,blkmask,evap,evap_ai,fswabs,fswabs_ai,fswdn,fswthru,fswthru_ai,ice_present,snow,snow_ai,tarea,tmask,uarea -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -s ${DATA}/grids/gx1v7_151008.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/cice_rgr.nc # 20170525 normalization required to get mask right
 # ncremap --vrb=3 -P cice -a conserve --var=hi,uvel,aice,aisnap,albsno,blkmask,evap,evap_ai,fswabs,fswabs_ai,fswdn,fswthru,fswthru_ai,ice_present,snow,snow_ai,tarea,tmask,uarea -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -s ${DATA}/grids/gx1v7_151008.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/cice_rgr.nc # 20170525 cice short-cut
 # CICE/CESM on POP grid: full grid inferral (and thus conservative remapping) fails because masked vertices/cells missing, must use bilinear or supply grid-file for conservative
 # ncremap -a bilinear -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/wenshan.nc # 20170515: grid centers/bounds in non-masked regions suffice for bilinear interpolation
 # ncremap -a conserve -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -s ${DATA}/grids/gx1v7_151008.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/wenshan.nc # 20170521: conservative requires supplied tri-pole grid for centers/bounds in masked regions
+# File-format
+# ncremap -v FSNT,AODVIS -s ${DATA}/grids/ne30np4_pentagons.091226.nc -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -o ~/foo.nc
 # Debugging and Benchmarking:
 # ncremap -D 1 -i ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr > ~/ncremap.out 2>&1 &
 
@@ -241,6 +259,12 @@ drc_nco="$( cd -P "$( dirname "${nco_exe}" )" && pwd )"
 nco_vrs=$(ncks --version 2>&1 > /dev/null | grep NCO | awk '{print $5}')
 lbr_vrs=$(ncks --library 2>&1 > /dev/null | awk '{print $6}')
 
+# Detect and warn about mixed modules (for Qi Tang 20170531)
+if [ "${drc_spt}" != "${drc_nco}" ]; then
+    echo "WARNING: Possible mixture of NCO versions from different locations. Script ${spt_nm} is from directory ${drc_spt} while NCO binaries are from directory ${drc_nco}. Normally the script and binaries are from the same executables directory. This WARNING may be safely ignore for customized scripts and/or binaries that the user has intentionally split into different directories."
+    echo "HINT: Conflicting script and binary directories may result from 1) Hardcoding an NCO script and/or binary pathname, 2) Having incomplete NCO installations in one or more directories in the \$PATH environment variable, 3) Loading multiple NCO modules with different locations."
+fi # drc_spt
+
 # When running in a terminal window (not in an non-interactive batch queue)...
 if [ -n "${TERM}" ]; then
     # Set fonts for legibility
@@ -273,6 +297,7 @@ drc_out_xmp="~/rgr" # [sng] Output file directory for examples
 dst_fl='' # [sng] Destination file
 dst_xmp='dst.nc' # [sng] Destination file for examples
 fl_nbr=0 # [nbr] Number of files to remap
+fl_fmt='' # [enm] Output file format
 gaa_sng="--gaa remap_script=${spt_nm} --gaa remap_command=\"'${cmd_ln}'\" --gaa remap_hostname=${HOSTNAME} --gaa remap_version=${nco_vrs}" # [sng] Global attributes to add
 grd_dst='' # [sng] Destination grid-file
 grd_dst_xmp='grd_dst.nc' # [sng] Destination grid-file for examples
@@ -304,7 +329,7 @@ out_fl='' # [sng] Output file
 out_xmp='out.nc' # [sng] Output file for examples
 par_typ='nil' # [sng] Parallelism type
 prc_typ='' # [sng] Procedure type
-rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon' # [sng] Regridding options
+rgr_opt='--rgr lat_nm_out=lat#lon_nm_out=lon' # [sng] Regridding options
 rnr_thr='' # [frc] Renormalization option
 sgs_frc='landfrac' # [sng] Sub-grid fraction variable
 sgs_msk='landmask' # [sng] Sub-grid mask variable
@@ -350,9 +375,15 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     printf "${fnt_rvr}Basic usage:\n${fnt_nrm} ${fnt_bld}$spt_nm -i in_fl -d dst_fl -o out_fl${fnt_nrm}\n"
     printf "${fnt_nrm} ${fnt_bld}${spt_nm} --input_file=in_fl --destination=dst_fl --output_file=out_fl${fnt_nrm}\n\n"
     echo "Command-line options [long-option synonyms in ${fnt_tlc}italics${fnt_nrm}]:"
+    echo "${fnt_rvr}-3${fnt_nrm}          Output file format CLASSIC (netCDF3 classic) [${fnt_tlc}fl_fmt, file_format=classic${fnt_nrm}]"
+    echo "${fnt_rvr}-4${fnt_nrm}          Output file format NETCDF4 (netCDF4 extended) [${fnt_tlc}fl_fmt, file_format=netcdf4${fnt_nrm}]"
+    echo "${fnt_rvr}-5${fnt_nrm}          Output file format 64BIT_DATA (pnetCDF3) [${fnt_tlc}fl_fmt, file_format=64bit_data${fnt_nrm}]"
+    echo "${fnt_rvr}-6${fnt_nrm}          Output file format 64BIT_OFFSET (netCDF3 64bit) [${fnt_tlc}fl_fmt, file_format=64bit_offset${fnt_nrm}]"
+    echo "${fnt_rvr}-7${fnt_nrm}          Output file format NETCDF4_CLASSIC (netCDF4 classic) [${fnt_tlc}fl_fmt, file_format=netcdf4_classic${fnt_nrm}]"
     echo "${fnt_rvr}-a${fnt_nrm} ${fnt_bld}alg_typ${fnt_nrm}  Algorithm for weight generation (default ${fnt_bld}${alg_typ}${fnt_nrm}) [${fnt_tlc}alg_typ, algorithm, regrid_algorithm${fnt_nrm}]"
     echo "${fnt_rvr}-d${fnt_nrm} ${fnt_bld}dst_fl${fnt_nrm}   Data file to infer destination grid from (empty means none, i.e., use grd_fl, grd_sng or map_fl)) (default ${fnt_bld}${dst_fl}${fnt_nrm}) [${fnt_tlc}dst_fl, destination_file, template_file, template${fnt_nrm}]"
     echo "${fnt_rvr}-D${fnt_nrm} ${fnt_bld}dbg_lvl${fnt_nrm}  Debug level (default ${fnt_bld}${dbg_lvl}${fnt_nrm}) [${fnt_tlc}dbg_lvl, dbg, debug, debug_level${fnt_nrm}]"
+    echo " ${fnt_bld}--fl_fmt${fnt_nrm}   File format (empty is netCDF3 classic) (default ${fnt_bld}${fl_fmt}${fnt_nrm}) [${fnt_tlc}fl_fmt, fmt_out, file_format, format_out${fnt_nrm}]"
     echo "${fnt_rvr}-G${fnt_nrm} ${fnt_bld}grd_sng${fnt_nrm}  Grid generation argument string (empty means none) (default ${fnt_bld}${grd_sng}${fnt_nrm}) [${fnt_tlc}grd_sng, grid_generation, grid_gen, grid_string${fnt_nrm}]"
     echo "${fnt_rvr}-g${fnt_nrm} ${fnt_bld}grd_dst${fnt_nrm}  Grid-file (destination) (empty means none, i.e., infer from dst_fl or use grd_sng or map_fl) (default ${fnt_bld}${grd_dst}${fnt_nrm}) [${fnt_tlc}grd_dst, grid_dest, dest_grid, destination_grid${fnt_nrm}]"
     echo "${fnt_rvr}-I${fnt_nrm} ${fnt_bld}drc_in${fnt_nrm}   Input directory (empty means none) (default ${fnt_bld}${drc_in}${fnt_nrm}) [${fnt_tlc}drc_in, in_drc, dir_in, in_dir, input${fnt_nrm}]"
@@ -434,8 +465,13 @@ fi # !arg_nbr
 # Parse command-line options:
 # http://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options
 # http://tuxtweaks.com/2014/05/bash-getopts
-while getopts :a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT; do
+while getopts :34567a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT; do
     case ${OPT} in
+	3) fl_fmt='3' ;; # File format
+	4) fl_fmt='4' ;; # File format
+	5) fl_fmt='5' ;; # File format
+	6) fl_fmt='6' ;; # File format
+	7) fl_fmt='7' ;; # File format
 	a) alg_typ="${OPTARG}" ;; # Algorithm
 	C) clm_flg='Yes' ;; # Climo flag (undocumented)
 	D) dbg_lvl="${OPTARG}" ;; # Debugging level
@@ -461,7 +497,7 @@ while getopts :a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT;
 	u) unq_usr="${OPTARG}" ;; # Unique suffix
 	V) var_rgr="${OPTARG}" ;; # CF template variable 
 	v) var_lst="${OPTARG}" ;; # Variables
-	W) wgt_opt="${OPTARG}" ;; # Weight-generator options
+	W) wgt_opt_usr="${OPTARG}" ;; # Weight-generator options
 	w) wgt_usr="${OPTARG}" ;; # Weight-generator command
 	x) xtn_var="${OPTARG}" ;; # Extensive variables
 	-) LONG_OPTARG="${OPTARG#*=}"
@@ -477,6 +513,7 @@ while getopts :a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT;
 	       grd_dst=?* | grid_dest=?* | dest_grid=?* | destination_grid=?* ) grd_dst="${LONG_OPTARG}" ;; # -g # Destination grid-file
 	       grd_sng=?* | grid_generation=?* | grid_gen=?* | grid_string=?* ) grd_sng="${LONG_OPTARG}" ;; # -G # Grid generation string
 	       drc_in=?* | in_drc=?* | dir_in=?* | in_dir=?* | input=?* ) drc_in="${LONG_OPTARG}" ;; # -i # Input directory
+	       fl_fmt=?* | fmt_out=?* | file_format=?* | format_out=?* ) fl_fmt="${LONG_OPTARG}" ;; # # Output file format
 	       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
 	       mlt_map | multimap | no_multimap | nomultimap ) mlt_map_flg='No' ;; # -M # Multi-map flag
@@ -503,9 +540,9 @@ while getopts :a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT;
 	       rgn_src=?* | src_rgn=?* | regional_source=?* ) hnt_src='--src_regional' ;; # # Regional source grid
 	       rgn_src=?* | src_rgn=?* | regional_source=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Regional source grid
 	       grd_src=?* | grid_source=?* | source_grid=?* | src_grd=?* ) grd_src="${LONG_OPTARG}" ;; # -s # Source grid-file
-	       sgs_frc=?* | ice_frc=?* | lnd_frc=?* | ocn_frc=?* | subgrid_fraction=?* ) sgs_frc="${LONG_OPTARG}" ;; # # Sub-grid fraction variable
-	       sgs_msk=?* | ice_msk=?* | lnd_msk=?* | ocn_msk=?* | subgrid_mask=?* ) sgs_msk="${LONG_OPTARG}" ;; # # Sub-grid mask variable
-	       sgs_nrm=?* | subgrid_normalization=?* ) sgs_nrm="${LONG_OPTARG}" ;; # # Sub-grid fraction normalization
+	       sgs_frc=?* | ice_frc=?* | lnd_frc=?* | ocn_frc=?* | subgrid_fraction=?* ) sgs_frc="${LONG_OPTARG}" ; prc_typ='sgs' ; ;; # # Sub-grid fraction variable
+	       sgs_msk=?* | ice_msk=?* | lnd_msk=?* | ocn_msk=?* | subgrid_mask=?* ) sgs_msk="${LONG_OPTARG}" ; prc_typ='sgs' ; ;; # # Sub-grid mask variable
+	       sgs_nrm=?* | subgrid_normalization=?* ) sgs_nrm="${LONG_OPTARG}" ; prc_typ='sgs' ; ;; # # Sub-grid fraction normalization
 	       stdin | inp_std | std_flg | redirect | standard_input ) inp_std='Yes' ;; # # Input file list from stdin
 	       stdin=?* | inp_std=?* | std_flg=?* | redirect=?* | standard_input=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Input file list from stdin
 	       drc_tmp=?* | tmp_drc=?* | dir_tmp=?* | tmp_dir=?* | tmp=?* ) tmp_usr="${LONG_OPTARG}" ;; # -T # Temporary directory
@@ -518,14 +555,14 @@ while getopts :a:CD:d:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT;
 	       var_lst=?* | variable_list=?* | var=?* | vars=?* | variable=?* | variables=?* ) var_lst="${LONG_OPTARG}" ;; # -v # Variables
 	       vrb_lvl=?* | vrb=?* | verbosity=?* | print_verbosity=?* ) vrb_lvl="${LONG_OPTARG}" ;; # # Print verbosity
 	       version | vrs | config | configuration | cnf ) vrs_prn='Yes' ;; # # Print version information
-	       wgt_opt=?* | esmf_opt=?* | esmf_options=?* | tps_opt=?* | tempest_opt=?* | tempest_options=?* ) wgt_opt="${LONG_OPTARG}" ;; # -W # Weight-generator options
+	       wgt_opt=?* | esmf_opt=?* | esmf_options=?* | tps_opt=?* | tempest_opt=?* | tempest_options=?* ) wgt_opt_usr="${LONG_OPTARG}" ;; # -W # Weight-generator options
 	       wgt_cmd=?* | weight_command=?* | wgt_gnr=?* | weight_generator=?* ) wgt_usr="${LONG_OPTARG}" ;; # -w # Weight-generator command
 	       xtn_var=?* | extensive=?* | var_xtn=?* | extensive_variables=?* ) xtn_var="${LONG_OPTARG}" ;; # -x # Extensive variables
                '' ) break ;; # "--" terminates argument processing
-               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
+               * ) printf "\nERROR: Unrecognized option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
 	   esac ;; # !OPTARG
 	\?) # Unrecognized option
-	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed\n" >&2
+	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not recognized\n" >&2
 	    fnc_usg_prn ;;
     esac # !OPT
 done # !getopts
@@ -538,7 +575,7 @@ if [ ${vrs_prn} = 'Yes' ]; then
     printf "${spt_nm}, the NCO regridder and map- and grid-generator, version ${nco_vrs}\n"
     printf "Copyright (C) 2016--2017 Charlie Zender\n"
     printf "This program is part of NCO, the netCDF Operators\n"
-    printf "NCO is free software and comes with a BIG FAT KISS and ABOLUTELY NO WARRANTY\n"
+    printf "NCO is free software and comes with a BIG FAT KISS and ABSOLUTELY NO WARRANTY\n"
     printf "You may redistribute and/or modify NCO under the terms of the\n"
     printf "GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file\n"
     printf "GPL: http://www.gnu.org/copyleft/gpl.html\n"
@@ -678,6 +715,28 @@ else
     echo "${spt_nm}: HINT Valid interpolation options are bilinear|conserve|nearestdtos|neareststod|patch|tempest\n"
     exit 1
 fi # !alg_typ
+if [ -n "${fl_fmt}" ]; then
+    if [ "${fl_fmt}" = '3' ] || [ "${fl_fmt}" = 'classic' ] || [ "${fl_fmt}" = 'netcdf3' ]; then
+	nco_fl_fmt='--fl_fmt=classic'
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '4' ] || [ "${fl_fmt}" = 'netcdf4' ] || [ "${fl_fmt}" = 'hdf5' ]; then
+	nco_fl_fmt='--fl_fmt=netcdf4'
+	wgt_opt_esmf="${wgt_opt_esmf} --netcdf4"
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '5' ] || [ "${fl_fmt}" = '64bit_data' ] || [ "${fl_fmt}" = 'pnetcdf' ]; then
+	nco_fl_fmt='--fl_fmt=64bit_data'
+	wgt_opt_esmf="${wgt_opt_esmf} --64bit_offset" # Change when ERWG supports netCDF5
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '6' ] || [ "${fl_fmt}" = '64bit_offset' ] || [ "${fl_fmt}" = '64' ]; then
+	nco_fl_fmt='--fl_fmt=64bit_offset'
+	wgt_opt_esmf="${wgt_opt_esmf} --64bit_offset"
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '7' ] || [ "${fl_fmt}" = 'netcdf4_classic' ]; then
+	nco_fl_fmt='--fl_fmt=netcdf4_classic'
+	wgt_opt_esmf="${wgt_opt_esmf} --netcdf4" # Change when ERWG supports netCDF7
+    fi # !fl_fmt
+    nco_opt="${nco_opt} ${nco_fl_fmt}"
+fi # !fl_fmt
 if [ ${alg_opt} = 'tempest' ]; then
     wgt_typ='tempest'
 fi # alg_opt
@@ -690,6 +749,10 @@ else
     wgt_exe="${wgt_exe_tps}"
     wgt_opt="${wgt_opt_tps}"
 fi # !wgt_typ
+# NB: Define after wgt_typ-block so user can override default options
+if [ -n "${wgt_opt_usr}" ]; then 
+    wgt_opt=${wgt_opt_usr}
+fi # !wgt_usr    
 if [ -n "${wgt_usr}" ]; then 
     wgt_cmd=${wgt_usr}
 fi # !wgt_usr    
@@ -713,7 +776,7 @@ if [ -n "${nco_usr}" ]; then
 fi # !var_lst
 if [ -n "${gaa_sng}" ]; then 
     nco_opt="${nco_opt} ${gaa_sng}"
-fi # !var_lst
+fi # !gaa_sng
 if [ -n "${hdr_pad}" ]; then 
     nco_opt="${nco_opt} --hdr_pad=${hdr_pad}"
 fi # !hdr_pad
@@ -727,7 +790,9 @@ if [ "${no_stg_grd}" = 'Yes' ]; then
     rgr_opt="${rgr_opt} --rgr no_stagger"
 fi # !no_stg_grd
 if [ -n "${rnr_thr}" ]; then 
-    rgr_opt="${rgr_opt} --rgr rnr=${rnr_thr}"
+    if [ "${rnr_thr}" != 'off' ]; then 
+	rgr_opt="${rgr_opt} --rnr_thr=${rnr_thr}"
+    fi # !rnr_thr
 fi # !rnr_thr
 if [ -n "${var_lst}" ]; then 
     nco_var_lst="-v ${var_lst}"
@@ -790,7 +855,14 @@ if [ "${prc_typ}" = 'mpas' ]; then
 #    pdq_opt='-a Time,nVertLevels,maxEdges,MaxEdges2,nEdges,nCells' # Ocean
 #    pdq_opt='-a Time,nCategories,ONE,nEdges,nCells' # Ice
     pdq_opt='-a Time,nVertLevels,maxEdges,MaxEdges2,nCategories,ONE,nEdges,nCells' # Ocean and Ice in one swell foop
-    rgr_opt="${rgr_opt} --rnr=0.0"
+    if [ -n "${rnr_thr}" ]; then 
+	# Setting rnr_thr='off' in MPAS mode turns-off renormalization
+	if [ "${rnr_thr}" != 'off' ]; then 
+	    rgr_opt="${rgr_opt} --rnr_thr=${rnr_thr}"
+	fi # !rnr_thr
+    else
+	rgr_opt="${rgr_opt} --rnr_thr=0.0"
+    fi # !rnr_thr
 fi # !mpas
 if [ "${prc_typ}" = 'alm' ] || [ "${prc_typ}" = 'clm' ]; then 
     # Set ALM/CLM-specific options first, then change prc_typ to sgs
@@ -1038,6 +1110,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: drc_out  = ${drc_out}\n"
     printf "dbg: drc_tmp  = ${drc_tmp}\n"
     printf "dbg: dst_fl   = ${dst_fl}\n"
+    printf "dbg: fl_fmt   = ${fl_fmt}\n"
     printf "dbg: gaa_sng  = ${gaa_sng}\n"
     printf "dbg: grd_dst  = ${grd_dst}\n"
     printf "dbg: grd_sng  = ${grd_sng}\n"
@@ -1173,7 +1246,7 @@ if [ ${vrb_lvl} -ge ${vrb_3} ]; then
 	fi # !wgt_typ
 	if [ "${grd_src_usr_flg}" != 'Yes' ]; then
 	    printf "${spt_nm}: ERROR Sub-gridscale handling currently requires the user to specify the SCRIP source grid-file. Moreover, the source grid-file must include the (normally non-essential) grid_area field. It is infeasible to permit SGS source-grid inferral, because weight-generators assume great circle arcs but 2D-grids usually have small-circles in latitude, and this can lead to significant area mis-matches. Despite this, sub-gridscale handling is happy to infer destination (not so [...]
-	    echo "${spt_nm}: HINT Supply source grid-file with \"-s grd_src\". If the source grid-file is unavailable, first multiply sub-grid fields by ${sgs_frc} (with, e.g., ncap2 -s \"foo*=${sgs_frc};\" in.nc out.nc) and then regrid as normal without invoking sub-gridscale handling, i.e., omit the '-P sgs' option."
+	    echo "${spt_nm}: HINT Supply source grid-file with \"-s grd_src\". If the source grid-file is unavailable, first multiply sub-grid fields by ${sgs_frc} (with, e.g., ncap2 -s \"foo*=${sgs_frc};\" in.nc out.nc) and then regrid as normal without invoking sub-gridscale handling, i.e., omit the '-P sgs' and '--sgs_*' options."
 	    exit 1
 	    # 20170511: Inferring source grids leads to ~2% biases with conservative regridding and 2D source grids
 	    # printf "${spt_nm}: Sub-gridscale handling will attempt to infer the source SCRIP grid-file from the input data file. This will only work for rectangular 2D data files, because SGS requires the source grid-file to contain the (normally non-essential) grid_area field for the input grid.\n"
diff --git a/data/nsm.cdl b/data/nsm.cdl
index 9fcb0ad..e796ede 100644
--- a/data/nsm.cdl
+++ b/data/nsm.cdl
@@ -3,8 +3,8 @@
 // ncgen -k netCDF-4 -b -o ~/nco/data/nsm.nc ~/nco/data/nsm.cdl
 
 netcdf nsm {
-  :Conventions = "CF-1.5";
-  :history = "Tue Apr 25 12:46:10 PDT 2017: ncgen -k netCDF-4 -b -o ~/nco/data/clc.nc ~/nco/data/clc.cdl";
+  :Conventions = "CF-1.5 CF2-Group-2.0";
+  :history = "Tue Apr 25 12:46:10 PDT 2017: ncgen -k netCDF-4 -b -o ~/nco/data/nsm.nc ~/nco/data/nsm.cdl";
   :Purpose = "Demonstrate a model ensemble stored in hierarchical format";
 
   group: cesm_01 {
diff --git a/data/string.nco b/data/string.nco
new file mode 100644
index 0000000..f6f11e4
--- /dev/null
+++ b/data/string.nco
@@ -0,0 +1,35 @@
+
+defdim("dss",20);
+th=three_dmn_var_dbl;
+lev=lev;
+lon=lon;
+lon at str={"alpha"s, "beta"s,"gamma"s, "delta"s};
+
+
+greek[$lon]=lon at str;
+greek(2)="hello"s;
+
+ss[time]="Buy"s;
+ss(1)=greek(3);
+ss(2:5)={"three"s,"four"s,"five"s,"six"s};
+ss(6:7)=greek(2:3);
+ss(8:9)=lon at str(2:3); 
+
+
+
+//try with a ram var
+*ss_ram[dss]="ram"s;
+ss_ram(1)="beginnings"s;
+ss_ram(2:3)=greek(2:3);
+ss_ram(4:7)="Buy"s;
+ss_ram(8:9)={"bb"s,"cc"s};
+ss_ram(10:11)=lon at str(2:3);
+ss_ram(12:19:2)="two_stride"s;
+ss_ram(13:19:2)=greek(0);
+
+ 
+ram_write(ss_ram); 
+
+
+
+nbr_err_ttl=0;
diff --git a/data/tms.cdl b/data/tms.cdl
new file mode 100644
index 0000000..bf48b88
--- /dev/null
+++ b/data/tms.cdl
@@ -0,0 +1,73 @@
+// -*-C++-*-
+// Generate netCDF file with:
+// ncgen -k netCDF-4 -b -o ~/nco/data/tms.nc ~/nco/data/tms.cdl
+
+netcdf tms {
+  :Conventions = "CF-1.5 CF2-Group-2.0";
+  :history = "Thu Jun 22 17:45:12 PDT 2017: ncgen -k netCDF-4 -b -o ~/nco/data/tms.nc ~/nco/data/tms.cdl";
+  :Purpose = "Demonstrate a collection of DSG timeSeries featureType stored in hierarchical format";
+  :featureType = "timeSeries";
+
+ group: irvine {
+
+  dimensions:
+    time=unlimited;
+
+  variables:
+    
+    float humidity(time) ;
+  humidity:standard_name = "specific humidity" ;
+  humidity:coordinates = "lat lon alt station_name" ;
+  humidity:_FillValue = -999.9f;
+    
+    double time(time) ;
+  time:standard_name = "time";
+  time:long_name = "time of measurement" ;
+  time:units = "days since 1970-01-01 00:00:00" ;
+    
+    float lon ;
+  lon:standard_name = "longitude";
+  lon:long_name = "station longitude";
+  lon:units = "degrees_east";
+    
+    float lat ;
+  lat:standard_name = "latitude";
+  lat:long_name = "station latitude" ;
+  lat:units = "degrees_north" ;
+    
+    float alt ;
+  alt:long_name = "vertical distance above the surface" ;
+  alt:standard_name = "height" ;
+  alt:units = "m";
+  alt:positive = "up";
+  alt:axis = "Z";
+
+    string station_name;
+  station_name:long_name = "station name" ;
+  station_name:cf_role = "timeseries_id";
+
+  } // irvine
+     
+ group: boulder {
+
+  dimensions:
+    time=unlimited;
+
+  variables:
+
+    // Variables are repeated for each station/group and are omitted for clarity
+
+  } // boulder
+    
+ group: laguna_beach {
+
+  dimensions:
+    time=unlimited;
+
+  variables:
+
+    // Variables are repeated for each station/group and are omitted for clarity
+
+  } // laguna_beach
+    
+} // root group
diff --git a/debian/changelog b/debian/changelog
index d32ffa0..203665d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nco (4.6.8-1) unstable; urgency=low
+
+  * new upstream version ncap2 cnk, ncks dt_fmt, seasons, msk=none, ncwa_hyp_msk_wgt bug
+
+ -- Charlie Zender <zender at uci.edu>  Wed, 16 Aug 2017 12:25:24 -0700
+
 nco (4.6.7-1) unstable; urgency=low
 
   * new upstream version ncap2 in-fill, MTA flags, ERWG rgn hints, SGS, ncremap re-org, ncatted nc4 fll_val
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index 3687463..c2a2689 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,153 +1,130 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.6.7 are ready. 
+The netCDF Operators NCO version 4.6.8 are ready. 
 
 http://nco.sf.net (Homepage, Mailing lists)
 http://github.com/nco (Source Code, Releases, Developers)
 
 What's new?
-The main new features in 4.6.7 are in the regridder, which
-introduces a sub-grid regridding option, more automated handling
-and flexibility with regional grids, and easier flag specification.
-ncap2 added specialty functions to simplify handling of missing
-values and in-filling large missing regions with interpolated data.
-ncatted received an important bugfix for netCDF4 with _FillValue. 
+Many new features in 4.6.8 are, as usual, related to climatologies and
+regridding. ncclimo can now be given an explicit list of seasons to
+compute instead of, or in addition to, MAM,JJA,SON,DJF. ncremap has
+improved mask and format handling. There are also a collection of
+minor bugfixes and improvements, including JSON tweaks, ISO8601
+printing, and GCC7 and netCDF 4.5.x compatibility. 
+
+This release includes an important ncwa fix that prevents incorrect
+answers when hyperslabs are used with masks and/or weights.
+Upgrade if you use ncwa with -d hyperslabs.
 
 PLEASE READ THIS IF YOU USE NCKS TO PRINT DATA:
-The ncks default printing will change to CDL in summer 2017.
-For 20+ years ncks has, by default, dumped the text representation
-of a file in (what we call) "traditional" mode, which best facilitates
-meticulous data examination in line-by-line format.
+The ncks default printing will change to CDL in NCO 4.7.0.
+For 20+ years ncks has, by default, printed the text representation
+of a file in what we now call "traditional" mode. This mode best
+facilitates meticulous data examination in line-by-line format.
 ncdump produces CDL format that is more useful for most NCO users.
 ncdump has always printed clean CDL and for many years there was
 little point in defaulting ncks printed output to CDL.
 However, ncks CDL mode now rivals ncdump in many ways.
 In particular, ncks --cln now prints times as human-readable calendar
 dates, the last ncdump feature that I used which ncks lacked. 
-Hence in summer 2017 ncks default printed output will change to CDL. 
+Hence in NCO 4.7.0 ncks default printed output will change to CDL. 
 Then one will type simply "ncks" instead of "ncks --cdl". 
 We just added a new "--trd" option to print traditional output.
-User --trd in your scripts and their behavior will not change.
-Otherwise your printing scripts will start to print CDL this summer.
+Add --trd to your scripts and their behavior will not change.
+Otherwise your printing scripts will start to print CDL.
 You have been warned :)
 
-Work on NCO 4.6.8 has commenced. Planned improvements include 
-support for conda installs on MS Windows, more ncclimo and ncremap
-features, more ncap2 chunking flexibility. 
+Work on NCO 4.7.0 has commenced. Planned changes include printing
+CDL by default, and planned improvements include support for conda
+installs on MS Windows, and more ncclimo and ncremap features.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-A. ncremap has a new sub-gridscale (SGS) mode, -P sgs.
-   In sub-grid mode, ncremap performs substantial pre- and
-   post-processing so that regridding conserves fields that may
-   represent only a fraction of the entire gridcell.
-   The sub-gridscale fraction represented by each field is contained
-   in variable whose can be set with the new --sgs_frc option
-   (default is "landfrac"). SGS mode eases regridding of datasets
-   (e.g., from ALM, CLM, CICE) that output data normalized to a
-   fraction (rather than the entire extent) of the gridcell.
-   SGS mode automatically derives new binary masks (--sgs_msk)
-   and allows for additional normalization (--sgs_nrm).
-   Specific flavors of SGS can be selected (-P alm, clm, or cice).
-   These ensure regridded datasets recreate the idiosyncratic units
-   (e.g., %, km2) employed by raw ALM, CLM, and CICE model output.
-   Discerning these regridded from raw datasets is difficult :)
-   ncremap -P sgs -s src_grd.nc -i in.nc -d 1x1.nc -o rgr.nc
-   ncremap -P alm -s src_grd.nc -i in.nc -d 1x1.nc -o rgr.nc
-   ncremap -P cice -s src_grd.nc -i in.nc -d 1x1.nc -o rgr.nc
-   ncremap -P sgs --sgs_frc=aice --sgs_msk=tmask --src_nrm=100 ... 
-   http://nco.sf.net/nco.html#sgs
-   Thanks to Forrest Hoffmann and Min Xu for prototyping the
-   algorithm and verifying the results.
-
-B. ncremap now automatically indicates to the ERWG weight generator
-   when either or both source and destination grids are regional.
-   This information can considerably reduce the time and space
-   the weight generator requires to generate and store the map-file.
-   ncremap uses fuzzy logic to determine this for inferred grids.
-   The user may inform ncremap whether supplied grids (i.e.,
-   specified with -s or -g) are regional with the new --rgn_dst
-   and --rgn_src flags:
-   ncremap -i in.nc -d dst.nc -m map.nc # Inferred (no option necessary)
-   ncremap -s grd_src.nc -g grd_dst.nc -m map.nc --rgn_src # Supplied
-   Users may notice significantly faster throughput due to this.
-   http://nco.sf.net/nco.html#rgn_src
-
-C. ncremap switches have been "rationalized" to eliminate poor UI
-   decisions made in early development. Please read the old/new 
-   option meanings and change your scripts accordingly. Now -a
-   subsumes the old role of -w. HINT: use long-options (e.g.,
-   --algorithm=conserve) to future-proof your scripts. 
-   Meaning of -a:
-   Old: Interpolation algorithm for ESMF only
-   New: Interpolation algorithm for ESMF and Tempest ('tempest')
-   Meaning of -E:
-   Old: Options for ESMF_RegridWeightGen (now use -W)
-   New: Unused
-   Meaning of -T:
-   Old: Options for TempestRemap (now use -W)
-   New: temporary directory (replaces old -U)
-   Meaning of -U:
-   Old: temporary directory
-   New: unpack flag (tells ncremap to unpack data before regridding)
-   Meaning of -w:
-   Old: Weight-generator keyword. Valid options were 'esmf' and 'tempest'. 
-   New: Weight-generator command string (e.g., "mpirun ESMF_RegridWeightGen -n 24") 
-     Supercedes default 'ESMF_RegridWeightGen' or 'GenerateOfflineMap'
-   Meaning of -W:
-   Old: Unused
-   New: Options for weight-generator (replaces old -E and -T)
+A. ncap2 now fully implements NCO chunking maps and policies.
+   Previously ncap2 preserved existing chunking in variables,
+   but could not be told to do anythin different. Now all command-line
+   chunking behavior supported by NCO works in ncap2.
+   ncap2 --cnk_plc=unchunk -S cnk.nco in.nc4 out.nc4
+   http://nco.sf.net/nco.html#cnk
+
+B. ncks CDL printing supports finer-grained control of date formats,
+   including an ISO 8601 "T" option. Previously ncks printed
+   UDUnits-compliant times as dates when invoked with the --cdl and
+   --cal options. A third option, --dt_fmt, now exposes finer
+   control of the format with short, regular, and ISO8601 options:
+   ncks -H -m -v time_bnds -C --cdl --dt_fmt=1 ~/nco/data/in.nc
+   ncks -H -m -v time_bnds -C --cdl --dt_fmt=2 ~/nco/data/in.nc
+   ncks -H -m -v time_bnds -C --cdl --dt_fmt=3 ~/nco/data/in.nc
+   dt_fmt:   Output:
+   0,1       1964-03-13 09:08:16 (Default, short format)
+   2	     1964-03-13 09:08:16.000000 (regular format)
+   3         1964-03-13T09:08:16.000000 (ISO8601 "T" format)
+   Note that --dt_fmt automatically implies --cal.
+   http://nco.sf.net/nco.html#cln
+
+C. Some data are best evaluated with custom-defined seasons, e.g., JFM
+   instead of DJF, or two-month seasons such as FM or ON. ncclimo now
+   supports up to eleven (and counting) seasons, although by default it
+   only computes MAM, JJA, SON, and DJF. As of NCO 4.6.8, use the
+   seasons option to specify additional or alternate seasons: 
+   ncclimo --seasons=jfm,jas,ann -s 1980 -e 1983 -i drc_in -o drc_out
+   Use "–seasons=none" to completely turn-off seasonal and annual-mean
+   climatologies:
+   ncclimo --seasons=none -s 1980 -e 1983 -i drc_in -o drc_out
+   http://nco.sf.net/nco.html#ncclimo
+
+D. ncremap --msk_src and --msk_dst options now accept the value 'none'
+   to prevent the regridder from interpreting any variable as a mask
+   in files from which source or destination grids are inferred.
+   ncremap -i ~/ed.nc --msk_src=none -d ~/ed.nc -o ~/foo.nc
+   ncremap -i ~/ed.nc -d ~/ed.nc --msk_dst=none -o ~/foo.nc
    http://nco.sf.net/nco.html#ncremap
 
-D. ncap2 has a new function named missing(), aka mask_miss() that
-   returns an array of the same size of its argument, with values
-   of zero where valid data are present and one where missing data
-   are present. The resulting array can be useful in characterizing
-   and masking the original array.
-   ncap2 -s 'mss_val=three_dmn_var_dbl.missing().ttl($time)' in.nc out.nc
-   Thanks to Adrian Tompkins for suggesting this feature.
-   http://nco.sf.net/nco.html#mask_miss
-
-E. ncap2 now propagates existing chunking parameters from the input
-   file to the output file, and similarly chunks created variables.
-   The rest of NCO has long implemented comprehensive chunking
-   features and now ncap2 supports the basic methods.
-   ncap2 -s 'avg=one_dmn_rec_var.avg()' ~/nco/data/in.nc ~/foo.nc
-   http://nco.sf.net/nco.html#cll_mth
-
-F. ncks now has a --trd (or --traditional) option to print output
-   in the "tradiational" format. Start to use this unless you prefer
-   CDL output which will become the default in summer 2017, possibly
-   in NCO 4.7.0. At that time, the --cdl option will become default.
+E. ncremap now accepts standard NCO arguments for output file type.
+   The -3, -4, -5, -6, and -7 flags, or their long-option equivalents
+   --fl_fmt=fmt or --file_format=fmt where fmt is classic, netcdf4,
+   64bit_data, 64bit_offset, or netcdf4_classic (or some synonyms)
+   causes the output files created by ncremap, e.g., the regridded
+   files and the grid files, to have the requested format.
+   The ERWG and TempestRemap weight-generators support only a subset
+   of these formats.
+   ncremap -7 -i ~/deepthroat.nc -d ~/wapo.nc -o ~/foo.nc
+   http://nco.sf.net/nco.html#fl_fmt_ncremap
 
 BUG FIXES:
 
-A. ncatted allows writing an empty NC_CHAR or NC_STRING attribute.
-   Previously ncatted would core dump. ncks also prints such values.
-   No workaround. Solution is to upgrade.
+A. The ncap2 implementation of mibs()/mabs()/mebs() is fixed.
+   Thanks to Dominique Briand for reporting this.
+
+B. JSON now prints "null" instead of "NaN" for non-normal
+   floating-point values like NaN and Infinity.
+   This makes output fully JSON-compliant, although it simultaneously 
+   makes it impossible for JSON parsers to determine whether a "null"
+   floating-point value is NaN, or +/-Infinity.
+   Thanks to Bob Simons for noticing this.
 
-B. ncap2 could die when performing computations with pre-chunked
-   and/or deflated data. Workaround is to convert to netCDF3
-   before computations. Solution is to upgrade.
-   Thanks to Dave Blodgett for reporting this issue.
+C. Fix longstanding (since ~4.2.3) ncwa issue where hyperslabs
+   were not correctly handled for masks and weights. Hyperslabs
+   that started after the first array element could lead to incorrect
+   answers. Thanks to Tony Leboissetier for reporting the problem,
+   and to Pedro Vicente for fixing it.   	    
+   http://nco.sf.net#bug_ncwa_hyp_msk_wgt
 
-C. ncatted now correctly handles creation, modification, overwriting
-   of _FillValue attributes in netCDF4 data. Since about 4.6.2
-   fiddling with netCDF4 _FillValue attributes with existing data
-   could lead to data loss. The workaround is to convert to netCDF3,
-   fiddle, then convert back to netCDF4. The solution is to upgrade.
-   Thanks to Kyle Wilcox for reporting this issue.
+D. Ensure ncclimo and ncremap load netCDF libraries 4.4.x+ on
+   certain clusters so that CDF5 capabilities always available.
+   Thanks to Milena Veneziani for reporting this.
 
 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 4.6.7 built/tested under
-   MacOS 10.12.5 with netCDF 4.4.1 on HDF5 1.10.0-patch1 and with
-   Linux with netCDF 4.4.2-development (20170322) on HDF5 1.8.17.
+   These problems occur with NCO 4.6.8 built/tested under
+   MacOS 10.12.6 with netCDF 4.4.1.1 on HDF5 1.10.1 and with
+   Linux with netCDF 4.5.1-development (20170811) on HDF5 1.8.19.
 
 A. NOT YET FIXED (NCO problem)
    Correctly read arrays of NC_STRING with embedded delimiters in ncatted arguments
@@ -202,6 +179,7 @@ B. NOT YET FIXED (netCDF4 library bug)
    20160512: Ditto
    20161028: Verified problem still exists with netCDF 4.4.1
    20170323: Verified problem still exists with netCDF 4.4.2-development
+   20170323: https://github.com/Unidata/netcdf-c/issues/381
 
    Bug tracking: https://www.unidata.ucar.edu/jira/browse/fxm
    More details: http://nco.sf.net/nco.html#ncrename_crd
@@ -213,6 +191,7 @@ C. NOT YET FIXED (netCDF4 library bug)
    ncrename -O -v non_coord,coord ~/nco/data/in_grp.nc ~/foo.nc # Fails (HDF error)
 
    20170323: Confirmed problem reported by Paolo Oliveri, reported to Unidata
+   20170323: https://github.com/Unidata/netcdf-c/issues/381
 
    Bug tracking: https://www.unidata.ucar.edu/jira/browse/fxm
    More details: http://nco.sf.net/nco.html#ncrename_crd
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 52299b7..2afe1f3 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,8 +1,220 @@
+2017-08-16  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.8 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8 final changes';git push
+	git tag -a 4.6.8 -m 'ncap2 cnk, ncks dt_fmt, seasons, msk=none,	ncwa_hyp_msk_wgt bug';git push --tags
+
+2017-08-15  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.8-beta02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-beta02 final changes';git push
+	git tag -a 4.6.8-beta02 -m 'documentation';git push --tags
+
+	* Document fl_fmt for 4.6.8 release
+
+2017-08-14  Charlie Zender  <zender at uci.edu>
+
+	* --dt_fmt implies --cdl (and --cln)
+
+	* NCO 4.6.8-beta01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-beta01 final changes';git push
+	git tag -a 4.6.8-beta01 -m 'ncclimo custom libraries,rgr msk=byte,none,NC_EGLOBAL';git push --tags
+
+	* Change custom library overrides for ncclimo/ncremap to use netCDF 4.4.1.X
+
+	* Change custom build procedures for titan, rhea, yellowstone to use netCDF 4.4.1.X so CDF5 always works
+
+	* Create --map_[src/dst]='none' to short-circuit mask processing in nco_grd_nfr()
+
+2017-08-11  Charlie Zender  <zender at uci.edu>
+
+	* Allow NC_EGLOBAL return values from nco_put_att() of _FillValue to NC_GLOBAL for netCDF 4.5.x
+
+	* Allow NC_BYTE masks in nco_grd_nfr(), improve bad-mask diagnostics
+
+2017-08-10  Charlie Zender  <zender at uci.edu>
+
+	* netCDF 4.5.x dies with "Not a valid data type or _FillValue type mismatch"
+	when attempting to stuff IEEE data like 1.0e30 (_FillValue) into signed short spots.
+	Although correct, this new behavior causes many ncpdq regressions...
+
+	* Address false-positive implicit-fallthrough warnings in nco_uthash.h by inserting GCC7 FALLTHRU comments
+
+	* Fix one implicit-fallthrough bug identified by GCC7 (the warning proves useful)
+
+	* Add custom season 'ANN' computed in seasonal loop from all twelve monthly climos
+
+2017-08-09  Charlie Zender  <zender at uci.edu>
+
+	* Run developer tests in NCO_rgr.pl for =~ /zender/ not just == 'zender' so aims4 works
+
+	* Fix ANTLR_LIB handling in configure.ac (helps edison build)
+
+	* NCO 4.6.8-alpha06 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha06 final changes';git push
+	git tag -a 4.6.8-alpha06 -m 'ncclimo custom months';git push --tags
+
+	* Custom seasons work in ncclimo: compute ANN only when MAM,JJA,SON,DJF requested;
+	verify ANN is BFB with old method; zero seasons when csn_lst='none'
+
+	* L'Huilier not L'Huillier
+
+2017-08-08  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.8-alpha05 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha05 final changes';git push
+	git tag -a 4.6.8-alpha05 -m 'nco1138 ncwa hyp/msk/wgt';git push --tags
+
+	* Season infrastructure works non-intrusively, about to change clm_idx and parallelization
+
+	* ncclimo can map requested to defined seasons
+
+2017-08-07  Charlie Zender  <zender at uci.edu>
+
+	* Add stubs for ncclimo custom season support
+
+	* Add support for netCDF versions 4.4.1, 4.5.0, and 4.5.1 to nco_exit_lbr_rcd()
+
+	* Pedro merged code to fix nco1138, so ncwa hyperslabs with masks/weights should work again
+
+2017-08-04  Charlie Zender  <zender at uci.edu>
+
+	* JSON now prints "null" instead of "Infinity"
+
+	* NCO 4.6.8-alpha04 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha04 final changes';git push
+	git tag -a 4.6.8-alpha04 -m 'json null, gcc7';git push --tags
+
+	* Update NERSC edison build script due to OS upgrade
+
+	* First successful GCC7 build: gcc 7.1.1, FC26, netCDF 4.5.0-rc1
+
+	* Update netcdf.txt build script for GCC7, netCDF 4.5.0-rc1
+
+	* JSON now prints "null" instead of "NaN" for NaNs as suggested by Bob Simons
+
+2017-08-02 Henry Butowsky  <henryb at hush.com>
+
+	* Fix hyperslabbing of ram_vars of type NC_STRING, added more regression tests
+
+2017-08-01 Henry Butowsky  <henryb at hush.com>
+
+	* Fix hyperslabbing of var with type NC_STRING in LHS assign and RHS exp
+
+2017-07-09  Charlie Zender  <zender at uci.edu>
+
+	* Add SHA256 value to homepage
+
+2017-07-02  Charlie Zender  <zender at uci.edu>
+
+	* ncremap: pass fl_fmt -3,-4,-5,-6,-7 options
+
+2017-06-23  Charlie Zender  <zender at uci.edu>
+
+	* nco_rgr.c avoid abort() when nco_rgr_map() gets undefined (e.g., regional curvilinear) lat grid
+
+2017-06-21 Henry Butowsky  <henryb at hush.com>
+
+	* --cll_mth feature not working correctly so turned-off by default in ncap2.cc
+
+2017-06-20  Charlie Zender  <zender at uci.edu>
+
+	* Extend ESMF_weight_only section
+
+	* Fix false-positive regression with ncwa #5
+
+	* Clean-up compiler warnings and CEWIs on Linux
+
+	* ncclimo clean-up ncrcat files in diurnal mode
+
+	* About to work on ncwa mask bug
+
+	* NCO 4.6.8-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha03 final changes';git push
+	git tag -a 4.6.8-alpha03 -m 'ncap2 cnk, ncclimo diurnal, -W wgt_opt bug, NorESM rgr';git push --tags
+
+2017-06-19  Charlie Zender  <zender at uci.edu>
+
+	* Diurnal daily climos appear to work, though slowly
+
+	* ncclimo: experiment with tpd for diurnal daily climos
+
+2017-06-15 Henry Butowsky  <henryb at hush.com>
+
+	* Modify nco_cnk_sz_set_trv() "final safety check" so if dim_sz != 0L then cnk_sz<=dim_sz
+
+2017-06-14  Charlie Zender  <zender at uci.edu>
+
+	* Implement stubs to handle ERWG 7.1+ --weight_only map-files
+
+	* Fix 4.6.7 ncremap bug where -W wgt_opt was ignored
+
+	* Allow compression with UGRID output
+
+2017-06-13  Charlie Zender  <zender at uci.edu>
+
+	* Make dt_fmt automatically set PRN_CLN_LGB and obviate redundant --cal
+
+2017-06-12  Charlie Zender  <zender at uci.edu>
+
+	* Apply temporary fix whenever cnk_sz == 0L, period
+
+2017-06-11  Charlie Zender  <zender at uci.edu>
+
+	* Temporary fix to TODO nco1137 ncwa chunking fails with --rdd reported by Joy 20170605
+	dmn_cmn[] contains zero for some dimensions with --rdd, so set minimum cnk_sz to 1
+
+2017-06-09  Charlie Zender  <zender at uci.edu>
+
+	* Fix CF dimension inferral algorithm to correctly count coordinates
+
+	* Add lat_nm_in=j, lon_nm_in=i to look-up table for NorESM1 and similar CMIP5 grids
+
+2017-06-08  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.8-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha02 final changes';git push
+	git tag -a 4.6.8-alpha02 -m 'ncap2 mabs(), CDL dt_fmt, SUSE, --rnr_thr, SGS';git push --tags
+
+	* Rename and re-order cdl_fmt_tm to dt_fmt
+
+2017-06-07 Henry Butowsky  <henryb at hush.com>
+
+	* Aggregate operations mibs(), mebs(), mabs() now work correctly in ncap2
+
+2017-06-06  Charlie Zender  <zender at uci.edu>
+
+	* Merged Daniel Neumann's autoconf patch for SUSE directory structure
+
+2017-06-04  Charlie Zender  <zender at uci.edu>
+
+	* User-specified --rnr_thr='off' turns-off renormalization
+
+	* User-specified --rnr_thr overrides default 0.0 in MPAS-mode
+
+2017-06-02  Charlie Zender  <zender at uci.edu>
+
+	* Invoking --sgs_frc, --sgs_msk, or --sgs_nrm automatically triggers SGS-mode
+
+2017-06-01  Charlie Zender  <zender at uci.edu>
+
+	* Patch for NUL = '\0' != NULL errors in ncap2 supplied by Manfred Schwarb
+
+	* ncclimo add clm_md synonyms: dly=daily,day,doy  ann=annual,yearly,year
+
+2017-05-30  Charlie Zender  <zender at uci.edu>
+
+	* Warn when ncclimo/ncremap and binaries are from different directories
+
+	* Eliminate false positives from warnings about N-to-S grids
+
+	* Fix ncks regress test #49 --mk_rec_dmn false negative by adding --no_frm_trm option
+
 2017-05-26  Charlie Zender  <zender at uci.edu>
 
 	* NCO 4.6.8-alpha01 release procedure:
 	cd ~/nco;git commit -a -m 'Version 4.6.8-alpha01 final changes';git push
-	git tag -a 4.6.8-alpha01 -m 'Same as 4.6.7 except for minor fixes';git push --tags
+	git tag -a 4.6.8-alpha01 -m 'Same as 4.6.7 except for version';git push --tags
 
 	* NCO 4.6.7 release procedure:
 	cd ~/nco;git commit -a -m 'Version 4.6.7 final changes';git push
diff --git a/doc/Makefile.in b/doc/Makefile.in
index f175960..0156040 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/doc/TODO b/doc/TODO
index 4e1568e..2deefa4 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -694,11 +694,21 @@ nco1133. ncks CDL-mode do UDUnits time conversions to ISO (added 20161116, finis
 	 ncdump -t ~/nco/data/in.nc | grep tm_
 nco1134. MSA: wrapped limit with an additional limit pvn20160211 -- bug found that happens in nco 4.2.0 also
 	 ncks -O -C --msa -g g19 -v time -d time,9,0 -d time,1,2 ~/nco/data/in_grp_3.nc ~/foo.nc
-nco1135. USE_NC4_SRD_WORKAROUND is broken: (added 20170201, finished 20170207)
+nco1135. USE_NC4_SRD_WORKAROUND is broken: (added 20170201, finished/fixed 20170207)
 	 ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in.nc # works
       	 ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in_4c.nc # borken
 nco1136. ncra valid_range, unpacked_valid_range, actual_range problem antonio rodriges https://sourceforge.net/p/nco/discussion/9830/thread/07f71305 (only valid_range is netCDF standard convention). One "solution" is to unpack valid_range attribute[s] using scale_factor, add_offset from first file. # added 20170407
-nco1137. 
+nco1137. ncwa chunking fails with --rdd reported by Joy 20170605
+	 https://sourceforge.net/p/nco/discussion/9829/thread/663d5468/
+	 Due to incorrect contents of dmn_cmn on entry to nco_cnk_sz_set_trv() pedro?
+	 mv 1.clim.tile.nc4 ~/cnk_bug.nc4
+	 ncwa -D 7 -O --rdd -a lat,lon ~/cnk_bug.nc4 ~/foo.nc # borken
+	 ncwa -D 7 -O -a lat,lon ~/cnk_bug.nc4 ~/foo.nc # works
+nco1138. ncwa masking broken reported 20170602 by Tony Leboissetier pedro?
+	 https://sourceforge.net/p/nco/discussion/9830/thread/f1cb00d7/?limit=25#7622
+	 ncwa -O -C -y ttl -v orog -d lat,0.,90. --mask_condition 'ORO > 0.0' ~/nco/data/in.nc ~/foo.nc # borken
+	 ncks -H -v orog ~/foo.nc # Correct answer is 4 not 1
+nco1139. 	 
 qrk
 ************************************************************************
 End ncoXXX TODOs
diff --git a/doc/VERSION b/doc/VERSION
index 5c6b98f..d3acad0 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.6.7
+4.6.8
diff --git a/doc/debian.txt b/doc/debian.txt
index 4943f20..e76681e 100644
--- a/doc/debian.txt
+++ b/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-4.6.7
-   First we create a clean source distribution of nco and place it in nco-4.6.7
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.6.8
+   First we create a clean source distribution of nco and place it in nco-4.6.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-4.6.7
-/bin/rm nco.tar.gz;tar cvzf nco-4.6.7.tar.gz ./nco-4.6.7/*
-cd ~/nco/nco-4.6.7
-dh_make -e zender at uci.edu -f ../nco-4.6.7.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.6.8
+/bin/rm nco.tar.gz;tar cvzf nco-4.6.8.tar.gz ./nco-4.6.8/*
+cd ~/nco/nco-4.6.8
+dh_make -e zender at uci.edu -f ../nco-4.6.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-4.6.7.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.6.7
+   cd ~/nco/nco-4.6.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 4.6.7 with X.Y.Z+1
+# tags-query replace 4.6.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 4.6.7-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.6.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-4.6.7
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.6.8
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.6.7.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.6.8.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.6.7-2~ppa1_source.changes
+dput NCO nco_4.6.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_4.6.7-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_4.6.7-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_4.6.7-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_4.6.7-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_4.6.7.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_4.6.8-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.6.8-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.6.8-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.6.8-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.6.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-4.6.7 ${DATA}/nco_4.6.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-4.6.7-1 -d nco-4.6.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-4.6.7 nco # Export most recent
-tar cvzf ./nco_4.6.7.orig.tar.gz --exclude='nco-4.6.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.7 
-/bin/rm -rf ${DATA}/nco-4.6.7 # Remove cvs-exported directory
-tar xvzf ./nco_4.6.7.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-4.6.7/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.6.7/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.6.7/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-4.6.8 ${DATA}/nco_4.6.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-4.6.8-1 -d nco-4.6.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-4.6.8 nco # Export most recent
+tar cvzf ./nco_4.6.8.orig.tar.gz --exclude='nco-4.6.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.8 
+/bin/rm -rf ${DATA}/nco-4.6.8 # Remove cvs-exported directory
+tar xvzf ./nco_4.6.8.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.6.8/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.6.8/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.6.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-4.6.7;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-4.6.7;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
-cd ${DATA}/nco-4.6.7;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-4.6.8;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.6.8;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.6.8;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.6.7-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.6.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_4.6.7-1_*.deb
-ls -l ${DATA}/nco_4.6.7*
+lintian ${DATA}/nco_4.6.8-1_*.deb
+ls -l ${DATA}/nco_4.6.8*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_4.6.7* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_4.6.7* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_4.6.8* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.6.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_4.6.7-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.6.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_4.6.7* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.6.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_4.6.7-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.6.7-1_*.changes
-lintian /var/cache/pbuilder/result/nco_4.6.7-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.6.8-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.6.8-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.6.8-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.6.7-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.6.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_4.6.7-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.6.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-4.6.7 ${DATA}/nco-4.6.7* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.6.8 ${DATA}/nco-4.6.8* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-4.6.7 \
-${rpm_root}/RPMS/i386/nco-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.7-?.i386.rpm \
-${rpm_root}/SOURCES/nco-4.6.7.tar.gz \
-${rpm_root}/SPECS/nco-4.6.7.spec \
-${rpm_root}/SRPMS/nco-4.6.7-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.7-1 -d nco-4.6.7 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.6.7.spec
-tar cvzf ./nco-4.6.7.tar.gz --exclude='nco-4.6.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.7 
-${sudo_sng} /bin/cp ${DATA}/nco-4.6.7.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-4.6.8 \
+${rpm_root}/RPMS/i386/nco-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.8-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.6.8.tar.gz \
+${rpm_root}/SPECS/nco-4.6.8.spec \
+${rpm_root}/SRPMS/nco-4.6.8-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.8-1 -d nco-4.6.8 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.6.8.spec
+tar cvzf ./nco-4.6.8.tar.gz --exclude='nco-4.6.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.8 
+${sudo_sng} /bin/cp ${DATA}/nco-4.6.8.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.6.7.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.6.8.spec > ~/foo.nco 2>&1
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.7-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.7-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.8-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.6.8-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.7-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.7-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.7-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.8-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.8-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.6.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-4.6.7 ${DATA}/nco-4.6.7* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.6.8 ${DATA}/nco-4.6.8* # Cleanup last build
 /bin/rm -r -f \
-${rpm_root}/nco-4.6.7-?.src.rpm \
-${rpm_root}/nco-4.6.7.spec \
-${rpm_root}/nco-4.6.7.tar.gz \
-${rpm_root}/*/nco-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.7-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.7-1 -d nco-4.6.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-4.6.7 nco # Export most recent and build as 4.6.7-1
-tar cvzf ./nco-4.6.7.tar.gz --exclude='nco-4.6.7/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.7 
-/bin/cp ${DATA}/nco-4.6.7.tar.gz ${rpm_root}
+${rpm_root}/nco-4.6.8-?.src.rpm \
+${rpm_root}/nco-4.6.8.spec \
+${rpm_root}/nco-4.6.8.tar.gz \
+${rpm_root}/*/nco-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.8-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.8-1 -d nco-4.6.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-4.6.8 nco # Export most recent and build as 4.6.8-1
+tar cvzf ./nco-4.6.8.tar.gz --exclude='nco-4.6.8/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.8 
+/bin/cp ${DATA}/nco-4.6.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-4.6.7-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.6.8-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.6.7-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.6.8-?.*.rpm
 scp \
-${rpm_root}/*/nco-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.7-?.*.rpm \
-${rpm_root}/nco-4.6.7-?.*.src.rpm \
+${rpm_root}/*/nco-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.8-?.*.rpm \
+${rpm_root}/nco-4.6.8-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/*/nco-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.7-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.7-?.*.rpm \
-${rpm_root}/nco-4.6.7-?.*.src.rpm \
+${rpm_root}/*/nco-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.8-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.8-?.*.rpm \
+${rpm_root}/nco-4.6.8-?.*.src.rpm \
 zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
diff --git a/doc/index.shtml b/doc/index.shtml
index 88cd12e..363968f 100644
--- a/doc/index.shtml
+++ b/doc/index.shtml
@@ -70,7 +70,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 4.6.7 released <!--#flastmod file="src/nco-4.6.7.tar.gz"-->
+Current stable NCO version is 4.6.8 released <!--#flastmod file="src/nco-4.6.8.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,36 +149,37 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2017 Jun ??: 4.6.8 (<i>In Progress...</i>)
-<li>2017 May 26: 4.6.7 (Sub-grid regridding)
-<li>2017 Apr 21: 4.6.6 (UGRID)
-<li>2017 Mar 15: 4.6.5 (Sundry features/fixes)
-<li>2017 Feb 07: 4.6.4 (<tt>ncclimo</tt> splitter)
+<li>2017 Sep ??: 4.7.0 <i>In Progress...</i>
+<li>2017 Aug 16: 4.6.8 Sundry features/fixes
+<li>2017 May 26: 4.6.7 Sub-gridscale regridding
+<li>2017 Apr 21: 4.6.6 UGRID
+<li>2017 Mar 15: 4.6.5 Sundry features/fixes
+<li>2017 Feb 07: 4.6.4 <tt>ncclimo</tt> splitter
 <li>2017 Jan 27: <i>Geosci. Model Dev.</i> publishes compression-error trade-off <a href="http://www.geosci-model-dev.net/10/413/2017">paper</a></li>
-<li>2016 Dec 23: 4.6.3 (Sundry features/fixes)
-<li>2016 Nov 16: 4.6.2 (JSON)
+<li>2016 Dec 23: 4.6.3 Sundry features/fixes
+<li>2016 Nov 16: 4.6.2 JSON
 <li>2016 Sep 19: <i>Geosci. Model Dev.</i> publishes PPC <a href="http://www.geosci-model-dev.net/9/3199/2016">paper</a></li>
-<li>2016 Aug 06: 4.6.1 (Sundry features/fixes)
+<li>2016 Aug 06: 4.6.1 Sundry features/fixes
 <li>2016 Jul 06: Submitted Layer-packing <a href="http://www.geosci-model-dev-discuss.net/gmd-2016-177">manuscript</a> to <i>Geosci. Model Dev.</i></li>
-<li>2016 May 12: 4.6.0 (<tt>ncclimo</tt>)
+<li>2016 May 12: 4.6.0 <tt>ncclimo</tt>
 <li>2016 Apr 06: <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201604.pdf">Poster</a> at NASA ESDSWG, Greenbelt</li>
 <li>2016 Apr 05: <a href="http://dust.ess.uci.edu/smn/smn_nco_gsfc_201604.pdf">Talk</a> at NASA GES DISC, Greenbelt</li>
 <li>2016 Mar 22: Submitted PPC manuscript to <i>Geosci. Model Dev.</i></li>
-<li>2016 Feb 17: 4.5.5 (Sundry features/fixes)
-<li>2016 Jan 07: 4.5.4 (<tt>ncremap</tt>)
+<li>2016 Feb 17: 4.5.5 Sundry features/fixes
+<li>2016 Jan 07: 4.5.4 <tt>ncremap</tt>
 <li>2015 Dec 16: <a href="http://dust.ess.uci.edu/smn/pst_nco_agu_201512.pdf">Poster</a> at Fall AGU, San Francisco</li>
 <li>2015 Nov 04: <a href="http://dust.ess.uci.edu/smn/smn_nco_acme_201511.pdf">Talk</a> at DOE ACME, Albuquerque</li>
-<li>2015 Oct 20: 4.5.3 (Curvilinear)
-<li>2015 Sep 06: 4.5.2 (Generate SCRIP)
+<li>2015 Oct 20: 4.5.3 Curvilinear
+<li>2015 Sep 06: 4.5.2 Generate SCRIP
 <li>2015 Sep 01: NSF EarthCube <a href="#prp_e3">project</a> commences</li>
-<li>2015 Jul 10: 4.5.1 (Sundry features/fixes)
-<li>2015 Jun 11: 4.5.0 (Regridding)
-<li>2015 May 21: 4.4.9 (<tt>ncra</tt> weights)
-<li>2015 Feb 16: 4.4.8 (Precision-Preserving Compression)
+<li>2015 Jul 10: 4.5.1 Sundry features/fixes
+<li>2015 Jun 11: 4.5.0 Regridding
+<li>2015 May 21: 4.4.9 <tt>ncra</tt> weights
+<li>2015 Feb 16: 4.4.8 Precision-Preserving Compression
 <li>2014 Dec 15: DOE ACME <a href="#prp_acme">project</a> commences</li>
-<li>2014 Nov 26: 4.4.7 (Chunking features)
-<li>2014 Oct 01: 4.4.6 (<tt>ncra, ncwa</tt> packing bugfixes, stride optimization)
-<li>2014 Aug 26: 4.4.5 (Sundry features/fixes)
+<li>2014 Nov 26: 4.4.7 Chunking features
+<li>2014 Oct 01: 4.4.6 <tt>ncra, ncwa</tt> packing bugfixes, stride optimization
+<li>2014 Aug 26: 4.4.5 Sundry features/fixes
 <li>2014 Jul 01: NASA ACCESS 2013 <a href="#prp_axs">project</a> commences</li>
 <li><a href="./milestones_old.shtml">Milestones from 200301–201406 (versions 2.8.4–4.4.4)</a></li>
 <li><a href="./nco_news.shtml">News and Announcements from 199801–200212 (version 1.1.0–2.8.3) and earlier</a></li>
@@ -627,16 +628,22 @@ 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 4.6.7 http://github.com/nco/nco.git nco-4.6.7</tt></a>.
+<tt>git clone -b 4.6.8 http://github.com/nco/nco.git nco-4.6.8</tt></a>.
 <ul>
-<li><b>NCO 4.6.8</b>: (<i>Future</i>)
-<a href="http://nco.sf.net/nco.html#cnk">Chunking</a> bytes not elements;
+<li><b>NCO 4.7.1</b>: (<i>Future</i>)
+Chunking bytes not elements;
 extensive hashing?;
-netCDF4 compound types?;
+netCDF4 compound types?;</li>
+<li><b>NCO 4.7.0</b>: (<i>In Progress, features in-progress or complete include</i>) 
 <tt>ncks --xtn</tt> better extensive variable treatment;</li>
-<li><b>NCO 4.6.8</b>: (<i>In Progress, features in-progress or complete include</i>) 
-<tt>ncks --iso8661</tt> put the &lquote;T&rquote; in time;</li>
-<li><b>NCO 4.6.7</b>: (<i>Current Stable Release</i>)
+<li><b>NCO 4.6.8</b>: (<i>Current Stable Release</i>)
+<tt>ncap2</tt> full chunking options;
+<tt>ncclimo --seasons</tt> custom season support;
+<tt>ncks --dt_fmt</tt> put the “T” in time;
+<tt>ncremap --msk_[src/dst]=none</tt> mask suppression;
+<tt>ncremap -3,-4,-5,-6,-7</tt> output format;
+<tt>ncwa -d -w -m</tt> hyperslab with mask or weight <a href="#bug_ncwa_hyp_msk_wgt">bugfix</a>;</li>
+<li><b>NCO 4.6.7</b>:
 Multi-argument (MTA) flag parsing;
 <tt>ncap2</tt> in-fill functions simple_fill_miss() + weighted_fill_miss();
 <tt>ncap2</tt> duplicates input variable chunking;
@@ -644,7 +651,7 @@ Multi-argument (MTA) flag parsing;
 <tt>ncremap -P sgs, alm, clm, cice</tt> sub-gridscale remapping;
 <tt>ncremap</tt> msk_src/dst conversion;
 <tt>ncremap</tt> src/dst_regional hints to ERWG;</li>
-<li><b>NCO 4.6.6</b>: (<i>Current Stable Release</i>)
+<li><b>NCO 4.6.6</b>:
 <tt>ncks --cdl</tt> prints units when <i>dbg_lvl</i> ≥ 1;
 <tt>ncks --cdl</tt> prints braces for compound record variables;
 <tt>ncks</tt> outputs UGRID-format rectangular grids;
@@ -811,7 +818,7 @@ goodies besides NCO) to your automatically-searched channels with
 ‘<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-4.6.7</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-4.6.8</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
 Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and maintaining the NCO package for conda.
 </ul>
 
@@ -820,7 +827,7 @@ Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and mainta
 <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-4.6.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-4.6.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.
@@ -828,8 +835,8 @@ Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and mainta
 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_4.6.7-1_i386.deb</tt>’):</dt>
-<li><a href="https://launchpad.net/ubuntu/+source/nco/4.6.7-1">nco_4.6.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_4.6.8-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/4.6.8-1">nco_4.6.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. 
@@ -873,10 +880,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
 <!-- 
 # Mac OS X 10.12 (Sierra) systems (aerosol):
 /usr/bin/scp ~/nco/doc/index.shtml zender,nco at web.sf.net:/home/project-web/nco/htdocs
-cd ~/bin;tar cvzf ${DATA}/nco-4.6.7.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.6.7.macosx.10.12.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-4.6.8.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.6.8.macosx.10.12.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-4.6.7.macosx.10.12.tar.gz">nco-4.6.7.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.6.7.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.6.7.macosx.10.12.tar.gz"-->). 
+<li><a href="src/nco-4.6.8.macosx.10.12.tar.gz">nco-4.6.8.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.6.8.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.6.8.macosx.10.12.tar.gz"-->). 
 (NB: These executables require
   the <a href="http://trac.macosforge.org/projects/macports/wiki">MacPorts</a>
   <a href="#bld_macports">dependencies</a> for <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">NCO</a>). Maintained by NCO Project.</li>
@@ -898,9 +905,9 @@ To build NCO from source yourself using MSVC or Qt, please see the <a href="nco_
 <ul>
 <!-- Copy files from http://glace.ess.uci.edu
 /usr/bin/scp /home/pvicente/nco/doc/index.shtml pvicente,nco at web.sf.net:/home/project-web/nco/htdocs
-/usr/bin/scp /home/pvicente/windows_setup/nco-4.6.6.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
+/usr/bin/scp /home/pvicente/windows_setup/nco-4.6.8.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
 -->
-<li><a href="src/nco-4.6.6.windows.mvs.exe">nco-4.6.6.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.6.6.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.6.6.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
+<li><a href="src/nco-4.6.6.windows.mvs.exe">nco-4.6.8.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.6.8.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.6.8.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
 </ul>
 
 <a name="cygwin"></a> <!-- http://nco.sf.net#cygwin -->
@@ -1071,11 +1078,12 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- scp ${DATA}/nco-4.6.7.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="https://github.com/nco/nco/archive/4.6.7.tar.gz">nco-4.6.7.tar.gz</a> 
-(<!--#fsize file="src/nco-4.6.7.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-4.6.7.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-4.6.7.tar.gz"--> 
+<!-- scp ${DATA}/nco-4.6.8.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/4.6.8.tar.gz">nco-4.6.8.tar.gz</a> 
+(<!--#fsize file="src/nco-4.6.8.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-4.6.8.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-4.6.8.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha256 src/nco-4.6.8.tar.gz"--> 
 </li>
 </ul>
 
@@ -1094,8 +1102,8 @@ You may retrieve any NCO distribution you wish from
 <a href="https://help.github.com">GitHub</a>. 
 Usually you wish to retrieve a recent tagged (i.e., released) version.
 This command retrieves the entire NCO repository (< 20 MB) and
-then checks out NCO version <tt>4.6.7</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.6.7</tt></p>
+then checks out NCO version <tt>4.6.8</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.6.8</tt></p>
 These commands retrieve the current (“bleeding edge”)
 development version of NCO into a local directory named <tt>nco</tt>:
 <p><tt>git clone https://github.com/nco/nco.git ~/nco</tt></p> or
@@ -1103,9 +1111,9 @@ development version of NCO into a local 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>4.6.7</tt>) and the development version is that the
+(e.g., <tt>4.6.8</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.6.7</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.6.8</tt>) when asked to do so with the <tt>-r</tt> flag
 (e.g., <tt>ncks -r</tt>).
 The development version simply places today's date in place of the
 version.
@@ -1165,7 +1173,7 @@ access, or systems without packages such as AIX), build all libraries
 with the same compiler and switches.
 The ANTLR 2.x source file <tt>CharScanner.hpp</tt> must include this line:
 <tt>#include <cstring></tt> or else <tt>ncap2</tt> will not
-compile (<a href="http://dust.ess.uci.edu/tmp/antlr-2.7.7.tar.gz">this</a>
+compile (<a href="http://dust.ess.uci.edu/nco/antlr-2.7.7.tar.gz">this</a>
 ANTLR tarball is already patched).
 Recent versions of netCDF automatically build OPeNDAP and UDUnits.
 NCO is mostly written in C99, and although you <i>may</i> mix and
@@ -1250,9 +1258,9 @@ Users should instead first download and install the ANTLR found <a href="http://
 
 <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/4.6.7.tar.gz</dt>
-<dt>tar xvzf 4.6.7.tar.gz</dt>
-<dt>cd nco-4.6.7</dt>
+<dt>wget https://github.com/nco/nco/archive/4.6.8.tar.gz</dt>
+<dt>tar xvzf 4.6.8.tar.gz</dt>
+<dt>cd nco-4.6.8</dt>
 <dt>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1412,12 +1420,27 @@ A summary of renaming limitations associated with particular versions
 of netCDF4 is maintained in the online manual   
 <a href="http://nco.sf.net/nco.html#bug_nc4_rename">here</a>.
 Important updates will also be posted here on the homepage.
-There are no known bugs with renaming features as of netCDF library
-version 4.3.3.1 (March, 2015). 
+There are still known bugs with renaming features as of netCDF library
+version 4.4.1.1 (November, 2016). 
 </li>
 </ul>
 
 <ul><b>Recent Operator-specific Run-time Problems:</b>
+<!-- http://nco.sf.net#bug_ncwa_hyp_msk_wgt -->
+<a name="bug_ncwa_hyp_msk_wgt"></a>
+<li><i>Hyperslabbing masked and/or weighted variables bug:</i>
+Versions 4.2.4—4.6.7 of <tt>ncwa</tt> incorrectly handle
+masking and weighting of hyperslabbed variables.
+Performing these actions simultaneously causes subtle arithmetic
+errors (the worst kind!), unless the hyperslab happens to start
+with the first element of the variable.
+In other words, results from commands of the form
+<tt>ncwa -d ... -m ... </tt> and
+<tt>ncwa -d ... -w ... </tt> are suspect.
+The workaround is to downgrade to NCO 4.2.3.
+The solution is to upgrade to NCO 4.6.8.
+</li>
+
 <!-- http://nco.sf.net#bug_ncwa_pck_min_max -->
 <a name="bug_ncwa_pck_min_max"></a>
 <li><i>Minimization/maximization of packed variables bug:</i>
diff --git a/doc/nco.texi b/doc/nco.texi
index 43b812f..5ebe2d3 100644
--- a/doc/nco.texi
+++ b/doc/nco.texi
@@ -119,12 +119,12 @@ Octave TeXInfo manual shows clean TeXInfo structure
 @setfilename nco.info
 
 @c Define edition, date, ...
- at set nco-edition 4.6.7
- at set doc-edition 4.6.7
+ at set nco-edition 4.6.8
+ at set doc-edition 4.6.8
 @set copyright-years 1995--2017
 @set update-year 2017
- at set update-date 26 May 2017
- at set update-month May 2017
+ at set update-date 15 August 2017
+ at set update-month August 2017
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -346,10 +346,11 @@ maintenance provided by these institutions and programs:
 @acronym{DOE} @acronym{ACME} DE-SC0012998, 
 @acronym{NASA} @acronym{ACCESS} NNX12AF48A and NNX14AH55A, and
 @acronym{NSF} @acronym{SEI} IIS-0431203 and AGS-1541031.
-Research supported as part of the Accelerated Climate Modeling for
-Energy (@acronym{ACME}) program, funded by the U.S. Department of
-Energy, Office of Science, Office of Biological and Environmental
-Research.  
+This research was supported as part of the Energy Exascale Earth System
+Model (@acronym{E3SM}) project, formerly known as Accelerated Climate
+Modeling for Energy (@acronym{ACME}),
+funded by the U.S. Department of Energy, Office of Science, Office of
+Biological and Environmental Research.
 This material is based upon work supported by the National Science
 Foundation under Grants IIS-0431203 and AGS-1541031.
 @sp 2
@@ -565,16 +566,16 @@ June, 2015@*
 Irvine, California@*
 
 @ignore
-The @acronym{DOE} @acronym{ACME} program has generously supported 
- at acronym{NCO} development in support of high-performance climate
-modeling research. 
+The @acronym{DOE} Energy Exascale Earth System Model (@acronym{E3SM})
+project (formerly @acronym{ACME}) has generously supported @acronym{NCO}
+development in support of high-performance climate modeling research.  
 This has allowed Henry Butowsky to re-join our efforts.
 Without him, much of this work would have been impossible.
 
 @sp 1
 @noindent
 Charlie Zender@*
-June, 2017@*
+August, 2017@*
 Laguna Beach, California@*
 @end ignore
 
@@ -4898,10 +4899,10 @@ availale is to use @command{ncrename} (@pxref{ncrename netCDF Renamer}).
 <a name="xmp_flt"></a> <!-- http://nco.sf.net/nco.html#xmp_flt -->
 @end html
 One may wish to flatten hierarchical group files for many reasons.
-These include @w{1. Obtaining} flat netCDF3 files for use with tools
-that do not work with netCDF4 files, @w{2. Splitting} apart
+These include @w{1. To} obtain flat netCDF3 files for use with tools
+that do not work with netCDF4 files, @w{2. To} split-apart
 hierarchies to re-assemble into different hierarchies, and
- at w{3. Providing} a subset of a hierarchical file with the simplest
+ at w{3. To} provide a subset of a hierarchical file with the simplest
 possible storage structure.
 @example
 ncks -O -G : -g cesm -3 ~/nco/data/cmip5.nc ~/cesm.nc # Extract /cesm to /
@@ -6282,10 +6283,9 @@ Examples include ``CAM-FV scalar grid 129x256'' and ``T42 Gaussian grid''.
 @cindex @samp{--rgr scrip=@var{scrip_grid}}
 @item Grid File: @var{scrip_grid}
 The grid-generation @acronym{API} was bolted-on to @acronym{NCO}
-and is somewhat primitive, e.g., having to repeat the @samp{--rgr}
-option. 
-Another aspect of this is that the output grid filename is distinct
-from the output filename of the host @command{ncks} command. 
+and contains some temporary kludges.
+For example, the output grid filename is distinct from the output
+filename of the host @command{ncks} command.  
 Specify the output gridfile name @var{scrip_grid} with keywords
 @code{grid} or @code{scrip}, e.g., @samp{--rgr grid=@var{scrip_grid}} or  
 @samp{--rgr scrip=@file{t42_SCRIP.20150901.nc}}.
@@ -6307,7 +6307,7 @@ are, by the way, independent of eachother) are @var{lon_typ} and
 The @var{lat_typ} options for global grids are @samp{uni} for
 Uniform, @samp{cap} (or @samp{fv}) for Capped (equivalent to
 @acronym{FV}), and @samp{gss} for Gaussian.  
-These values are all case-independent, so @samp{Gss} and @samp{gss} both 
+These values are all case-independent, so @samp{Gss} and @samp{gss} both
 work. 
 
 As its name suggests, the latitudes in a Uniform-latitude grid are
@@ -6393,8 +6393,8 @@ The ``Fixed'' terminology seems broken.
 
 Finally, Gaussian grids are the Cartesian representation of global
 spectral transform models. 
-Gaussian grids do not have points at the poles, and must have an even
-number of latitudes. 
+Gaussian grids do not have points at the poles, and typically have an
+even number of latitudes. 
 All three latitude grid-type supported by @acronym{NCO} (Uniform, Cap, 
 and Gaussian) are Regular grids in that they are monotonic. 
 
@@ -6467,12 +6467,12 @@ Generating common grids:
 @example
 @verbatim
 # 180x360 (1x1 degree) Equi-Angular grid, first longitude centered at Greenwich
-ncks --rgr grd_ttl='Equi-Angular grid 180x360' --rgr scrip=${DATA}/grids/180x360_SCRIP.20150901.nc \
-     --rgr latlon=180,360 --rgr lat_typ=uni --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+ncks --rgr grd_ttl='Equi-Angular grid 180x360'#latlon=180,360#lat_typ=uni#lon_typ=grn_ctr \
+     --rgr scrip=${DATA}/grids/180x360_SCRIP.20150901.nc ~zender/nco/data/in.nc ~/foo.nc
 
 # 129x256 CAM-FV grid, first longitude centered at Greenwich
-ncks --rgr grd_ttl='CAM-FV scalar grid 129x256' --rgr scrip=${DATA}/grids/129x256_SCRIP.20150901.nc \
-     --rgr latlon=129,256 --rgr lat_typ=fv --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+ncks --rgr grd_ttl='CAM-FV scalar grid 129x256'#latlon=129,256#lat_typ=fv#lon_typ=grn_ctr \
+     --rgr scrip=${DATA}/grids/129x256_SCRIP.20150901.nc ~zender/nco/data/in.nc ~/foo.nc
 
 # 91x180 CAM-FV grid, first longitude centered at Greenwich (2 degree grid)
 ncks --rgr grd_ttl='CAM-FV scalar grid 91x180'#latlon=91,180#lat_typ=fv#lon_typ=grn_ctr \
@@ -6484,21 +6484,29 @@ ncks --rgr grd_ttl='CAM-FV scalar grid 25x48'#latlon=25,48#lat_typ=fv#lon_typ=gr
 
 # 128x256 Equi-Angular grid, Greenwich west edge of first longitude
 # This is the CAM-FV offset grid for the 129x256 CAM-FV scalar grid above
-ncks --rgr grd_ttl='Equi-Angular grid 128x256' --rgr scrip=${DATA}/grids/128x256_SCRIP.20150901.nc \
-     --rgr latlon=128,256 --rgr lat_typ=uni --rgr lon_typ=grn_wst ~zender/nco/data/in.nc ~/foo.nc
+ncks --rgr grd_ttl='Equi-Angular grid 128x256'#latlon=128,256#lat_typ=uni#lon_typ=grn_wst \
+     --rgr scrip=${DATA}/grids/128x256_SCRIP.20150901.nc ~zender/nco/data/in.nc ~/foo.nc
 
 # T42 Gaussian grid, first longitude centered at Greenwich
-ncks --rgr grd_ttl='T42 Gaussian grid' --rgr scrip=${DATA}/grids/t42_SCRIP.20150901.nc \
-     --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+ncks --rgr grd_ttl='T42 Gaussian grid'#latlon=64,128#lat_typ=gss#lon_typ=grn_ctr \
+     --rgr scrip=${DATA}/grids/t42_SCRIP.20150901.nc ~zender/nco/data/in.nc ~/foo.nc
 
 # NASA Climate Modeling Grid (CMG) 3600x7200 (0.05x0.05 degree) Equi-Angular grid
 # Date-line west edge of first longitude, east edge of last longitude
-ncks --rgr grd_ttl='Equi-Angular grid 3600x7200 (NASA CMG)' --rgr scrip=${DATA}/grids/3600x7200_SCRIP.20160301.nc \
-     --rgr latlon=3600,7200 --rgr lat_typ=uni --rgr lon_typ=180_wst ~zender/nco/data/in.nc ~/foo.nc
+# Write to compressed netCDF4-classic file to reduce filesize ~140x from 2.2 GB to 16 MB
+ncks -7 -L 1 \
+     --rgr grd_ttl='Equi-Angular grid 3600x7200 (NASA CMG)'#latlon=3600,7200#lat_typ=uni#lon_typ=180_wst \
+     --rgr scrip=${DATA}/grids/3600x7200_SCRIP.20160301.nc ~zender/nco/data/in.nc ~/foo.nc
+
+# DOE ACME High Resolution Topography (1 x 1 km grid) for Elevation Classes
+# Write to compressed netCDF4-classic file to reduce filesize from ~85 GB to 607 MB
+ncks -O -7 -L 1 \
+     --rgr grd_ttl='Global latxlon = 18000x36000 ~ 1 x 1 km'#latlon=18000,36000#lat_typ=uni#lon_typ=grn_ctr \
+     --rgr scrip=${DATA}/grids/grd_18000x36000_SCRIP.nc ~zender/nco/data/in.nc ~/foo.nc
 
 # 1x1 degree Equi-Angular Regional grid over Greenland, centered longitudes
-ncks --rgr grd_ttl='Equi-Angular Greenland grid ' --rgr scrip=${HOME}/greenland_SCRIP.nc \
-     --rgr latlon=30,90#snwe=55.0,85.0,-90.0,0.0#lat_typ=uni#lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+ncks --rgr grd_ttl='Equi-Angular Greenland grid'#latlon=30,90#snwe=55.0,85.0,-90.0,0.0#lat_typ=uni#lon_typ=grn_ctr \
+     --rgr scrip=${HOME}/greenland_SCRIP.nc ~zender/nco/data/in.nc ~/foo.nc
 @end verbatim
 @end example
 
@@ -6549,8 +6557,8 @@ inferred 2D rectangular grids may also be written in
 @uref{http://ugrid-conventions.github.io/ugrid-conventions, here}).
 Request a @acronym{UGRID} mesh with the option
 @samp{--rgr ugrid=@var{fl_ugrid}}.
-Currently a @acronym{SCRIP} grid must be requested in order for the
- at acronym{UGRID} option to work, e.g.,
+Currently both @acronym{UGRID} and @acronym{SCRIP} grids must be
+requested in order to produce the @acronym{UGRID} output, e.g., 
 @example
 @verbatim
 ncks --rgr infer --rgr ugrid=${HOME}/grd_ugrid.nc \
@@ -13144,13 +13152,27 @@ print(mss_val_nbr,"%d");
 print(three_dmn_var_dbl);
 
 // find the total number of missing values along dims $lat and $lon
-ms_ttl=three_mn_var_dbl.missing().ttl($lat,$lon);
-print(ms_ttl); //  0, 0, 0, 8, 0, 0, 0, 1, 0, 2 ;
-
-
+mss_ttl=three_mn_var_dbl.missing().ttl($lat,$lon);
+print(mss_ttl); // 0, 0, 0, 8, 0, 0, 0, 1, 0, 2 ;
 @end verbatim
 @end example
 
+ at table @code
+ at item simple_fill_miss(var)
+ at cindex @code{simple_fill_miss()}
+This function takes a variable and attempts to fill missing values using an average
+of up to the 4 nearest neighbour grid points. The method used is iterative (up to 1000 cycles).
+For very large areas of missing values results can be unpredictable.
+The given variable must be at least 2D; and the algorithm assumes that the last two dims are lat/lon
+or y/x
+ at item weighted_fill_miss(var)
+ at cindex @code{weighted_fill_miss()}
+Weighted_fill_miss is more sophisticated. Up to 8 nearest neighbours  are used to calculate a weighted average.
+The weighting used is the inverse  square of distance. Again the method is iterative (up to 1000 cycles).
+The area filled is defined by the final  two dims of the variable. In addition this function assumes the existance of
+coordinate vars the same name as the last two dims. if it doesn't find these dims it will gently exit with warning.
+ at end table
+
 @html
 <a name="ncap_mth"></a> <!-- http://nco.sf.net/nco.html#ncap_mth -->
 <a name="ncap2_mth"></a> <!-- http://nco.sf.net/nco.html#ncap2_mth -->
@@ -16660,7 +16682,7 @@ SYNTAX
 ncbo [-3] [-4] [-5] [-6] [-7] [-A] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] 
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] [--fl_fmt @var{fl_fmt}]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
 [-L @var{dfl_lvl}] [-l @var{path}] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{file_3}] [-p @var{path}] [-R] [-r] [--ram_all]
@@ -17091,8 +17113,9 @@ ncclimo [-a @var{dec_md}] [-C @var{clm_md}] [-c @var{caseid}] [-d @var{dbg_lvl}]
 [-j @var{job_nbr}] [-l @var{lnk_flg}] [-m @var{mdl_nm}] [-n @var{nco_opt}] 
 [--no_cll_msr ] [--no_frm_trm] [--no_ntv_tms] [--no_stg_grd]
 [-O @var{drc_rgr}] [-o @var{drc_out}] [-p @var{par_typ}] [-R @var{rgr_opt}] [-r @var{rgr_map}]
-[-S @var{yr_prv}] [-s @var{yr_srt}] [--stdin] [-t @var{thr_nbr}] [--tpd=@var{tpd_dly}]
-[-v @var{var_lst}] [--version] [-x @var{cf_flg}] [-X @var{drc_xtn}] [-x @var{drc_prv}] 
+[-S @var{yr_prv}] [-s @var{yr_srt}] [--seasons=@var{csn_lst}] [--stdin] 
+[-t @var{thr_nbr}] [--tpd=@var{tpd_dly}] [-v @var{var_lst}] [--version] 
+[-x @var{cf_flg}] [-X @var{drc_xtn}] [-x @var{drc_prv}] 
 [-Y @var{rgr_xtn}] [-y @var{rgr_prv}] [--ypf=@var{ypf_max}]
 @end example
 
@@ -17106,7 +17129,7 @@ means.
 Alternatively, in timeseries reshaping mode, @command{ncclimo} will
 subset and temporally split the input raw data timeseries into
 per-variable files spanning the entire period. 
- at command{ncclimo} can optionally regrid all output files in either mode. 
+ at command{ncclimo} can optionally regrid all output files in either mode.
 
 There are five required options (@samp{-c}, @samp{-s}, @samp{-e},
 @samp{-i}, and @samp{-o})) to generate climatologies, and many more
@@ -17494,6 +17517,45 @@ be December of the year before the start year (to allow for contiguous
 If @samp{-a sdd} is specified, the first month used is January of
 the specified start year. 
 
+ at cindex @code{--seasons @var{csn_lst}}
+ at cindex @var{csn_lst}
+ at cindex @code{--seasons}
+ at cindex @code{--csn}
+ at cindex @code{--csn_lst}
+ at item --seasons @var{csn_lst} (@code{--seasons}, @code{--csn_lst}, @code{--csn})
+Seasons for @command{ncclimo} to compute in monthly climatology
+generation mode. 
+The list of seasons, @var{csn_lst}, is a comma-separated,
+case-insensitive, unordered subset of the abbreviations for the eleven
+(so far) defined seasons: 
+ at code{jfm}, @code{amj}, @code{jas}, @code{ond}, @code{on}, @code{fm},
+ at code{djf}, @code{mam}, @code{jja}, @code{son}, and @code{ann}.
+By default @code{@var{csn_lst}=mam,jja,son,djf}.
+Moreover, @command{ncclimo} automatically computes the climatological
+annual mean, @code{ANN}, is always computed when MAM, JJA, SON, and DJF
+are all requested (which is the default).
+The ANN computed automatically is the time-weighted average of the four
+seasons, rather than as the time-weighted average of the twelve monthly
+climatologies. 
+Users who need ANN but not DJF, MAM, JJA, and SON should instead
+explicitly specify ANN as a season in @var{csn_lst}.
+The ANN computed as a season is the time-weighted average of the twelve
+monthly climatologies, rather than the time-weighted average of four
+seasonal climatologies. 
+Specifying the four seasons and ANN in @var{csn_lst} (e.g.,
+ at code{@var{csn_lst}=mam,jja,son,djf,ann}) is legal though redundant
+and wasteful.
+It cause ANN to be computed twice, first as the average of the twelve
+monthly climatologies, then as the average of the four seasons.
+The special value @code{@var{csn_lst}=none} turns-off computation of
+seasonal (and annual) climatologies. 
+ at example
+ncclimo --seasons=none ...            # Produce only monthly climos
+ncclimo --seasons=mam,jja,son,djf ... # Monthly + MAM,JJA,SON,DJF,ANN
+ncclimo --seasons=jfm,jas,ann ...     # Monthly + JFM,JAS,ANN
+ncclimo --seasons=fm,on ...           # Monthly + FM,ON
+ at end example
+
 @cindex @code{--stdin}
 @cindex @code{--inp_std}
 @cindex @code{--std_flg}
@@ -18458,7 +18520,7 @@ SYNTAX
 ncecat [-3] [-4] [-5] [-6] [-7] [-A] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] [--fl_fmt @var{fl_fmt}]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--gag] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}]
 [-L @var{dfl_lvl}] [-l @var{path}] [-M] [--md5_digest] [--mrd] [-n @var{loop}]
 [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
@@ -18955,7 +19017,7 @@ SYNTAX
 ncflint [-3] [-4] [-5] [-6] [-7] [-A] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [--fl_fmt @var{fl_fmt}]
 [-F] [--fix_rec_crd] [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
 [-i @var{var}, at var{val3}] [-L @var{dfl_lvl}] [-l @var{path}] [-N]
 [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
@@ -19251,7 +19313,7 @@ ncks [-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b @var{fl_bnr}] [-C] [-c] [--cdl]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] [--fix_rec_dmn @var{dim}] 
-[-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [--grp_xtr_var_xcl]
+[--fl_fmt @var{fl_fmt}] [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [--grp_xtr_var_xcl]
 [-H] [-h] [--hdn] [--hdr_pad @var{nbr}] [--jsn] [--jsn_fmt @var{lvl}] 
 [-L @var{dfl_lvl}] [-l @var{path}] [-M] [-m] [--map @var{map-file}] 
 [--md5] [--mk_rec_dmn @var{dim}] [--no_blank] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
@@ -19481,6 +19543,26 @@ zender at aerosol:~$ ncks -D 1 --cdl -v tm_365 ~/nco/data/in.nc
 @end verbatim
 @end example
 This option is similar to the @command{ncdump} @samp{-t} option.
+As of @acronym{NCO} version 4.6.8 (August, 2017), @command{ncks} 
+ at acronym{CDL} printing supports finer-grained control of date formats
+with the @samp{--dt_fmt=@var{dt_fmt}} (or @samp{--date_format}) option. 
+The @var{dt_fmt} is an enumerated integer from 0--3.
+Values @math{@var{dt_fmt}=0} or 1 correspond to the short format for
+dates that are the default.
+The value @math{@var{dt_fmt}=2} requests the ``regular'' format for
+dates, @math{@var{dt_fmt}=3} requests the full @acronym{ISO}-8601 format
+with the ``T'' separator:
+ at example
+ at verbatim
+ncks -H -m -v time_bnds -C --dt_fmt=value ~/nco/data/in.nc
+# Value:    Output:
+# 0,1       1964-03-13 09:08:16        # Default, short format
+# 2         1964-03-13 09:08:16.000000 # Regular format
+# 3         1964-03-13T09:08:16.000000 # ISO8601 'T' format
+ at end verbatim
+ at end example
+Note that @samp{--dt_fmt} automatically implies @samp{--cal} and
+ at samp{--cdl} and makes those option superfluous.
 
 @html
 <a name="dmn_fix_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_fix_mk -->
@@ -19727,10 +19809,24 @@ print extracted metadata and data to screen (i.e., @code{stdout}) as
 @acronym{JSON}, JavaScript Object Notation, defined 
 @uref{http://www.json.org, here}.
 @command{ncks} supports @acronym{JSON} output more completely, flexibly,
-and robustly than any other tools to our knowledge.
+and robustly than any other tool to our knowledge.
 With @command{ncks} one can translate entire netCDF3 and netCDF4 files
 into @acronym{JSON}, including metadata and data, using all 
 @acronym{NCO}'s subsetting and hyperslabbing capabilities.
+ at acronym{NCO} uses a @acronym{JSON} format we developed ourselves,
+during a year of discussion among interested researchers.
+Some refer to this format as @acronym{NCO-JSON}, to disambiguate it from 
+other @acronym{JSON} formats for netCDF data.
+Other projects have since adopted, and some can generate, 
+ at acronym{NCO-JSON}.
+ at cindex @acronym{ERDDAP}
+ at cindex @acronym{CF-JSON}
+Projects that support @acronym{NCO-JSON} include @acronym{ERDDAP} 
+(@url{https://coastwatch.pfeg.noaa.gov/erddap/index.html}, choose output
+filetype @code{.ncoJson} from this 
+ at uref{https://coastwatch.pfeg.noaa.gov/erddap/griddap/documentation.html#fileType, table}) 
+and @acronym{CF-JSON} (@url{http://cf-json.org}).
+
 Behold @acronym{JSON} output in default mode:
 @example
 @verbatim
@@ -19854,6 +19950,17 @@ of variable data.
 Downstream parsers can (but are not required to) take advantage of the
 variable's @code{NC_TYPE} to choose the most efficient storage type. 
 
+The Shape member of the variable object is an ordered array of
+dimension names such as @code{"shape": ["lat","lon"]}, similar to its
+use in NcML.
+Each name corresponds to a previously defined Dimension object
+that, taken together, define the rank, shape, and size of the
+variable. 
+Variables are assumed to be scalar by default.
+Hence the Shape member is mandatory for arrays, and is always omitted
+for scalars (by contrast, NcML requires an empty shape string to
+indicate scalars).  
+
 @item @math{@var{lvl} = 1} is a medium-pedantic level that prints all
 attributes as objects (with explicit types) @emph{except} those
 attributes whose types match the simplest default @acronym{JSON} value
@@ -19928,6 +20035,8 @@ like @command{jsonlint}.
 Please let us know how to improve @acronym{JSON} features for your
 application.  
 
+There 
+
 @html
 <a name="Metadata"></a> <!-- http://nco.sf.net/nco.html#Metadata -->
 <a name="M"></a> <!-- http://nco.sf.net/nco.html#M -->
@@ -20761,8 +20870,8 @@ SYNTAX
 ncpdq [-3] [-4] [-5] [-6] [-7] [-A] [-a [-]@var{dim}[, at dots{}]] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]]
-[-F] [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] [--fl_fmt @var{fl_fmt}]
+[-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}]
 [-L @var{dfl_lvl}] [-l @var{path}] [-M @var{pck_map}] [--mrd]
 [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-P @var{pck_plc}] [-p @var{path}] [--ppc ...]
@@ -21360,7 +21469,7 @@ SYNTAX
 ncra [-3] [-4] [-5] [-6] [-7] [-A] [-C] [-c] [--cb]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F] [--fl_fmt @var{fl_fmt}]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}] 
 [-L @var{dfl_lvl}] [-l @var{path}] [--mro] [-N] [-n @var{loop}] 
 [--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] 
@@ -21609,7 +21718,7 @@ SYNTAX
 ncrcat [-3] [-4] [-5] [-6] [-7] [-A] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F] [--fl_fmt @var{fl_fmt}]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
 [-L @var{dfl_lvl}] [-l @var{path}] [--md5_digest] [-n @var{loop}]
 [--no_tmp_fl] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
@@ -21742,7 +21851,7 @@ ncrcat -d time,6.,54. ??.nc 8506_8906.nc
 @noindent
 SYNTAX
 @example
-ncremap [-a @var{alg_typ}] [-D @var{dbg_lvl}] [-d @var{dst_fl}]
+ncremap [-3] [-4] [-5] [-6] [-7] [-a @var{alg_typ}] [-D @var{dbg_lvl}] [-d @var{dst_fl}] [--fl_fmt=@var{fl_fmt}] 
 [-G @var{grd_sng}] [-g @var{grd_dst}] [-I @var{drc_in}] [-i @var{input-file}] [-j @var{job_nbr}]
 [-M] [-m @var{map_fl}] [--msk_dst=@var{msk_dst}] [--msk_out=@var{msk_out}] [--msk_src=@var{msk_src}]
 [-n @var{nco_opt}] [--no_cll_msr ] [--no_frm_trm] [--no_stg_grd]
@@ -21939,6 +22048,32 @@ produce the remapping weights.
 @var{grd_dst} is not modified, and may have read-only permissions.
 
 @html
+<a name="fl_fmt_ncremap"></a> <!-- http://nco.sf.net/nco.html#fl_fmt_ncremap -->
+ at end html
+ at cindex @code{--fl_fmt_ncremap}
+ at cindex @code{--file_format_ncremap}
+ at cindex @code{-3}
+ at cindex @code{-3}
+ at cindex @code{-4}
+ at cindex @code{-5}
+ at cindex @code{-6}
+ at cindex @code{-7}
+As of @acronym{NCO} version 4.6.8 (August, 2017), @command{ncremap}
+supports most of the file format options that the rest of @acronym{NCO}
+has long supported (@pxref{File Formats and Conversion}).
+This includes short flags (e.g., @samp{-4}) and key-value options (e.g., 
+ at samp{--fl_fmt=netcdf4}) though not long-flags without values
+(e.g., @samp{--netcdf4}).
+However, @command{ncremap} can only the full suite of file format
+options to files that it creates, i.e., regridded files.
+The weight generators (@acronym{ERWG} and TempestRemap) are limited
+in the file formats that they can read and write.
+Currently (August, 2017), @acronym{ERWG} supports @code{CLASSIC},
+ at code{64BIT_OFFSET}, and @code{NETCDF4}, while TempestRemap
+supports only @code{CLASSIC}.
+The weightfiles produced are limited to these formats.
+
+ at html
 <a name="grd_sng"></a> <!-- http://nco.sf.net/nco.html#grd_sng -->
 @end html
 @cindex @code{-G @var{grd_sng}}
@@ -22162,6 +22297,11 @@ which regridded quantities should never be placed.
 @var{msk_dst} is the mask template variable in the destination file (whose grid will be inferred),
 @var{msk_out} is the name to give the destination mask in any regridded file, and
 @var{msk_src} is the mask template variable in the source file (whose grid will be inferred).
+The special value @math{@var{msk_dst} = @code{none}} prevents the
+regridder from inferring and treating any variable (even one named,
+e.g., @code{mask}) in a source file as a mask variable.
+This guarantees that all points in the inferred destination grid will be 
+unmasked.  
 
 @html
 <a name="msk_out"></a> <!-- http://nco.sf.net/nco.html#msk_out -->
@@ -22227,6 +22367,11 @@ which regridded quantities should emanate.
 @var{msk_dst} is the mask template variable in the destination file (whose grid will be inferred),
 @var{msk_out} is the name to give the destination mask in any regridded file, and
 @var{msk_src} is the mask template variable in the source file (whose grid will be inferred).
+The special value @math{@var{msk_src} = @code{none}} prevents the
+regridder from inferring and treating any variable (even one named,
+e.g., @code{mask}) in a source file as a mask variable.
+This guarantees that all points in the inferred source grid will be 
+unmasked.  
 
 @html
 <a name="nco_opt"></a> <!-- http://nco.sf.net/nco.html#nco_opt -->
@@ -22414,6 +22559,10 @@ sub-grid area appropriately before regridding.
 values of @var{sgs_frc}: @math{@var{sgs_msk} = 1} is assigned to
 destination gridcells with @math{@var{sgs_frc} > 0.0}, and all others
 @math{@var{sgs_msk} = 0}.
+As of @acronym{NCO} version 4.6.8 (released June, 2017), invoking any
+of the options @samp{--sgs_frc}, @samp{--sgs_msk}, or @samp{--sgs_nrm},
+automatically triggers @acronym{SGS}-mode, so that also invoking 
+ at samp{-P sgs} is redundant though legal.
 
 @command{ncremap} supports convenience options to recover most of the  
 original, model-specific idiosyncracies in raw @acronym{ALM/CLM} and
@@ -22422,12 +22571,29 @@ original, model-specific idiosyncracies in raw @acronym{ALM/CLM} and
 # Invocations for ALM/CLM data
 ncremap -P alm -i in.nc -s src_grd.nc -d dst_data.nc -o out.nc
 ncremap -P sgs -i in.nc -s src_grd.nc -d dst_data.nc -o out.nc
-ncremap -P sgs --sgs_frc=landfrac --sgs_msk=landmask ... 
+ncremap --sgs_frc=landfrac --sgs_msk=landmask ... 
 
 # Equivalent invocations for CICE data
 ncremap -P cice -i in.nc -s src_grd.nc -d dst_data.nc -o out.nc
-ncremap -P sgs --sgs_frc=aice --sgs_msk=tmask --sgs_nrm=100 ... 
- at end example
+ncremap --sgs_frc=aice --sgs_msk=tmask --sgs_nrm=100 ... 
+ at end example
+Files regridded using explicitly specified @acronym{SGS} options will
+differ slightly from those regridded using the @samp{-P alm} or 
+ at samp{-P cice} options. 
+The former will have an @code{area} field in sterradians, the generic
+units used internally by the regridder. 
+The latter will produces model-specific @code{area} fields in square 
+kilometers (for @acronym{ALM}) or square meters (for @acronym{CICE}),
+as expected in the raw output from these two models.
+To convert from angular to areal values, @acronym{NCO} assumes a
+spherical Earth with radius @w{6,371,220 m} or @w{6,371,229 m},
+respectively. 
+The ouput @var{sgs_frc} field is expressed as a decimal fraction in all
+cases except for @samp{-P cice} which stores the fraction in percent.
+Thus the generic @acronym{SGS} and model-specific convenience options
+produce equivalent results, but the latter has the same metadata and
+units as raw model output.
+This makes it more interoperable with many existing analysis scripts. 
 
 Sub-gridscale handling currently requires the user to specify the
 source @acronym{SCRIP} grid-file. 
@@ -22889,16 +23055,19 @@ Currently variables marked as extensive are summed, not regridded.
 
 @unnumberedsubsec Limitations to @command{ncremap}
 
-There are two significant limitations to @command{ncremap} that we
-hope to remove in the coming year.
-First, the fields to be regridded must have latitude and longitude as
-the final two dimension in @var{in_fl}. 
+ at command{ncremap} has two significant limitations to be aware of.
+First, for two-dimensional input grids the fields to be regridded must
+have latitude and longitude, or, in the case of curvilinear data, the
+two equivalent horizontal dimensions, as the final two dimensions in
+ at var{in_fl}.
 Fields with other dimension orders (e.g., @samp{lat,lev,lon}) will not
 regrid properly. 
-To workaround this limitation for the time-being, please employ 
+To workaround this limitation for the time-being, one can employ 
 @command{ncpdq} (@pxref{ncpdq netCDF Permute Dimensions Quickly})
 to permute the dimensions before (and un-permute them after) regridding.
-For example
+ at command{ncremap} utilizes this method internally for some common
+input grids.
+For example,
 @example
 # AIRS Level2 vertical profiles
 ncpdq -a StdPressureLev,GeoTrack,GeoXTrack AIRS_L2.hdf AIRS_L2_ncpdq.nc
@@ -22911,9 +23080,9 @@ ncremap -R "--rgr col_nm=nCells" -i mpas_ncpdq.nc -m mpas120_to_t62.nc -O ~/rgr
 The previous two examples occur so frequently that @command{ncremap} has
 been specially equipped to handle @acronym{AIRS} and @acronym{MPAS}
 files. 
-As of 20160115, the following @command{ncremap} commands with @samp{-P}
-switches automagically perform all the required permutation and renaming
-necessary:
+As of 20160115, the following @command{ncremap} commands with the
+ at samp{-P @var{prc_typ}} option automagically perform all required
+permutation and renaming necessary:
 @example
 # AIRS Level2 vertical profiles
 ncremap -P airs -i AIRS_L2.nc -d dst_1x1.nc -O ~/rgr
@@ -22922,10 +23091,9 @@ ncremap -P mpas -i mpas.nc -m mpas120_to_t62.nc -O ~/rgr
 @end example
 @noindent
 The machinery to handle permutations and special options for other
-datafiles is relatively easy to extend. 
+datafiles is relatively easy to extend with new @var{prc_typ} options. 
 If you work with common datasets that could benefit from their own
- at command{ncremap} @samp{-P} options, contact us and we will try to
-implement them. 
+pre-processing options, contact us and we will try to implement them.  
 
 The second limitation is that @command{ncremap} currently must read
 weights from an on-disk mapfile, it cannot yet compute weights itself 
@@ -23522,7 +23690,7 @@ SYNTAX
 ncwa [-3] [-4] [-5] [-6] [-7] [-A] [-a @var{dim}[, at dots{}]] [-B @var{mask_cond}] [-b] [-C] [-c]
 [--cnk_byt @var{sz_byt}] [--cnk_csh @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] [--fl_fmt @var{fl_fmt}]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}] [-I]
 [-L @var{dfl_lvl}] [-l @var{path}] [-M @var{mask_val}] [-m @var{mask_var}] [-N] 
 [--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] 
@@ -24178,12 +24346,13 @@ Large work-load testing
 @cindex Lori Sentman
 @cindex Michael Schulz
 @cindex Rich Signell
+ at cindex Bob Simons
 @cindex Gary Strand
 @cindex Adrian Tompkins
 @cindex Andrew Wittenberg
 @cindex George White
 @cindex Remik Ziemlinski
- at item Dave Blodgett, Peter Campbell, Martin Dix, Mark Flanner, Markus Liebig, Keith Lindsay, Mike Page, Martin Schmidt, Michael Schulz, Lori Sentman, Rich Signell, Gary Strand, Adrian Tompkins, George White Andrew Wittenberg, Remik Ziemlinski
+ at item Dave Blodgett, Peter Campbell, Martin Dix, Mark Flanner, Markus Liebig, Keith Lindsay, Mike Page, Martin Schmidt, Michael Schulz, Lori Sentman, Rich Signell, Bob Simons, Gary Strand, Adrian Tompkins, George White Andrew Wittenberg, Remik Ziemlinski
 Excellent bug reports and feature requests.
 @cindex Filipe Fernandes
 @cindex Hugo Oliveira
diff --git a/man/Makefile.in b/man/Makefile.in
index d96b7ba..375ea04 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/man/ncap.1 b/man/ncap.1
index a84d8ba..1ae5ef1 100644
--- a/man/ncap.1
+++ b/man/ncap.1
@@ -8,7 +8,7 @@ ncap \- netCDF Arithmetic Processor
 .SH SYNTAX
 ncap [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-C] [\-c] [\-D 
 .IR dbg_lvl ]
-[\-F] [\-f]
+[-F] [--fl_fmt=fmt] [\-f]
 [\-\-glb
 .IR att_name=
 .IR att_val ]]
diff --git a/man/ncap2.1 b/man/ncap2.1
index 5f2171b..ca61649 100644
--- a/man/ncap2.1
+++ b/man/ncap2.1
@@ -13,7 +13,7 @@ ncap2 [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-F] [\-f]
+[-F] [--fl_fmt=fmt] [\-f]
 [\-\-glb
 .IR att_name=
 .IR att_val ]]
diff --git a/man/ncbo.1 b/man/ncbo.1
index eb1adbf..a5da417 100644
--- a/man/ncbo.1
+++ b/man/ncbo.1
@@ -25,7 +25,7 @@ ncbo [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-F] [\-G
+[-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncclimo.1 b/man/ncclimo.1
index 083b5a1..f16ad0e 100644
--- a/man/ncclimo.1
+++ b/man/ncclimo.1
@@ -48,7 +48,8 @@ ncclimo
 .IR yr_prv ] 
 [\-s
 .IR yr_srt ] 
-[\--std_flg ] [\-t
+[\--std_flg ] [\--seasons
+.IR csn_lst ] [\-t
 .IR thr_nbr ] [\--tpd_out
 .IR tpd_out ] [\-v
 .IR var_lst ] 
diff --git a/man/ncecat.1 b/man/ncecat.1
index 8e77fe6..f0e5ba6 100644
--- a/man/ncecat.1
+++ b/man/ncecat.1
@@ -24,7 +24,7 @@ ncecat [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-F] [\-G
+[-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/nces.1 b/man/nces.1
index d19e409..9b47e14 100644
--- a/man/nces.1
+++ b/man/nces.1
@@ -24,7 +24,7 @@ nces [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-\-dbl|flt] [\-F] [\-G
+[\-\-dbl|flt] [-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncflint.1 b/man/ncflint.1
index 0bca7b4..fb004c9 100644
--- a/man/ncflint.1
+++ b/man/ncflint.1
@@ -24,7 +24,7 @@ ncflint [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-F] [\-\-fix_rec_crd] [\-G
+[-F] [--fl_fmt=fmt] [\-\-fix_rec_crd] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncks.1 b/man/ncks.1
index 57c1309..3adfd5f 100644
--- a/man/ncks.1
+++ b/man/ncks.1
@@ -29,7 +29,7 @@ dbg_lvl]
 .IR min ][,[
 .IR max ]][,[
 .IR stride ]]]
-[\-F] [\-\-fix_rec_dmn
+[-F] [--fl_fmt=fmt] [\-\-fix_rec_dmn
 .IR dim ]
 [\-G
 .IR gpe_dsc ]
diff --git a/man/ncpdq.1 b/man/ncpdq.1
index 4ab115e..0dfc59d 100644
--- a/man/ncpdq.1
+++ b/man/ncpdq.1
@@ -26,7 +26,7 @@ ncpdq [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-a
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-F] [\-G
+[-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncra.1 b/man/ncra.1
index 5f3a8b1..e032fdf 100644
--- a/man/ncra.1
+++ b/man/ncra.1
@@ -26,7 +26,7 @@ ncra [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR max ]][,
 .IR stride [[,[
 .IR subcycle ]]]]]
-[\-\-dbl|flt] [\-F] [\-G
+[\-\-dbl|flt] [-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncrcat.1 b/man/ncrcat.1
index 5037c10..079c46c 100644
--- a/man/ncrcat.1
+++ b/man/ncrcat.1
@@ -26,7 +26,7 @@ ncrcat [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-\-bfr
 .IR max ]][,[
 .IR stride [[,[
 .IR subcycle ]]]]]
-[\-F] [\-G
+[-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/man/ncremap.1 b/man/ncremap.1
index e96d562..23c1856 100644
--- a/man/ncremap.1
+++ b/man/ncremap.1
@@ -7,13 +7,12 @@
 ncremap \- netCDF Remapper
 .SH SYNTAX
 ncremap
-[\-a
+[\-3] [\-4] [\-5] [\-6] [\-7] [\-a
 .IR alg_typ ]
 [\-D
 .IR dbg_lvl ] 
 [\-d
-.IR dst_fl ] 
-[\-G
+.IR dst_fl ] [\-\-fl_fmt=fmt] [\-G
 .IR grd_sng ] 
 [\-g
 .IR grd_fl ] 
diff --git a/man/ncwa.1 b/man/ncwa.1
index 5e2e433..d3ac74e 100644
--- a/man/ncwa.1
+++ b/man/ncwa.1
@@ -28,7 +28,7 @@ ncwa [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-a
 .IR dim ,[
 .IR min ][,[
 .IR max ]]]
-[\-\-dbl|flt] [\-F] [\-G
+[\-\-dbl|flt] [-F] [--fl_fmt=fmt] [\-G
 .IR gpe_dsc ]
 [\-g  
 .IR grp [,...]]
diff --git a/src/Makefile.in b/src/Makefile.in
index 59529f0..620a68b 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/src/nco++/Makefile.in b/src/nco++/Makefile.in
index 902e848..c23c244 100644
--- a/src/nco++/Makefile.in
+++ b/src/nco++/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index 3cccc17..d7f5b65 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -75,6 +75,9 @@
       fmc_vtr.push_back( fmc_cls("total",this,(int)PTTL));
       fmc_vtr.push_back( fmc_cls("ttl",this,(int)PTTL));
       fmc_vtr.push_back( fmc_cls("sum",this,(int)PTTL));
+      fmc_vtr.push_back( fmc_cls("tabs",this,(int)PTABS));
+      fmc_vtr.push_back( fmc_cls("ttlabs",this,(int)PTABS));
+
     }
   }		      
 		      
@@ -252,8 +255,6 @@
 
 
 
-
-
             // do the heavy lifting
             switch(fdx){
                     
@@ -271,17 +272,26 @@
                     break;
                     
                 case PMIBS:
+                    (void)nco_var_abs(var1->type,var1->sz,var1->has_mss_val,var1->mss_val,var1->val);
                     var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_mibs,False,&ddra_info);
                     break;
                     
                 case PMABS:
+                    (void)nco_var_abs(var1->type,var1->sz,var1->has_mss_val,var1->mss_val,var1->val);
                     var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_mabs,False,&ddra_info);
                     break;
                     
                 case PMEBS:
-                    var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_mebs,False,&ddra_info);
+                    (void)nco_var_abs(var1->type,var1->sz,var1->has_mss_val,var1->mss_val,var1->val);
+                    var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_avg,False,&ddra_info);
+                    (void)nco_var_nrm(var->type,var->sz,var->has_mss_val,var->mss_val,var->tally,var->val);
                     break;
-                    
+
+                case PTABS:
+                    (void)nco_var_abs(var1->type,var1->sz,var1->has_mss_val,var1->mss_val,var1->val);
+                    var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_avg,False,&ddra_info);
+                    break;
+
                 case PMAX:
                     var=nco_var_avg(var1,dim,avg_nbr_dim,nco_op_max,False,&ddra_info);
                     break;
@@ -4796,14 +4806,14 @@ var_sct *vlist_cls::push_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_cl
   {
      case PATOI: 
        {          
-         char *pend='\0';
+         char *pend=NULL;
          nco_int iout;
          iout=0; 
 
 	 // allows whites space prefix & suffix                                                                                                                                
          iout=(nco_int)std::strtol(buffer,&pend,10);
 
-         if( pend !=buffer  && (*pend=='\0'|| *pend==' ') )
+         if(pend != buffer && (*pend == '\0'|| *pend == ' '))
             ierr=0;
          else
             ierr=errno;
@@ -4817,14 +4827,14 @@ var_sct *vlist_cls::push_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_cl
 
      case PATOL: 
        {          
-         char *pend='\0';
+         char *pend=NULL;
          nco_int64 lout;
          lout=0; 
 
 	      // allows whites space prefix & suffix
          lout=(nco_int64)std::strtoll(buffer,&pend,10);
 
-         if( pend !=buffer  && (*pend=='\0'|| *pend==' ') )
+         if( pend !=buffer && (*pend == '\0' || *pend == ' '))
             ierr=0;
          else
 	        ierr=errno;
diff --git a/src/nco++/fmc_all_cls.hh b/src/nco++/fmc_all_cls.hh
index e9201b4..0bf922a 100644
--- a/src/nco++/fmc_all_cls.hh
+++ b/src/nco++/fmc_all_cls.hh
@@ -83,7 +83,7 @@ class agg_cls: public vtl_cls {
 private:
   /* we want the enums to be exactly identical to the values of nco_op_typ */
   enum{ PAVG=nco_op_avg ,PAVGSQR=nco_op_avgsqr , PMIBS=nco_op_mibs, PMABS=nco_op_mabs, PMEBS=nco_op_mebs, PMAX=nco_op_max ,PMIN=nco_op_min ,PRMS=nco_op_rms,
-	PRMSSDN=nco_op_rmssdn, PSQRAVG=nco_op_sqravg, PTTL=nco_op_ttl};
+	PRMSSDN=nco_op_rmssdn, PSQRAVG=nco_op_sqravg, PTTL=nco_op_ttl, PTABS=nco_op_tabs};
   bool _flg_dbg;
 public:
   agg_cls(bool flg_dbg);
diff --git a/src/nco++/ncap2.cc b/src/nco++/ncap2.cc
index e62a637..ef0b0f1 100644
--- a/src/nco++/ncap2.cc
+++ b/src/nco++/ncap2.cc
@@ -35,7 +35,8 @@
    ncap2 -O -v -s 'defdim("dmn_tmp")=5;foo[$dmn_tmp]={0,2,4,6,8};foo2=one_dmn_rec_var(foo);print(foo);print(foo2);' ~/nco/data/in.nc ~/foo.nc;
    ncap2 -O -v -s 'foo=0*three_dmn_var_dbl;where(three_dmn_var_dbl>30){foo=three_dmn_var_dbl;}elsewhere{foo=three_dmn_var_dbl at _FillValue;};foo_avg=foo.avg($time);print(foo_avg);' ~/nco/data/in.nc ~/foo.nc
    ncap2 -O -v -D 1 -s 'one_dmn_rec_var(0)=one_dmn_rec_var(0)+1' ~/nco/data/in.nc ~/foo.nc
-   ncap2 -O -v -D 1 -s 'three_dmn_rec_var(0,,)=three_dmn_rec_var(0,,)+1' ~/nco/data/in.nc ~/foo.nc */
+   ncap2 -O -v -D 1 -s 'three_dmn_rec_var(0,,)=three_dmn_rec_var(0,,)+1' ~/nco/data/in.nc ~/foo.nc
+   ncap2 -O -v -D 1 -s 'time=10.0*gsl_rng_uniform(time)' ~/nco/data/in.nc ~/foo.nc */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h" /* Autotools tokens */
@@ -208,8 +209,9 @@ main(int argc,char **argv)
   nco_bool RM_RMT_FL_PST_PRC=True; /* Option R */
   nco_bool WRT_TMP_FL=True; /* [flg] Write output to temporary file */
   nco_bool flg_mmr_cln=True;  /* [flg] Clean memory prior to exit */
-  nco_bool flg_cll_mth=True;  /* [flg] Add/modify cell_methods attributes */
+  nco_bool flg_cll_mth=False;  /* [flg] Add/modify cell_methods attributes */
 
+  
   nm_id_sct *dmn_lst=NULL_CEWI;
   nm_id_sct *xtr_lst=NULL_CEWI; /* Non-processed variables to copy to OUTPUT */
   nm_id_sct *xtr_lst_a=NULL_CEWI; /* Initialize to ALL variables in OUTPUT file */
@@ -712,7 +714,8 @@ main(int argc,char **argv)
   } /* Existing file */
   
   /* Initialize chunking from user-specified inputs */
-  if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC) rcd+=nco_cnk_ini(in_id,fl_out,cnk_arg,cnk_nbr,cnk_map,cnk_plc,cnk_csh_byt,cnk_min_byt,cnk_sz_byt,cnk_sz_scl,&cnk);
+  if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC)
+    rcd+=nco_cnk_ini(in_id,fl_out,cnk_arg,cnk_nbr,cnk_map,cnk_plc,cnk_csh_byt,cnk_min_byt,cnk_sz_byt,cnk_sz_scl,&cnk);
 
   /* Copy global attributes */
   (void)nco_att_cpy(in_id,out_id,NC_GLOBAL,NC_GLOBAL,(nco_bool)True);
@@ -750,7 +753,7 @@ main(int argc,char **argv)
   prs_arg.NCAP_MPI_SORT=(thr_nbr > 1 ? true:false);
   prs_arg.FLG_CLL_MTH=(flg_cll_mth ? true:false);
   prs_arg.dfl_lvl=dfl_lvl;  /* [enm] Deflate level */
-  prs_arg.cnk_sz=(size_t *)NULL; /* Chunk sizes NULL for now */ 
+  prs_arg.cnk_in=&cnk; /* chunking sct */
   
 #ifdef NCO_NETCDF4_AND_FILLVALUE
   prs_arg.NCAP4_FILL=(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC);
@@ -1039,7 +1042,20 @@ main(int argc,char **argv)
   } /* end for */
   
   /* Set chunksize parameters */
-  if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC) (void)nco_cnk_sz_set(out_id,(lmt_msa_sct **)NULL_CEWI,(int)0,&cnk_map,&cnk_plc,cnk_sz_scl,cnk.cnk_dmn,cnk_nbr);
+  if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC) {
+
+    //(void) nco_cnk_sz_set(out_id, (lmt_msa_sct **) NULL_CEWI, (int) 0, &cnk_map, &cnk_plc, cnk_sz_scl, cnk.cnk_dmn,cnk_nbr);
+    dmn_cmn_sct cmn[NC_MAX_DIMS];
+    /* update member dmn_cmn_vtr() from dmn_out_vtr */
+    prs_arg.ncap_pop_dmn_cmn();
+    for(idx=0; idx<nbr_var_fix;idx++) {
+      prs_arg.ncap_pop_var_dmn_cmn(var_fix[idx], cmn);
+      (void) nco_cnk_sz_set_trv(in_id, out_id, &cnk, var_fix[idx]->nm, cmn);
+    }
+  }
+
+
+
 
   /* Turn-off default filling behavior to enhance efficiency */
   nco_set_fill(out_id,NC_NOFILL,&fll_md_old);
diff --git a/src/nco++/ncap2_att.cc b/src/nco++/ncap2_att.cc
index a238b92..23ba0bf 100644
--- a/src/nco++/ncap2_att.cc
+++ b/src/nco++/ncap2_att.cc
@@ -273,7 +273,17 @@ ncap_att_gnrl
       att_vtr.push_back(Nvar);
     }
   }
-  
+
+  //delete transient atts
+  // nb go through vector in reverse order deleting
+  if(tr_int_vtr.size())
+    for(idx=tr_int_vtr.size()-1; idx>=0; idx--)
+      var_vtr.erase(tr_int_vtr[idx]);
+
+
+
+
+
   sz=att_vtr.size();
   // add new att to list;
   for(idx=0;idx< sz;idx++){
@@ -288,12 +298,6 @@ ncap_att_gnrl
 #endif
   }
 
-  //delete transient atts
-  // nb go through vector in reverse order deleting
-  if(tr_int_vtr.size())
-    for(idx=tr_int_vtr.size()-1; idx>=0; idx--)
-      var_vtr.erase( tr_int_vtr[idx] );
-
   return sz;
   
 } /* end ncap_att_gnrl() */
@@ -319,16 +323,22 @@ ncap_att_stretch /* stretch a single valued attribute from 1 to sz */
   // and and calloc space for new ones
   if(var->type == (nc_type)NC_STRING)
   {
-    
-    (void)cast_void_nctype((nc_type)NC_STRING,&var->val);    
-    
-    nco_free(var->val.sngp[0]);  
-    nco_free(var->val.sngp);     
-    
-    var->val.sngp=(char**)nco_calloc(nw_sz,var_typ_sz);         
-    (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
+    ptr_unn nw_val;
 
-    
+    nw_val.sngp=(char**)nco_calloc(nw_sz,var_typ_sz);
+    (void)cast_void_nctype((nc_type)NC_STRING,&var->val);
+
+    for(idx=0;idx<nw_sz;idx++)
+      nw_val.sngp[idx]=  var->val.sngp[0] ? strdup(var->val.sngp[0]) : NULL_CEWI ;
+
+
+    var->val.sngp[0]=(nco_string )nco_free(var->val.sngp[0]);
+    var->val.sngp=(nco_string*)nco_free(var->val.sngp);
+
+    var->val=nw_val;
+
+    (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
+    var->sz=nw_sz;
   }
   else
   {
diff --git a/src/nco++/ncap2_utl.cc b/src/nco++/ncap2_utl.cc
index 0fcb827..87d9b62 100644
--- a/src/nco++/ncap2_utl.cc
+++ b/src/nco++/ncap2_utl.cc
@@ -7,6 +7,7 @@
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
 
+#include <nco.h>
 #include "ncap2_utl.hh"
 
 
@@ -2185,6 +2186,7 @@ ncap_get_var_mem
     if(srd==1) {
       for(jdx=0 ; jdx <nbr_lpp ; jdx++){  
         (void)memcpy(cp_out, cp_srt, ptrdiff_t(cnt*slb_sz));
+        if(var_in->type==NC_STRING) ncap_sngcpy(cp_out,cnt);
         cp_out+=ptrdiff_t(cnt*slb_sz);
         cp_srt+=ptrdiff_t(dpt_cnt*slb_sz); 
       }
@@ -2196,6 +2198,7 @@ ncap_get_var_mem
         for(idx=0 ; idx<cnt ; idx++ ){
           
           (void)memcpy(cp_out,cp_lcl,slb_sz);
+          if(var_in->type==NC_STRING) ncap_sngcpy(cp_out,1);
           cp_out+=slb_sz;
           cp_lcl+=(ptrdiff_t)(srd*slb_sz);
         }
@@ -2331,12 +2334,14 @@ char *cp_out)                   // Slab to be "put"
     
       if(srd==1) {
         (void)memcpy(cp_end,cp_in,cnt*slb_sz);
+        if(var_out->type==NC_STRING) ncap_sngcpy(cp_end, cnt*slb_sz);
         cp_in+=(ptrdiff_t)cnt*slb_sz;
       }
       if(srd >1) {
         char *cp_lcl=cp_end;
         for(jdx=0 ; jdx<cnt ; jdx++ ){
           (void)memcpy(cp_lcl,cp_in,slb_sz);
+          if(var_out->type==NC_STRING) ncap_sngcpy(cp_lcl,slb_sz);
           cp_in+=(ptrdiff_t)slb_sz;
           cp_lcl+=(ptrdiff_t)(srd*slb_sz);
         } //loop jdx
@@ -2423,7 +2428,8 @@ NcapVector<lmt_sct*> &dmn_vtr)
    
   // user has specified  the whole hyperslab
   if(var_in->sz==var_out->sz){
-    (void)memcpy(cp_out,cp_in, var_in->sz*nco_typ_lng(var_in->type)); 
+    (void)memcpy(cp_out,cp_in, var_in->sz*nco_typ_lng(var_in->type));
+    if(var_out->type==NC_STRING) ncap_sngcpy(cp_out, var_in->sz* nco_typ_lng(var_in->type) );
   }
   else
   // Call in-memory nco_put_var_mem (n.b is recursive of course!!)
@@ -2431,6 +2437,7 @@ NcapVector<lmt_sct*> &dmn_vtr)
   
 } /* end nco_put_var_mem() */
 
+
 // See if node contains any utility fuctions
 // if so return true
 bool 
@@ -2457,6 +2464,27 @@ RefAST tr
  return false;
 }
 
+/* take a list of nco_string's and refresh them with strdup */
+void
+ncap_sngcpy(
+char *cp, /* nb pointer to first nco_string in list  (technically this of type char ** ) */
+int bsz)  /* total size (in bytes) of array of nco_string */
+{
+  int idx;
+  ptr_unn val;
+
+  val.cp=cp;
+
+  bsz/=sizeof(nco_string);
+
+  for(idx=0;idx<bsz;idx++ )
+    if(val.sngp[idx])
+       val.sngp[idx]=(nco_string)strdup(val.sngp[idx]);
+
+}
+
+
+
 /*********************************************************************************/
 /* Following - all MPI optimization routines                                     */
 /*********************************************************************************/  
diff --git a/src/nco++/ncap2_utl.hh b/src/nco++/ncap2_utl.hh
index a5865bb..3911397 100644
--- a/src/nco++/ncap2_utl.hh
+++ b/src/nco++/ncap2_utl.hh
@@ -127,7 +127,10 @@ ncap_norm_shp_chk(
 var_sct* var1, 
 var_sct* var2); 
 
-
+void
+ncap_sngcpy(  /* take a list of nco_string's and refresh them with strdup */
+char *cp,
+int bsz);
 
 /***************************************************************************************/
 
diff --git a/src/nco++/ncoGrammer.g b/src/nco++/ncoGrammer.g
index 53274fd..e0449fc 100644
--- a/src/nco++/ncoGrammer.g
+++ b/src/nco++/ncoGrammer.g
@@ -1693,7 +1693,7 @@ var=NULL_CEWI;
                // index in limit -- i.e hyperslab a mult-dimensional var
                // with a single index 
               
-               if(lmt->getNumberOfChildren()==1 && 
+               if(lmt->getNumberOfChildren()==1 &&
                   lmt->getFirstChild()->getNumberOfChildren()==1 &&
                   lmt->getFirstChild()->getFirstChild()->getType() != COLON
                  ){
@@ -1761,13 +1761,13 @@ var=NULL_CEWI;
                  if(var_rhs->sz != slb_sz){
                    err_prn(fnc_nm, "Hyperslab for "+var_nm+" - number of elements on LHS(" +nbr2sng(slb_sz) +  ") doesn't equal number of elements on RHS(" +nbr2sng(var_rhs->sz) +  ")");                                       
                  }
-
+                    
                 (void)nco_put_var_mem(var_rhs,var_lhs,lmt_vtr);
                 if(Nvar==NULL)
                    (void)prs_arg->ncap_var_write(var_lhs,true); 
 
               // deal with Regular Vars
-              } else {                 
+              }else{                 
 
               // if var undefined in O or defined but not populated
                if(!Nvar || ( Nvar && Nvar->flg_stt==1)){              
@@ -1845,9 +1845,9 @@ var=NULL_CEWI;
 
               } // end put block !!
 
-             } // end else if regular var
+              } // end else if regular var
 
-              var_rhs=nco_var_free(var_rhs);
+             var_rhs=nco_var_free(var_rhs);
               
                // Empty and free vector 
               for(idx=0 ; idx < nbr_dmn ; idx++)
@@ -3647,7 +3647,7 @@ var_sct *var_nbr;
 
                  }else{
                     var_lhs=prs_arg->ncap_var_init(var_nm,true);       
-               }
+                 }
                   
                // fortran index convention   
                if(prs_arg->FORTRAN_IDX_CNV)
@@ -3670,7 +3670,11 @@ var_sct *var_nbr;
                  var_rhs=nco_var_cnf_typ(var_lhs->type,var_rhs);             
                
                  slb_sz=nco_typ_lng(var_lhs->type);     
-                 (void)memcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),var_rhs->val.vp,slb_sz);    
+                 (void)memcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),var_rhs->val.vp,slb_sz);
+                 
+                 if(var_lhs->type==NC_STRING)
+                    (void)ncap_sngcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),slb_sz);
+
 
                  if(!Nvar)
                    (void)prs_arg->ncap_var_write(var_lhs,true); 
@@ -3689,6 +3693,7 @@ var_sct *var_nbr;
                 }
  
                 var_lhs=prs_arg->ncap_var_init(var_nm,false);
+
                     
                // fortran index convention   
                if(prs_arg->FORTRAN_IDX_CNV)
@@ -3719,6 +3724,7 @@ var_sct *var_nbr;
                  long srt1[NC_MAX_DIMS];   
                  long sz_dim=1; 
 
+                 var_lhs->sz=1;
                  // convert srt into multiple indices  
                  for(idx=0;idx<nbr_dim;idx++)
                    sz_dim*= var_lhs->cnt[idx]; 
@@ -3740,7 +3746,7 @@ var_sct *var_nbr;
                  (void)prs_arg->ncap_var_write_slb(var_lhs);     
 
                 }//end write block 
-            }     
+              }     
                    var_rhs=nco_var_free(var_rhs); 
                    var_nbr=nco_var_free(var_nbr); 
 }
@@ -3921,7 +3927,19 @@ var=NULL_CEWI;
            if(var->sz ==1) {
               
              var1=ncap_sclr_var_mk(var_nm,var->type,true);
+             
              (void)memcpy( (void*)var1->val.vp,var->val.vp,nco_typ_lng(var1->type));
+             if(var1->type==NC_STRING)
+                 (void)ncap_sngcpy((char*)var1->val.vp, nco_typ_lng(var1->type) );
+             /*
+             if(var->type==NC_STRING){
+                 cast_void_nctype(NC_STRING, &var->val); 
+                 var1->val.sngp[0]=(nco_string)strdup(var->val.sngp[0]);
+                 cast_nctype_void(NC_STRING, &var->val); 
+             }else{
+             
+           }
+           */  
              
              // copy missing value if any from var_rhs to var1
              nco_mss_val_cp(var_rhs,var1);
diff --git a/src/nco++/ncoTree.cpp b/src/nco++/ncoTree.cpp
index 084ff3b..276c6da 100644
--- a/src/nco++/ncoTree.cpp
+++ b/src/nco++/ncoTree.cpp
@@ -1,4 +1,4 @@
-/* $ANTLR 2.7.7 (20161005): "ncoGrammer.g" -> "ncoTree.cpp"$ */
+/* $ANTLR 2.7.7 (20160429): "ncoGrammer.g" -> "ncoTree.cpp"$ */
 #include "ncoTree.hpp"
 #include <antlr/Token.hpp>
 #include <antlr/AST.hpp>
@@ -3616,7 +3616,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				// index in limit -- i.e hyperslab a mult-dimensional var
 				// with a single index 
 				
-				if(lmt->getNumberOfChildren()==1 && 
+				if(lmt->getNumberOfChildren()==1 &&
 				lmt->getFirstChild()->getNumberOfChildren()==1 &&
 				lmt->getFirstChild()->getFirstChild()->getType() != COLON
 				){
@@ -3690,7 +3690,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				(void)prs_arg->ncap_var_write(var_lhs,true); 
 				
 				// deal with Regular Vars
-				} else {                 
+				}else{                 
 				
 				// if var undefined in O or defined but not populated
 				if(!Nvar || ( Nvar && Nvar->flg_stt==1)){              
@@ -5488,7 +5488,11 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			var_rhs=nco_var_cnf_typ(var_lhs->type,var_rhs);             
 			
 			slb_sz=nco_typ_lng(var_lhs->type);     
-			(void)memcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),var_rhs->val.vp,slb_sz);    
+			(void)memcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),var_rhs->val.vp,slb_sz);
+			
+			if(var_lhs->type==NC_STRING)
+			(void)ncap_sngcpy((char*)var_lhs->val.vp+(ptrdiff_t)(srt*slb_sz),slb_sz);
+			
 			
 			if(!Nvar)
 			(void)prs_arg->ncap_var_write(var_lhs,true); 
@@ -5508,6 +5512,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			
 			var_lhs=prs_arg->ncap_var_init(var_nm,false);
 			
+			
 			// fortran index convention   
 			if(prs_arg->FORTRAN_IDX_CNV)
 			srt--;
@@ -5537,6 +5542,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			long srt1[NC_MAX_DIMS];   
 			long sz_dim=1; 
 			
+			var_lhs->sz=1;
 			// convert srt into multiple indices  
 			for(idx=0;idx<nbr_dim;idx++)
 			sz_dim*= var_lhs->cnt[idx]; 
@@ -5562,7 +5568,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			var_rhs=nco_var_free(var_rhs); 
 			var_nbr=nco_var_free(var_nbr); 
 			
-#line 5566 "ncoTree.cpp"
+#line 5572 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -5579,18 +5585,18 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3751 "ncoGrammer.g"
+#line 3757 "ncoGrammer.g"
 	var_sct *var;
-#line 5585 "ncoTree.cpp"
+#line 5591 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST var_lmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 3751 "ncoGrammer.g"
+#line 3757 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt");
 	var=NULL_CEWI; 
 	
-#line 5594 "ncoTree.cpp"
+#line 5600 "ncoTree.cpp"
 	
 	try {      // for error handling
 		ANTLR_USE_NAMESPACE(antlr)RefAST __t450 = _t;
@@ -5603,7 +5609,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = __t450;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3756 "ncoGrammer.g"
+#line 3762 "ncoGrammer.g"
 			
 			bool bram;   // Check for a RAM variable
 			bool bnrm;
@@ -5772,7 +5778,19 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			if(var->sz ==1) {
 			
 			var1=ncap_sclr_var_mk(var_nm,var->type,true);
+			
 			(void)memcpy( (void*)var1->val.vp,var->val.vp,nco_typ_lng(var1->type));
+			if(var1->type==NC_STRING)
+			(void)ncap_sngcpy((char*)var1->val.vp, nco_typ_lng(var1->type) );
+			/*
+			if(var->type==NC_STRING){
+			cast_void_nctype(NC_STRING, &var->val); 
+			var1->val.sngp[0]=(nco_string)strdup(var->val.sngp[0]);
+			cast_nctype_void(NC_STRING, &var->val); 
+			}else{
+			
+			}
+			*/  
 			
 			// copy missing value if any from var_rhs to var1
 			nco_mss_val_cp(var_rhs,var1);
@@ -5844,7 +5862,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			end2: var_rhs=nco_var_free(var_rhs); 
 			
-#line 5848 "ncoTree.cpp"
+#line 5866 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
diff --git a/src/nco++/ncoTree.hpp b/src/nco++/ncoTree.hpp
index dd01575..e90a841 100644
--- a/src/nco++/ncoTree.hpp
+++ b/src/nco++/ncoTree.hpp
@@ -3,7 +3,7 @@
 
 #include <antlr/config.hpp>
 #include "ncoParserTokenTypes.hpp"
-/* $ANTLR 2.7.7 (20161005): "ncoGrammer.g" -> "ncoTree.hpp"$ */
+/* $ANTLR 2.7.7 (20160429): "ncoGrammer.g" -> "ncoTree.hpp"$ */
 #include <antlr/TreeParser.hpp>
 
 #line 1 "ncoGrammer.g"
diff --git a/src/nco++/prs_cls.cc b/src/nco++/prs_cls.cc
index 5808b7e..c944468 100644
--- a/src/nco++/prs_cls.cc
+++ b/src/nco++/prs_cls.cc
@@ -17,6 +17,7 @@
 // Standard C headers
 #include <assert.h>
 #include <ctype.h>
+#include <nco.h>
 
 // Personal headers
 #include "ncap2_utl.hh"
@@ -466,14 +467,17 @@ prs_cls::ncap_var_write_omp(
       (void)nco_inq_format(out_id,&fl_fmt);
       if( (fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC) && var->nbr_dim > 0)
       {
+        dmn_cmn_sct cmn[NC_MAX_DIMS];
+        ncap_pop_dmn_cmn();
+        ncap_pop_var_dmn_cmn(var, cmn);
+        (void)nco_cnk_sz_set_trv(in_id,out_id,cnk_in, var->nm,cmn);
 
-          int flg_cnk;
-	      if(dfl_lvl >= 0)
-            (void)nco_def_var_deflate(out_id,var_out_id,var->shuffle,(int)True,dfl_lvl);
-          else if(var->dfl_lvl >= 0)
-            (void)nco_def_var_deflate(out_id,var_out_id,var->shuffle,(int)True,var->dfl_lvl);
+        if(dfl_lvl >= 0)
+          (void)nco_def_var_deflate(out_id,var_out_id,var->shuffle, True,dfl_lvl);
+        else if(var->dfl_lvl >= 0)
+          (void)nco_def_var_deflate(out_id,var_out_id,var->shuffle, True,var->dfl_lvl);
 
-          /* remember ncap_get_cnk_sz can set var->cnk_sz */
+        /*
           flg_cnk=ncap_get_cnk_sz(var);
 
           for(idx=0;idx<var->nbr_dim;idx++)
@@ -485,7 +489,7 @@ prs_cls::ncap_var_write_omp(
             (void)nco_def_var_chunking(out_id,var_out_id,(int)NC_CHUNKED,var->cnk_sz);
           else
             (void)nco_def_var_chunking(out_id,var_out_id,(int)NC_CONTIGUOUS,var->cnk_sz);
-
+        */
 
 	  } /* endif netCDF4 */
 
@@ -556,6 +560,9 @@ void prs_cls::ncap_def_ntl_scn(void) {
   NcapVar *Nvar;
   NcapVar *Cvar;
   var_sct *var1;
+  dmn_cmn_sct cmn[NC_MAX_DIMS];
+
+  ncap_pop_dmn_cmn();
 
   int fl_fmt; /* [enm] Output file format */
 
@@ -591,8 +598,19 @@ void prs_cls::ncap_def_ntl_scn(void) {
 
         /* Set HDF Lempel-Ziv compression level, if requested */
 
-        if ((fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC) && var1->nbr_dim)
-        {
+        if ((fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC) && var1->nbr_dim) {
+          // use chunking inheritance
+          ncap_pop_var_dmn_cmn(var1, cmn);
+          (void) nco_cnk_sz_set_trv(in_id, out_id, cnk_in, var1->nm, cmn);
+
+          if (dfl_lvl >= 0)
+            (void) nco_def_var_deflate(out_id, var_id, var1->shuffle, True, dfl_lvl);
+          else if (var1->dfl_lvl >= 0)
+            (void) nco_def_var_deflate(out_id, var_id, var1->shuffle, True, var1->dfl_lvl);
+
+
+          /*
+          {
           int flg_cnk;
           if (dfl_lvl >= 0)
             (void) nco_def_var_deflate(out_id, var_id, var1->shuffle, (int) True, dfl_lvl);
@@ -615,6 +633,8 @@ void prs_cls::ncap_def_ntl_scn(void) {
 
         }
 
+        */
+        }
 
       } else {
         //deal with RAM only var
@@ -634,6 +654,57 @@ void prs_cls::ncap_def_ntl_scn(void) {
   int_vtr.clear();
 }
 
+void prs_cls::ncap_pop_dmn_cmn(void){
+
+  int idx;
+  int sz;
+  dmn_cmn_sct *dmn_cmn;
+  if(dmn_out_vtr.size() == dmn_cmn_vtr.size() )
+    return;
+   sz=dmn_out_vtr.size();
+
+   for(idx=0;idx<sz; idx++ )
+     if(!dmn_cmn_vtr.find( dmn_out_vtr[idx]->nm) ){
+       dmn_cmn=(dmn_cmn_sct*)nco_malloc( sizeof(dmn_cmn_sct) );
+       dmn_cmn->nm_fll=strdup(dmn_out_vtr[idx]->nm);
+       // dmn_cmn->nm_fll=(char*)NULL;
+       strcpy(dmn_cmn->nm, dmn_out_vtr[idx]->nm);
+       dmn_cmn->id=dmn_out_vtr[idx]->id;
+       dmn_cmn->NON_HYP_DMN=True;
+       dmn_cmn->is_rec_dmn=dmn_out_vtr[idx]->is_rec_dmn;
+       dmn_cmn->dmn_cnt=dmn_out_vtr[idx]->cnt;
+       dmn_cmn->sz=dmn_out_vtr[idx]->cnt;
+
+       dmn_cmn_vtr.push_back(dmn_cmn);
+       // wrn_prn("prs_cls::ncap_pop_dmn_cmn",SCS(dmn_cmn->nm));
+     }
+
+   return;
+
+}
+
+/* populate cmn from dmn_cmn_vtr - nb this assumes that cmn array size has already be
+   been allocated */
+void prs_cls::ncap_pop_var_dmn_cmn(var_sct* var, dmn_cmn_sct *cmn){
+
+  int idx;
+  int fdx;
+  int nbr_dim;
+
+  nbr_dim=var->nbr_dim;
+
+  for(idx=0;idx<nbr_dim;idx++)
+    /* nb this search should ALLWAYS succeed */
+    if( (fdx=dmn_cmn_vtr.findi(var->dim[idx]->nm)) >=0 )
+      cmn[idx]=*dmn_cmn_vtr[fdx];
+    else
+      (void)err_prn("prs_cls::ncap_pop_var_dmn_cmn", "could not find "+ SCS(var->dim[idx]->nm)+ " in dmn_cmn_vtr\n" );
+
+   return;
+
+}
+
+
 int prs_cls::ncap_get_cnk_sz(var_sct *var){
 
   nco_bool shp_chk=False;
diff --git a/src/nco++/prs_cls.hh b/src/nco++/prs_cls.hh
index aecb9b5..75e1a48 100644
--- a/src/nco++/prs_cls.hh
+++ b/src/nco++/prs_cls.hh
@@ -30,7 +30,8 @@ class fmc_cls;
   int out_id_readonly; /* [id] Output data file ID -Handle for reading only */
   NcapVector<dmn_sct*> &dmn_in_vtr;        //Vector of dimensions in input file nb doesn't change
   NcapVector<dmn_sct*> &dmn_out_vtr;       //Vector of dimensions in output file file
-  std::vector<fmc_cls> &fmc_vtr;         //List of functions/methods nb doesn't change 
+  NcapVector<dmn_cmn_sct*> dmn_cmn_vtr;    // Vector of dmn_cmn -updated regularly from dmn_ot_vtr
+  std::vector<fmc_cls> &fmc_vtr;           //List of functions/methods nb doesn't change
   NcapVarVector &var_vtr;                  // list of attributes & variables
   NcapVarVector &int_vtr;                // stores vars/atts in FIRST PARSE
   NcapVarVector thr_vtr;                 // Temp store for atts in a parallel run  
@@ -42,7 +43,7 @@ class fmc_cls;
   bool NCAP_MPI_SORT;                    // sort exressions after second parse for MPI optimization
   bool NCAP4_FILL;                       //if true Ouptut file is netcdf4 & missing value="_FillValue"
   bool FLG_CLL_MTH;                      // if true then add @cell_methods attribute to var for an agg_cls operation
-  size_t *cnk_sz; /* [nbr] Chunk sizes */
+  cnk_sct *cnk_in; /* [nbr] Chunk sizes */
   int dfl_lvl; /* [enm] Deflate level */
 
   // Constructor
@@ -66,6 +67,7 @@ class fmc_cls;
          var_vtr(prs_cpy.var_vtr),            
          int_vtr(prs_cpy.int_vtr) {       
 
+     dmn_cmn_vtr=prs_cpy.dmn_cmn_vtr;
      thr_vtr=prs_cpy.thr_vtr;  
      fl_in=prs_cpy.fl_in;
      in_id=prs_cpy.in_id;
@@ -82,7 +84,7 @@ class fmc_cls;
      NCAP4_FILL=prs_cpy.NCAP4_FILL;
      FLG_CLL_MTH=prs_cpy.FLG_CLL_MTH;
      dfl_lvl=prs_cpy.dfl_lvl;
-     cnk_sz=prs_cpy.cnk_sz;     
+     cnk_in=prs_cpy.cnk_in;
    }
 
    // = operator
@@ -118,7 +120,7 @@ class fmc_cls;
      NCAP4_FILL=prs_cpy.NCAP4_FILL;
      FLG_CLL_MTH=prs_cpy.FLG_CLL_MTH;
      dfl_lvl=prs_cpy.dfl_lvl;      
-
+     cnk_in=prs_cpy.cnk_in;
      return *this;
    }
 
@@ -161,6 +163,11 @@ int
 ncap_get_cnk_sz(
 var_sct *var);
 
+     void
+     ncap_pop_dmn_cmn(void);
+
+     void
+     ncap_pop_var_dmn_cmn(var_sct* var, dmn_cmn_sct *cmn);
 
  };
 
diff --git a/src/nco/Makefile.in b/src/nco/Makefile.in
index 5df0835..99c2017 100644
--- a/src/nco/Makefile.in
+++ b/src/nco/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/src/nco/ncap_lex.l b/src/nco/ncap_lex.l
index d0edc45..be48e5e 100644
--- a/src/nco/ncap_lex.l
+++ b/src/nco/ncap_lex.l
@@ -101,7 +101,8 @@
   /* 20150115: MacOSX with clang and --enable-debug-custom fails on yyget_leng() prototype
      Change return type of yyget_leng() from int to yy_size_t */
   /* int yyget_leng(void); *//* fixes: warning: no previous prototype for `yyget_leng' */
-  /* 20161116: Debian (e.g., glace) NCO build fails in ncap_lex.l due to conflicting types for `yyget_leng' */
+  /* 20161116: Debian (e.g., glace) NCO build fails in ncap_lex.l due to conflicting types for `yyget_leng'. Debian wants yy_size_t yyget_leng(void); */
+  /* 20170804: Fedora (e.g., skyglow) NCO build fails in ncap_lex.l due to conflicting types for `yyget_leng'. Fedora wants int yyget_leng(void); */
   yy_size_t yyget_leng(void); /* fixes: warning: no previous prototype for `yyget_leng' */
   int yyget_lineno(void); /* fixes: warning: no previous prototype for `yyget_lineno' */
   int yylex_destroy(void); /* fixes: warning: no previous prototype for `yylex_destroy' */
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index e08ba58..d006560 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -191,6 +191,7 @@ main(int argc,char **argv)
   int dfl_lvl=NCO_DFL_LVL_UNDEFINED; /* [enm] Deflate level */
   int dmn_nbr_fl;
   int dmn_rec_fl;
+  int dt_fmt=fmt_dt_sht;
   int fl_in_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Input file format */
   int fl_nbr=0;
   int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
@@ -390,6 +391,8 @@ main(int argc,char **argv)
     {"chunk_policy",required_argument,0,0}, /* [nbr] Chunking policy */
     {"cnk_scl",required_argument,0,0}, /* [nbr] Chunk size scalar */
     {"chunk_scalar",required_argument,0,0}, /* [nbr] Chunk size scalar */
+    {"dt_fmt",required_argument,0,0}, /* [enm] Date format for CDL output with --cal */
+    {"date_format",required_argument,0,0}, /* [enm] Date format for CDL output with --cal */
     {"fl_fmt",required_argument,0,0},
     {"file_format",required_argument,0,0},
     {"fix_rec_dmn",required_argument,0,0}, /* [sng] Fix record dimension */
@@ -418,7 +421,7 @@ main(int argc,char **argv)
     {"map_file",required_argument,0,0}, /* [sng] File containing mapping weights from source to destination grid */
     {"rgr_var",required_argument,0,0}, /* I [sng] Variable for special regridding treatment */
     {"rgr_rnr",required_argument,0,0}, /* [flg] Renormalize destination values by valid area */
-    {"rnr",required_argument,0,0}, /* [flg] Renormalize destination values by valid area */
+    {"rnr_thr",required_argument,0,0}, /* [flg] Renormalize destination values by valid area */
     {"renormalize",required_argument,0,0}, /* [flg] Renormalize destination values by valid area */
     {"trr",required_argument,0,0}, /* [sng] Terraref */
     {"terraref",required_argument,0,0}, /* [sng] Terraref */
@@ -555,6 +558,11 @@ main(int argc,char **argv)
         if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
       } /* endif bfr_sz */
       if(!strcmp(opt_crr,"calendar") || !strcmp(opt_crr,"cln_lgb") || !strcmp(opt_crr,"prn_cln_lgb") || !strcmp(opt_crr,"prn_lgb") || !strcmp(opt_crr,"timestamp")) PRN_CLN_LGB=True; /* [flg] Print UDUnits-formatted calendar dates/times human-legibly */
+      if(!strcmp(opt_crr,"dt_fmt") || !strcmp(opt_crr,"date_format")){
+        dt_fmt=strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
+	PRN_CLN_LGB=True;
+	PRN_CDL=True;
+      } /* !dt_fmt */
       if(!strcmp(opt_crr,"cnk_byt") || !strcmp(opt_crr,"chunk_byte")){
         cnk_sz_byt=strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
         if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
@@ -675,7 +683,7 @@ main(int argc,char **argv)
         flg_rgr=True;
 	rgr_map=(char *)strdup(optarg);
       } /* endif rgr_map */
-      if(!strcmp(opt_crr,"rnr") || !strcmp(opt_crr,"rgr_rnr") || !strcmp(opt_crr,"renormalize")){
+      if(!strcmp(opt_crr,"rnr_thr") || !strcmp(opt_crr,"rgr_rnr") || !strcmp(opt_crr,"renormalize")){
         wgt_vld_thr=strtod(optarg,&sng_cnv_rcd);
         if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtod",sng_cnv_rcd);
       } /* endif rgr_rnr */
@@ -1218,6 +1226,7 @@ main(int argc,char **argv)
     if(nco_dbg_lvl >= nco_dbg_scl) prn_flg.fll_pth=True; else prn_flg.fll_pth=False;
     if(prn_flg.xml) prn_flg.nwl_pst_val=False; else prn_flg.nwl_pst_val=True;
     prn_flg.dlm_sng=dlm_sng;
+    prn_flg.cdl_fmt_dt=dt_fmt;
     prn_flg.ALPHA_BY_FULL_GROUP=ALPHA_BY_FULL_GROUP;
     prn_flg.ALPHA_BY_STUB_GROUP=ALPHA_BY_STUB_GROUP;
     prn_flg.FORTRAN_IDX_CNV=FORTRAN_IDX_CNV;
diff --git a/src/nco/nco.h b/src/nco/nco.h
index b170456..71c1512 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -339,7 +339,7 @@ extern "C" {
 # define NCO_VERSION_MINOR 6
 #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., "beta37") for pre-release versions */
@@ -349,7 +349,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 "4.6.7"
+# define NCO_VERSION "4.6.8"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -781,7 +781,14 @@ extern "C" {
     cln_366, /* Leap year Calendar */ 
     cln_nil /* No calendar found */
   } nco_cln_typ; /* [enm] Calendar type */
-  
+
+  typedef enum { /* [enm] Date format */
+    fmt_dt_nil=0, /* None specified */
+    fmt_dt_sht, /* Shortest string possible */
+    fmt_dt_rgl, /* All date and time fields */
+    fmt_dt_iso8601, /* Include ISO 8601 'T' separator between date and time */
+  } nco_fmt_dt;
+
   /* Limit structure */
   typedef struct { /* lmt_sct */
     char *nm; /* [sng] Dimension name */
@@ -957,7 +964,8 @@ extern "C" {
     nco_bool new_fmt; /* [flg] Print in new format */
     nco_bool nwl_pst_val; /* [flg] Print newline after variable values */
     int fll_pth; /* [nbr] Print full paths */
-    int jsn_att_fmt; /* [enm] JSON format for netCDF attributes: 0 (no object, only data), 1 (data only for string, char, int, and floating-point types, otherwise object), 2 (always object) */ 
+    int cdl_fmt_dt; /* [enm] CDL date-stamp format specifier */ 
+    int jsn_att_fmt; /* [enm] JSON format for netCDF attributes: 0 (no object, only data), 1 (data only for string, char, int, and floating-point types, otherwise object), 2 (always object) */
     int jsn_data_brk; /* [flg] JSON format for netCDF variables: 0 (no bracketing of var data ), 1 ( bracketing of var data )*/
     int nbr_zro; /* [nbr] Trailing zeros allowed after decimal point */
     int ndn; /* [nbr] Indentation */
diff --git a/src/nco/nco_att_utl.c b/src/nco/nco_att_utl.c
index 91a2f52..36dd8cf 100644
--- a/src/nco/nco_att_utl.c
+++ b/src/nco/nco_att_utl.c
@@ -808,7 +808,7 @@ nco_att_cpy  /* [fnc] Copy attributes from input netCDF file to output netCDF fi
 
       if(!flg_autoconvert){
 	/* Do not convert global attributes or PCK_ATT_CPY */  
-	if(PCK_ATT_CPY || var_out_id==NC_GLOBAL) att_typ_out=att_typ_in; else (void)nco_inq_vartype(out_id,var_out_id,&att_typ_out);
+	if(PCK_ATT_CPY || var_out_id == NC_GLOBAL) att_typ_out=att_typ_in; else (void)nco_inq_vartype(out_id,var_out_id,&att_typ_out);
       } /* flg_autoconvert */
 
       if(att_typ_out == att_typ_in){
diff --git a/src/nco/nco_cln_utl.c b/src/nco/nco_cln_utl.c
index 9bff06b..64130df 100644
--- a/src/nco/nco_cln_utl.c
+++ b/src/nco/nco_cln_utl.c
@@ -14,7 +14,7 @@
 /* Arrays to hold calendar type units */
 /* Format: year, month, day, hour, minute, second, origin, offset */
 /* origin for all calendars is 2001-01-01 (seconds)  (same as origin for udunits xalendar) */
-static  double DATA_360[8]={31104000.0,2592000.0,86400.0,3600.0,60.0,1.0,31104000.0*2001.0,0.0};
+static double DATA_360[8]={31104000.0,2592000.0,86400.0,3600.0,60.0,1.0,31104000.0*2001.0,0.0};
 static double DATA_365[8]={31536000.0,2628000.0,86400.0,3600.0,60.0,1.0,31536000.0*2001.0,0.0};
 static double DATA_366[8]={31622400.0,2635200.0,86400.0,3600.0,60.0,1.0,63276422400.0,0.0};
 
@@ -168,9 +168,9 @@ nco_cln_get_tm_typ /* Returns time unit type or tm_void if not found */
 
 
 char *                 /* O [sng] contains newly malloced output string */
-nco_cln_fmt_tm         /*   [fnc] format an output string */
+nco_cln_fmt_dt         /*   [fnc] format an output string */
 (tm_cln_sct *ttx,      /* I [ptr] Calendar structure */
-int ifmt)              /* I [int] format type */
+int ifmt)              /* I [enm] nco_fmt_dt */
 {
  char bdate[200]={0};
  char btime[200]={0};
@@ -181,12 +181,19 @@ int ifmt)              /* I [int] format type */
  switch(ifmt)
  {
     /* plain format all out */
-    case 1:
+    case fmt_dt_rgl:
      sprintf(buff,"%04d-%02d-%02d %02d:%02d:%f", ttx->year,ttx->month, ttx->day,ttx->hour,ttx->min,ttx->sec  );
      break;
 
-    /* do date and time if time not all zero */
-    case 2:
+
+     /* plain format all out with 'T' char as spacer*/
+   case fmt_dt_iso8601:
+     sprintf(buff,"%04d-%02d-%02dT%02d:%02d:%f", ttx->year,ttx->month, ttx->day,ttx->hour,ttx->min,ttx->sec  );
+     break;
+
+     /* do date and time if time not all zero */
+    case fmt_dt_sht:
+    case fmt_dt_nil:
       sprintf(bdate,"%04d-%02d-%02d", ttx->year,ttx->month, ttx->day);
       if( ttx->hour !=0 || ttx->min!=0 || ttx->sec !=0.0 )
       {
@@ -203,7 +210,6 @@ int ifmt)              /* I [int] format type */
       }
       sprintf(buff,"%s%s", bdate,btime);
       break;
-
  }
 
    return buff;
@@ -488,10 +494,10 @@ nco_cln_clc_dbl_var_dff( /* [fnc] difference between two co-ordinate units */
 const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
 const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
 nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *val_dbl,           /* I/O [dbl] var values modified */
+double *val_dbl,         /* I/O [dbl] var values modified */
 var_sct *var)           /* I/O [var_sct] var values modified */
 {
-  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to convert values from \"%s\" to \"%s\". See http://nco.sf.net/nco.html#rbs for more information.\n%s: HINT Re-build or re-install NCO enabled with UDUnits.\n", nco_prg_nm_get(),fl_unt_sng,fl_bs_sng);
+  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to convert values from \"%s\" to \"%s\". See http://nco.sf.net/nco.html#rbs for more information.\n%s: HINT Re-build or re-install NCO enabled with UDUnits.\n",nco_prg_nm_get(),fl_unt_sng,fl_bs_sng,nco_prg_nm_get());
 
   return NCO_NOERR;
 } /* end nco_cln_clc_dbl_var_dff() */
@@ -504,7 +510,7 @@ nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */
 double *og_val)         /* O [dbl] output value */
 {
   *og_val=0.0; /* CEWI */
-  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to interpret the string \"%s\" limit argument. HINT Re-build or re-install NCO enabled with UDUnits.\n", nco_prg_nm_get(),val_unt_sng);
+  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to interpret the string \"%s\" limit argument.\n%s: HINT Re-build or re-install NCO enabled with UDUnits.\n",nco_prg_nm_get(),val_unt_sng,nco_prg_nm_get());
   return NCO_NOERR; 
 } /* !nco_cln_clc_dbl_org() */
 
@@ -1130,7 +1136,7 @@ nco_cln_var_prs
       else
         (void) ut_decode_time(tm.value, &tm.year, &tm.month, &tm.day, &tm.hour, &tm.min, &tm.sec, &resolution);
 
-      var_ret->val.sngp[idx] = nco_cln_fmt_tm(&tm, ifmt);
+      var_ret->val.sngp[idx] = nco_cln_fmt_dt(&tm, ifmt);
 
     }
   }
@@ -1155,7 +1161,7 @@ nco_cln_var_prs
       else
         (void) ut_decode_time(tm.value, &tm.year, &tm.month, &tm.day, &tm.hour, &tm.min, &tm.sec, &resolution);
 
-      var_ret->val.sngp[idx] = nco_cln_fmt_tm(&tm, ifmt);
+      var_ret->val.sngp[idx] = nco_cln_fmt_dt(&tm, ifmt);
 
     }
 
diff --git a/src/nco/nco_cln_utl.h b/src/nco/nco_cln_utl.h
index 9a0a947..9d08103 100644
--- a/src/nco/nco_cln_utl.h
+++ b/src/nco/nco_cln_utl.h
@@ -115,7 +115,7 @@ extern "C" {
   (tm_cln_sct *cln_sct); /* I [ptr] Calendar structure */
 
   char*                    /* O [sng] contains newly malloced output string */
-  nco_cln_fmt_tm           /*   [fnc] format an output string */
+  nco_cln_fmt_dt           /*   [fnc] format an output string */
   (tm_cln_sct *cln_sct,   /* I [ptr] Calendar structure */
    int fmt);              /* I [int] format type */
 
diff --git a/src/nco/nco_cnk.c b/src/nco/nco_cnk.c
index 6c972a6..25a7037 100644
--- a/src/nco/nco_cnk.c
+++ b/src/nco/nco_cnk.c
@@ -43,6 +43,7 @@
    http://www.unidata.ucar.edu/software/netcdf/docs_rc/default_chunking_4_1.html */
 
 #include "nco_cnk.h" /* Chunking */
+#include "nco.h"
 
 const char * /* O [sng] Chunking map string */
 nco_cnk_map_sng_get /* [fnc] Convert chunking map enum to string */
@@ -964,7 +965,8 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
 
   /* Obtain variable ID */
   (void)nco_inq_varid(grp_id_out,var_nm,&var_id_out);
-  (void)nco_inq_varid(grp_id_in,var_nm,&var_id_in);
+  if(nco_inq_varid_flg(grp_id_in,var_nm,&var_id_in) !=NC_NOERR)
+    var_id_in=-1;
 
   /* Get type and number of dimensions for variable */
   (void)nco_inq_var(grp_id_out,var_id_out,(char *)NULL,&var_typ_dsk,&dmn_nbr,(int *)NULL,(int *)NULL);
@@ -996,7 +998,10 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
   if(is_rec_var || is_chk_var || is_cmp_var) must_be_chunked=True; else must_be_chunked=False;
 
   /* Is variable currently chunked? */
-  if(nco_fmt_xtn_get() != nco_fmt_xtn_hdf4 || NC_LIB_VERSION >= 433) is_chunked=nco_cnk_dsk_inq(grp_id_in,var_id_in);
+  if( var_id_in>=0 &&  (nco_fmt_xtn_get() != nco_fmt_xtn_hdf4 || NC_LIB_VERSION >= 433))
+    is_chunked=nco_cnk_dsk_inq(grp_id_in,var_id_in);
+  else
+    is_chunked=False;
 
   /* Does variable have any user-chunked dimensions? */
   for(dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
@@ -1093,7 +1098,7 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
 	} /* end loop over dmn_idx_in */
 	if(dmn_idx_in == dmn_nbr_in){
 	  /* Output file dimension not found in input file */
-	  assert(nco_prg_id_get() == ncecat);
+	  assert(nco_prg_id_get() == ncecat || nco_prg_id_get() == ncap );
 	  if(dmn_cmn[dmn_idx].NON_HYP_DMN){
 	    if(dmn_cmn[dmn_idx].sz == 0) cnk_sz[dmn_idx]=1UL; else cnk_sz[dmn_idx]=dmn_cmn[dmn_idx].sz;
 	  }else{ /* !NON_HYP_DMN */
@@ -1129,9 +1134,9 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
 
   /* Set "reasonable" defaults */
   for(dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
-
     /* Is this a record dimension? */
     if(dmn_cmn[dmn_idx].is_rec_dmn){
+
       /* Does policy specify record dimension treatment? */
       if(cnk_map == nco_cnk_map_rd1){
         cnk_sz[dmn_idx]=1UL;
@@ -1143,12 +1148,13 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
       if(dmn_cmn[dmn_idx].NON_HYP_DMN){
         /* When not hyperslabbed, use input record dimension size, except workaround zero size
 	   reported for new record dimensions before anything is written */
-	if(dmn_cmn[dmn_idx].sz == 0) cnk_sz[dmn_idx]=1UL; else cnk_sz[dmn_idx]=dmn_cmn[dmn_idx].sz;
+	if(dmn_cmn[dmn_idx].sz == 0L) cnk_sz[dmn_idx]=1UL; else cnk_sz[dmn_idx]=dmn_cmn[dmn_idx].sz;
 	/* 20140518: As of netCDF 4.3.2, employ smarter defaults for record dimension in 1-D variables
 	   20150505: This "smarter" treatment of 1-D record variables consistently leads to cnk_sz ~ 512k
 	   This seems ridiculously large since many datasets have O(1) time slices but many 1-D in time variables
 	   Perhaps lose this 1-D exception that scales chunksize with blocksize? */
-	if(dmn_nbr == 1) cnk_sz[dmn_idx]=NCO_CNK_SZ_BYT_R1D_DFL/typ_sz;
+
+	if(dmn_nbr ==1 ) cnk_sz[dmn_idx]=NCO_CNK_SZ_BYT_R1D_DFL/typ_sz;
       }else{ /* !NON_HYP_DMN */
         /* ... and when hyperslabbed, use user-specified count */
         cnk_sz[dmn_idx]=dmn_cmn[dmn_idx].dmn_cnt;
@@ -1428,14 +1434,25 @@ nco_cnk_sz_set_trv /* [fnc] Set chunksize parameters (GTT version of nco_cnk_sz_
      Loop below implements similar final safety check for ALL dimensions and ALL chunking maps
      Check trims fixed (not record) dimension chunksize to never be larger than dimension size */
   for(dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
-    if(cnk_sz[dmn_idx] > (size_t)dmn_cmn[dmn_idx].sz){
-      if(!dmn_cmn[dmn_idx].is_rec_dmn){
-        /* Unlike record dimensions, non-record dimensions must have cnk_sz <= dmn_sz */
+    if(cnk_sz[dmn_idx] > (size_t)dmn_cmn[dmn_idx].sz) {
+      if (dmn_cmn[dmn_idx].is_rec_dmn){
+         /* rec dmn size 0 then we can apply any cnk_sz - else cnk_sz <= dmn_sz */
+        long lcl_dmn_sz=0ll;
+        if( nco_inq_dim_flg(grp_id_out, dmn_cmn[dmn_idx].id, (char*)NULL, &lcl_dmn_sz)==NC_NOERR && lcl_dmn_sz>0)
+          cnk_sz[dmn_idx]=(size_t)dmn_cmn[dmn_idx].sz;
+
+      }else{
+        /* non-record dimensions must have cnk_sz <= dmn_sz */
         if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stderr,"%s: INFO %s final check trimming chunksize of \"%s\" dimension from %lu to %lu\n",nco_prg_nm_get(),fnc_nm,dmn_cmn[dmn_idx].nm,(unsigned long)cnk_sz[dmn_idx],(unsigned long)dmn_cmn[dmn_idx].sz);
         /* Trim else out-of-bounds sizes will fail in HDF library in nc_enddef() */
         cnk_sz[dmn_idx]=(size_t)dmn_cmn[dmn_idx].sz;
       } /* rcd_dmn_id */
     } /* end if */
+    /* 20170610: TODO nco1137 bug ncwa chunking fails with --rdd reported by Joy 20170605 because dmn_cmn[] contains zero for some dimensions */
+    if(cnk_sz[dmn_idx] == 0L){
+      if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stderr,"%s: INFO %s final check manually overriding chunksize of \"%s\" dimension from 0L to 1L as workaround to TODO nco1137: bad interaction of chunking with --rdd\n",nco_prg_nm_get(),fnc_nm,dmn_cmn[dmn_idx].nm);
+      cnk_sz[dmn_idx]=1L;
+    } /* end cnk_sz */
   } /* end loop over dmn */
 
   if(nco_dbg_lvl_get() >= nco_dbg_var && nco_dbg_lvl_get() != nco_dbg_dev){
diff --git a/src/nco/nco_cnv_csm.c b/src/nco/nco_cnv_csm.c
index 29fd2dd..3c23b02 100644
--- a/src/nco/nco_cnv_csm.c
+++ b/src/nco/nco_cnv_csm.c
@@ -389,6 +389,7 @@ nco_cnv_cf_cll_mth_add               /* [fnc] Add cell_methods attributes */
     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 */
+    case nco_op_tabs: strcpy(att_op_sng,"sum absolute_value"); break; /* sum  absolute value */
     case nco_op_sqravg: strcpy(att_op_sng,"square_of_mean"); break; /* Square of mean */
     case nco_op_sqrt: strcpy(att_op_sng,"square_root_of_mean"); break; /* Square root of mean */ 
     case nco_op_rms: strcpy(att_op_sng,"root_mean_square"); break; /* Root-mean-square (normalized by N) */
@@ -559,6 +560,7 @@ nco_rdc_sng_to_op_typ /* [fnc] Convert operation string to integer */
   if(!strcmp(att_op_sng,"mabs")) return nco_op_mabs;
   if(!strcmp(att_op_sng,"mebs")) return nco_op_mebs;
   if(!strcmp(att_op_sng,"mibs")) return nco_op_mibs;
+  if(!strcmp(att_op_sng,"tabs")) return nco_op_tabs;
   if(!strcmp(att_op_sng,"mean")) return nco_op_avg;
   if(!strcmp(att_op_sng,"minimum")) return nco_op_min;
   if(!strcmp(att_op_sng,"maximum")) return nco_op_max;
@@ -581,6 +583,7 @@ nco_op_typ_to_rdc_sng /* [fnc] Convert operation type to string */
   case nco_op_mabs: return "mabs";
   case nco_op_mebs: return "mebs";
   case nco_op_mibs: return "mibs";
+  case nco_op_tabs: return "tabs";
   case nco_op_min: return "minimum";
   case nco_op_max: return "maximum";
   case nco_op_ttl: return "sum";
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index b1c6eb2..32801ae 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -551,6 +551,10 @@ nco_exit_lbr_rcd(void) /* [fnc] Exit with netCDF library version as return code
   /* NB: Same return values for 4.3.3 and 4.3.3.1. Few people installed 4.3.3, most installed 4.3.3.1. */
   else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '3' && lbr_sng[3] == '.' && lbr_sng[4] == '3' ){rcd=433;}
   else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '4' && lbr_sng[3] == '.' && lbr_sng[4] == '0' ){rcd=440;}
+  /* NB: Same return values for 4.4.1 and 4.4.1.1, which simply fixes an ncgen bug in 4.4.1. */
+  else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '4' && lbr_sng[3] == '.' && lbr_sng[4] == '1' ){rcd=441;}
+  else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '5' && lbr_sng[3] == '.' && lbr_sng[4] == '0' ){rcd=450;}
+  else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '5' && lbr_sng[3] == '.' && lbr_sng[4] == '1' ){rcd=451;}
 #endif /* HAVE_NETCDF4_H */
   /* exit() with custom rcd for use by Perl regression tester nco_bm.pl/NCO_rgr.pm */
   rcd-=300;
@@ -689,7 +693,8 @@ nco_lbr_vrs_prn(void) /* [fnc] Print netCDF library version */
      netCDF 3.4--3.6.x: "3.4 of May 16 1998 14:06:16 $"
      netCDF 4.0-alpha1--4.0-alpha10: NULL
      netCDF 4.0-alpha11--4.0-alpha16: "4.0-alpha11"
-     netCDF 4.0-beta1--present: "4.0-beta1" */  
+     netCDF 4.0-beta1--4.4: "4.0-beta1"
+     netCDF 4.4--present: "4.5.0-development" */  
   lbr_sng=(char *)strdup(nc_inq_libvers());
   /* (void)fprintf(stderr,"%s: nco_lbr_vrs_prn() returns %s\n",nco_prg_nm_get(),lbr_sng);*/
   of_ptr=strstr(lbr_sng," of ");
@@ -844,7 +849,7 @@ nco_nmn_get(void) /* [fnc] Return mnemonic that describes current NCO version */
 { 
   /* Purpose: Return mnemonic describing current NCO version
      Always include terminal \n so mnemonic does not dangle */
-  return "Shots and power tools\n";
+  return "Ofcharles\n";
 } /* end nco_nmn_get() */
 
 char * /* O [sng] nm_in stripped of any path (i.e., program name stub) */ 
@@ -967,7 +972,7 @@ nco_usg_prn(void)
     opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_csh byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_crd] [--fl_fmt fmt] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-i var,val] [-L lvl] [-l path] [--msa] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-v ...] [-X box] [-x] [-w wgt_1[,wgt [...]
     break;
   case ncks:
-    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr byt] [-C] [-c] [--cal] [--cdl] [--cnk_byt byt] [--cnk_csh byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [--jsn] [--jsn_fmt lvl] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim]  [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr byt] [-C] [-c] [--cal] [--cdl] [--cnk_byt byt] [--cnk_csh byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [--dt_fmt fmt] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [--jsn] [--jsn_fmt lvl] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--m [...]
     break;
   case ncpdq:
     opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a ...] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_csh byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [-M pck_map] [--mrd] [--msa] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-P pck_plc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [ [...]
@@ -1031,7 +1036,7 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"[-C]")) (void)fprintf(stdout,"-C, --nocoords\t\tAssociated coordinate variables should not be processed\n");
   if(strstr(opt_sng,"[-c]")) (void)fprintf(stdout,"-c, --crd, --coords\tCoordinate variables will all be processed\n");
   if(strstr(opt_sng,"--cb")) (void)fprintf(stdout,"    --cb, --clm_bnd\tCF Climatology bounds will be processed (see also --c2b)\n");
-  if(strstr(opt_sng,"--cal")) (void)fprintf(stdout,"    --cal\t\tPrint UDUnits-compatible dates/times in human-legible calendar format\n");
+  if(strstr(opt_sng,"--cal")) (void)fprintf(stdout,"    --cal,--cln\tPrint UDUnits-compatible dates/times in human-legible calendar format\n");
   if(strstr(opt_sng,"--cdl")) (void)fprintf(stdout,"    --cdl\t\tPrint CDL (netCDF lingua franca used by ncdump/ncgen)\n");
   if(strstr(opt_sng,"--cnk_byt")) (void)fprintf(stdout,"    --cnk_byt, --chunk_byte sz_byt\tChunksize in bytes\n");
   if(strstr(opt_sng,"--cnk_csh")) (void)fprintf(stdout,"    --cnk_csh, --chunk_cache sz_byt\tChunk cache size in bytes\n");
@@ -1047,6 +1052,7 @@ nco_usg_prn(void)
     else (void)fprintf(stdout,"-d, --dmn, --dimension dim,[min][,[max]][,[stride]] Dimension's limits and stride in hyperslab\n");
   } /* end if -d */
   if(strstr(opt_sng,"--dbl|flt")) (void)fprintf(stdout,"    --dbl, --flt, --rth_dbl|flt\tdbl: Always promote single- to double-precision b4 arithmetic (default). flt: OK with single-precision arithmetic.\n");
+  if(strstr(opt_sng,"--dt_fmt")) (void)fprintf(stdout,"    --dt_fmt,--date_format\tPrint UDUnits-compatible dates/times in short, regular, or ISO8601 calendar format (fmt=1,2,3)\n");
   if(strstr(opt_sng,"[-F]")) (void)fprintf(stdout,"-F, --ftn, --fortran\tFortran indexing conventions (1-based) for I/O\n");
   if(strstr(opt_sng,"[-f]")) (void)fprintf(stdout,"-f, --fnc_tbl, --prn_fnc_tbl\tPrint function table\n");
   if(strstr(opt_sng,"--fix_rec_crd")) (void)fprintf(stdout,"    --fix_rec_crd\tDo not interpolate/multiply record coordinate variables\n");
@@ -1129,8 +1135,8 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"--rad")) (void)fprintf(stdout,"    --orphan, --rph_dmn\tRetain or print all (including orphaned) dimensions\n");
   if(strstr(opt_sng,"--ram_all")) (void)fprintf(stdout,"    --ram_all, --diskless_all\tOpen netCDF3 files and create output files in RAM\n");
   if(strstr(opt_sng,"--rec_apn")) (void)fprintf(stdout,"    --rec_apn, --record_append\tAppend records directly to output file\n");
-  if(strstr(opt_sng,"--rgr")) (void)fprintf(stdout,"    --rgr key=value\t\tSee http://nco.sf.net/nco.html#regrid for valid keys\n");
-  if(strstr(opt_sng,"--rnr")) (void)fprintf(stdout,"    --rnr=wgt, --renormalize\t\tWeight threshold for valid destination value\n");
+  if(strstr(opt_sng,"--rgr")) (void)fprintf(stdout,"    --rgr key=value\tSee http://nco.sf.net/nco.html#regrid for valid keys\n");
+  if(strstr(opt_sng,"--rnr")) (void)fprintf(stdout,"    --rnr_thr=wgt \tCoverage threshold to renormalize valid destination value\n");
   // if(strstr(opt_sng,"--rgr_grd_dst")) (void)fprintf(stdout,"    --rgr_grd_dst file\tDestination grid\n");
   // if(strstr(opt_sng,"--rgr_grd_src")) (void)fprintf(stdout,"    --rgr_grd_src file\tSource grid\n");
   // if(strstr(opt_sng,"--rgr_in")) (void)fprintf(stdout,"    --rgr_in file\tFile containing fields to be regridded\n");
diff --git a/src/nco/nco_fl_utl.c b/src/nco/nco_fl_utl.c
index 1dc31a4..697dff5 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -84,7 +84,7 @@ nco_create_mode_prs /* [fnc] Parse user-specified file format */
     if(NC_LIB_VERSION >= 440){
       *fl_fmt_enm=NC_FORMAT_CDF5;
     }else{
-      (void)fprintf(stderr,"%s: ERROR This NCO was not built with PnetCDF (http://trac.mcs.anl.gov/projects/parallel-netcdf) capabilities and cannot create the requested PnetCDF file format. PnetCDF was introduced in the base netCDF library in version 4.4.0 in January, 2016. HINT: Re-try with requisite library version or select a supported file format such as \"classic\" or \"64bit_offset\".\n",nco_prg_nm_get());
+      (void)fprintf(stderr,"%s: ERROR This NCO was not built with PnetCDF (aka CDF5, http://trac.mcs.anl.gov/projects/parallel-netcdf) capabilities and cannot create the requested PnetCDF file format. PnetCDF (CDF5) was introduced in the base netCDF library in version 4.4.0 in January, 2016. HINT: Re-try with requisite library version or select a supported file format such as \"classic\" or \"64bit_offset\".\n",nco_prg_nm_get());
     } /* !NC_LIB_VERSION */
   }else{
     (void)fprintf(stderr,"%s: ERROR Unknown output file format \"%s\" requested. Valid formats are (unambiguous leading characters of) \"classic\", \"64bit_offset\",%s \"netcdf4\", and \"netcdf4_classic\".\n",nco_prg_nm_get(),fl_fmt_sng,(NC_LIB_VERSION >= 440) ? "\"64bit_data\"," : "");
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 448a2ba..c11b213 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -3433,6 +3433,11 @@ nco_fll_var_trv                       /* [fnc] Fill-in variable structure list f
       /* Transfer from table to local variable array; nco_var_fll() needs location ID and name */
       var[idx_var]=nco_var_fll_trv(grp_id,var_id,&var_trv,trv_tbl);
 
+      /* Transfer dimensions  */
+      for (int idx_dmn = 0; idx_dmn < var[idx_var]->nbr_dim; idx_dmn++) {
+        var[idx_var]->dim[idx_dmn]->nm_fll = strdup(var_trv.var_dmn[idx_dmn].dmn_nm_fll);
+      }
+
       idx_var++;
 
     } /* Filter variables  */
@@ -6839,7 +6844,7 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
     } /* Is variable to extract  */
   } /* Loop table step 2 */
 
-  /*  Apply MSA for each Dimension in new cycle (that now has all its limits in place) */
+  /*  Apply MSA for each dimension in new cycle (that now has all its limits in place) */
 
   /* Loop table step 3 */
   for(unsigned int idx_tbl=0;idx_tbl<trv_tbl->nbr;idx_tbl++){
@@ -6993,6 +6998,227 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
 
 } /* nco_bld_lmt() */
 
+
+void
+nco_bld_lmt_var                       /* [fnc] Assign user specified dimension limits to one GTT variable */
+(const int nc_id,                     /* I [ID] netCDF file ID */
+  nco_bool MSA_USR_RDR,               /* I [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
+  int lmt_nbr,                        /* I [nbr] Number of user-specified dimension limits */
+  lmt_sct **lmt,                      /* I [sct] Structure comming from nco_lmt_prs() */
+  nco_bool FORTRAN_IDX_CNV,           /* I [flg] Hyperslab indices obey Fortran convention */
+  trv_sct *var_trv)                  /* I/O [sct] GTT variable (used for weight/mask) */
+{
+  /* Purpose: Assign user-specified dimension limits to to one GTT variable
+  Same as nco_bld_lmt(), with 3 step loops, but for one variable, 'var_trv'
+  At this point "lmt" was parsed from nco_lmt_prs(); only the relative names and  min, max, stride are known */
+
+  /* Remove and initialize MSA structures for the dimensions. Members that so require are:
+  lmt_sct **lmt_dmn: list of limit structures associated with each dimension, must be free(d)
+  int lmt_dmn_nbr: number of lmt arguments, must be reset to zero
+  int lmt_crr: index of current limit structure being initialized (helper to initialze lmt_sct*), must be reset to zero
+  Other members of 'lmt_msa_sct' remain the same or are not incremented
+  */
+
+  for (int dmn_idx = 0; dmn_idx < var_trv->nbr_dmn; dmn_idx++) {
+    if (var_trv->var_dmn[dmn_idx].crd) {
+      /* Free first ! */
+      for (int lmt_idx = 0; lmt_idx < var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn_nbr; lmt_idx++) {
+        var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn[lmt_idx] = nco_lmt_free(var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn[lmt_idx]);
+      }
+      var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn = (lmt_sct **)nco_free(var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn);
+      /* Reset after ! */
+      var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_dmn_nbr = 0;
+      var_trv->var_dmn[dmn_idx].crd->lmt_msa.lmt_crr = 0;
+    }
+    else if (var_trv->var_dmn[dmn_idx].ncd) {
+      /* Free first ! */
+      for (int lmt_idx = 0; lmt_idx < var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn_nbr; lmt_idx++) {
+        var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn[lmt_idx] = nco_lmt_free(var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn[lmt_idx]);
+      }
+      var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn = (lmt_sct **)nco_free(var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn);
+      /* Reset after ! */
+      var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_dmn_nbr = 0;
+      var_trv->var_dmn[dmn_idx].ncd->lmt_msa.lmt_crr = 0;
+    }
+  }
+
+  /* Loop step 1, alloc 'lmt_dmn' */
+
+  /* Loop variable dimensions */
+  for (int idx_var_dmn = 0; idx_var_dmn < var_trv->nbr_dmn; idx_var_dmn++) {
+    /* Loop input name list */
+    for (int lmt_idx = 0; lmt_idx < lmt_nbr; lmt_idx++)
+      /* Match input relative name to dimension relative name */
+      if (strcmp(lmt[lmt_idx]->nm, var_trv->var_dmn[idx_var_dmn].dmn_nm) == 0) {
+        /* Coordinate variable structure case */
+        if (var_trv->var_dmn[idx_var_dmn].crd) {
+          /* Increment number of dimension limits for this dimension */
+          var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn_nbr++;
+          int nbr_lmt = var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn_nbr;
+          var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn = (lmt_sct **)nco_realloc(var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn, nbr_lmt * sizeof(lmt_sct *));
+        }
+        else {
+          /* Non coordinate variable structure case */
+          /* Increment number of dimension limits for this dimension */
+          var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn_nbr++;
+          int nbr_lmt = var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn_nbr;
+          var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn = (lmt_sct **)nco_realloc(var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn, nbr_lmt * sizeof(lmt_sct *));
+        }
+      }
+  }
+
+  /* Loop step 2, store matches in table, match at the current index, increment current index */
+
+  /* Loop variable dimensions */
+  for (int idx_var_dmn = 0; idx_var_dmn < var_trv->nbr_dmn; idx_var_dmn++) {
+    /* Loop input name list */
+    for (int lmt_idx = 0; lmt_idx < lmt_nbr; lmt_idx++) {
+      /* Match input relative name to dimension relative name */
+      if (!strcmp(lmt[lmt_idx]->nm, var_trv->var_dmn[idx_var_dmn].dmn_nm)) {
+        /* Coordinate variable structure case */
+        if (var_trv->var_dmn[idx_var_dmn].crd) {
+          crd_sct *crd = var_trv->var_dmn[idx_var_dmn].crd;
+          /* Limit is same as dimension in input file? */
+          var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.NON_HYP_DMN = False;
+          /* Parse user-specified limits into hyperslab specifications. NOTE: Use True parameter and "crd" */
+          (void)nco_lmt_evl_dmn_crd(nc_id, 0L, FORTRAN_IDX_CNV, crd->crd_grp_nm_fll, crd->nm, crd->sz, crd->is_rec_dmn, True, lmt[lmt_idx]);
+          /* Current index (lmt_crr) of dimension limits for this (idx_dmn) table dimension  */
+          int lmt_crr = crd->lmt_msa.lmt_crr;
+          /* Increment current index being initialized  */
+          var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_crr++;
+          /* Allocate this limit */
+          var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn[lmt_crr] = (lmt_sct *)nco_malloc(sizeof(lmt_sct));
+          /* Initialize this entry */
+          (void)nco_lmt_init(var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn[lmt_crr]);
+          /* Store dimension ID */
+          lmt[lmt_idx]->id = crd->dmn_id;
+          /* Store this valid input; deep-copy */
+          (void)nco_lmt_cpy(lmt[lmt_idx], var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn[lmt_crr]);
+        }
+        else {
+          /* Non coordinate variable structure case */
+          dmn_trv_sct *ncd = var_trv->var_dmn[idx_var_dmn].ncd;
+          /* Limit is same as dimension in input file ? */
+          var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.NON_HYP_DMN = False;
+          /* Parse user-specified limits into hyperslab specifications. NOTE: Use False parameter and "dmn" */
+          (void)nco_lmt_evl_dmn_crd(nc_id, 0L, FORTRAN_IDX_CNV, ncd->grp_nm_fll, ncd->nm, ncd->sz, ncd->is_rec_dmn, False, lmt[lmt_idx]);
+          /* Current index (lmt_crr) of dimension limits for this (idx_dmn) table dimension  */
+          int lmt_crr = ncd->lmt_msa.lmt_crr;
+          /* Increment current index being initialized  */
+          var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_crr++;
+          /* Alloc this limit */
+          var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn[lmt_crr] = (lmt_sct *)nco_malloc(sizeof(lmt_sct));
+          /* Initialize this entry */
+          (void)nco_lmt_init(var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn[lmt_crr]);
+          /* Store dimension ID */
+          lmt[lmt_idx]->id = ncd->dmn_id;
+          /* Store this valid input; deep-copy to table */
+          (void)nco_lmt_cpy(lmt[lmt_idx], var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn[lmt_crr]);
+        }
+      }
+    }
+  }
+
+  /* Apply MSA for each dimension in new cycle (that now has all its limits in place) */
+  /* Loop step 3 */
+
+  /* Loop variable dimensions */
+  for (int idx_var_dmn = 0; idx_var_dmn < var_trv->nbr_dmn; idx_var_dmn++) {
+    /* Loop input name list */
+    for (int lmt_idx = 0; lmt_idx < lmt_nbr; lmt_idx++) {
+      /* Match input relative name to dimension relative name */
+      if (strcmp(lmt[lmt_idx]->nm, var_trv->var_dmn[idx_var_dmn].dmn_nm) == 0) {
+        /* Coordinate variable structure case */
+        if (var_trv->var_dmn[idx_var_dmn].crd) {
+          /* Adapted from original MSA loop in nco_msa_lmt_all_ntl(); differences are marked GTT specific */
+          //nco_bool flg_ovl; /* [flg] Limits overlap */
+          crd_sct *crd = var_trv->var_dmn[idx_var_dmn].crd;
+          /* GTT: If this coordinate has no limits, continue */
+          if (crd->lmt_msa.lmt_dmn_nbr == 0) {
+            continue;
+          }
+          /* ncra/ncrcat have only one limit for record dimension so skip evaluation otherwise this messes up multi-file operation */
+          if (crd->is_rec_dmn && (nco_prg_id_get() == ncra || nco_prg_id_get() == ncrcat)) {
+            continue;
+          }
+          /* Split-up wrapped limits. NOTE: using deep copy version nco_msa_wrp_splt_cpy() */
+          (void)nco_msa_wrp_splt_cpy(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+          /* Wrapped hyperslabs are dimensions broken into the "wrong" order, e.g., from
+          -d time,8,2 broken into -d time,8,9 -d time,0,2
+          WRP flag set only when list contains dimensions split as above */
+          if (var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.WRP) {
+            /* Find and store size of output dim */
+            (void)nco_msa_clc_cnt(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+            continue;
+          } /* End WRP flag set */
+            /* Single slab---no analysis needed */
+          if (var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn_nbr == 1) {
+            (void)nco_msa_clc_cnt(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+            continue;
+          } /* End Single slab */
+            /* Does Multi-Slab Algorithm returns hyperslabs in user-specified order? */
+          if (MSA_USR_RDR) {
+            var_trv->var_dmn[idx_var_dmn].crd->lmt_msa.MSA_USR_RDR = True;
+            /* Find and store size of output dimension */
+            (void)nco_msa_clc_cnt(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+            continue;
+          } /* End MSA_USR_RDR */
+            /* Sort limits */
+          (void)nco_msa_qsort_srt(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+          /* Check for overlap */
+          //flg_ovl = nco_msa_ovl(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+          /* Find and store size of output dimension */
+          (void)nco_msa_clc_cnt(&var_trv->var_dmn[idx_var_dmn].crd->lmt_msa);
+        }
+        else {
+          /* Non coordinate variable structure case */
+          dmn_trv_sct *ncd = var_trv->var_dmn[idx_var_dmn].ncd;
+          /* Adapted from the original MSA loop in nco_msa_lmt_all_ntl(); differences are marked GTT specific */
+          nco_bool flg_ovl; /* [flg] Limits overlap */
+                            /* GTT: If this dimension has no limits, continue */
+          if (ncd->lmt_msa.lmt_dmn_nbr == 0) {
+            continue;
+          }
+          /* ncra/ncrcat have only one limit for record dimension so skip evaluation otherwise this messes up multi-file operation */
+          if (ncd->is_rec_dmn && (nco_prg_id_get() == ncra || nco_prg_id_get() == ncrcat)) {
+            continue;
+          }
+          /* Split-up wrapped limits */
+          (void)nco_msa_wrp_splt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+          /* Wrapped hyperslabs are dimensions broken into the "wrong" order,e.g. from
+          -d time,8,2 broken into -d time,8,9 -d time,0,2
+          WRP flag set only when list contains dimensions split as above */
+          if (var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.WRP) {
+            /* Find and store size of output dim */
+            (void)nco_msa_clc_cnt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+            continue;
+          } /* End WRP flag set */
+            /* Single slab---no analysis needed */
+          if (var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn_nbr == 1) {
+            (void)nco_msa_clc_cnt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+            continue;
+          } /* End Single slab */
+            /* Does Multi-Slab Algorithm returns hyperslabs in user-specified order ? */
+          if (MSA_USR_RDR) {
+            var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.MSA_USR_RDR = True;
+            /* Find and store size of output dimension */
+            (void)nco_msa_clc_cnt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+            continue;
+          } /* End MSA_USR_RDR */
+            /* Sort limits */
+          (void)nco_msa_qsort_srt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+          /* Check for overlap */
+          flg_ovl = nco_msa_ovl_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+          if (!flg_ovl) var_trv->var_dmn[idx_var_dmn].ncd->lmt_msa.MSA_USR_RDR = True;
+          /* Find and store size of output dimension */
+          (void)nco_msa_clc_cnt_trv(var_trv->var_dmn[idx_var_dmn].ncd);
+        }
+      }
+    }
+  }
+
+} /* end nco_bld_lmt_var() */
+
 void 
 nco_msa_var_get_rec_trv             /* [fnc] Read a user-defined limit */
 (const int nc_id,                   /* I [ID] netCDF file ID */
@@ -7148,81 +7374,139 @@ nco_skp_var                          /* [fnc] Skip variable while doing record
 
 } /* nco_skp_var() */
 
-var_sct *                           /* O [sct] Variable (weight/mask) */  
-nco_var_get_wgt_trv                 /* [fnc] Retrieve weighting or mask variable */
-(const int nc_id,                   /* I [id] netCDF file ID */
- const char * const wgt_nm,         /* I [sng] Weight variable name (relative or absolute) */
- const var_sct * const var,         /* I [sct] Variable that needs weight/mask */
- const trv_tbl_sct * const trv_tbl) /* I [lst] Traversal table */
+var_sct *                             /* O [sct] Variable (weight or mask) */
+nco_var_get_wgt_trv                   /* [fnc] Retrieve weighting or mask variable */
+(const int nc_id,                     /* I [id] netCDF file ID */
+  const int lmt_nbr,                   /* I [nbr] number of dimensions with limits */
+  CST_X_PTR_CST_PTR_CST_Y(char, lmt_arg), /* I [sng] List of user-specified dimension limits */
+  nco_bool MSA_USR_RDR,                /* I [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
+  nco_bool FORTRAN_IDX_CNV,            /* I [flg] Hyperslab indices obey Fortran convention */
+  const char * const wgt_nm,           /* I [sng] Weight or mask variable name (relative or absolute) */
+  const var_sct * const var,           /* I [sct] Variable that needs weight/mask */
+  const trv_tbl_sct * const trv_tbl)   /* I [lst] Traversal table */
 {
-  /* Purpose: Return weight or mask variable closest in-scope to specified variable */
+  /* Purpose: Return weight or mask variable closest in scope to specified variable */
 
   int grp_id; /* [ID] Group ID */
   int var_id; /* [ID] Variable ID */
   int idx_wgt; /* [nbr] Weight array counter */
-  var_sct *wgt_var;
+  var_sct *wgt_var; /* O [sct] Variable (weight/mask) */
+
+  /* 201707015 pvn nco1138. Detect the cases where
+  a) a variable <var> was requested with -v <var>
+  b) an hyperslab was requested on the dimensions of the variable, with -d <dim>
+  c) a mask <wgt_var> was requested on a variable that is *not* <var> in the -v list
+  The consequence of this case is that <wgt_var> was not hyperslabled in the table traversal
+  Use case:
+  ncwa -O -C -y ttl -v orog2 -d lat,0.,90. -m lat -M 0.0 -T gt ~/nco/data/in.nc ~/foo.nc
+  ncks -H -v orog ~/foo.nc # Correct answer is 4
+  For this case define here the hyperslab for <wgt_var> from the original input
+  user name list 'lmt_arg'
+  This detection uses a new function nco_msa_var_get_sct()
+  that is the same as nco_msa_var_get_trv() but with input 'var_trv' '
+  TODO: Deprecate nco_msa_var_get_trv() and use this new function nco_msa_var_get_sct()
+  because some code is repeated
+  NB: this detection is done below for both cases of absolute and relative weight path
+  */
 
   /* If first character is '/' then weight name is absolute path */
-  if(wgt_nm[0] == '/'){
+  if (wgt_nm[0] == '/') {
     /* Absolute name given for weight. Straightforward extract and copy */
     trv_sct *wgt_trv;
-    wgt_trv=trv_tbl_var_nm_fll(wgt_nm,trv_tbl);
-    (void)nco_inq_grp_full_ncid(nc_id,wgt_trv->grp_nm_fll,&grp_id);
-    (void)nco_inq_varid(grp_id,wgt_trv->nm,&var_id);
-    /* Transfer from table to local variable */
-    wgt_var=nco_var_fll_trv(grp_id,var_id,wgt_trv,trv_tbl);
-    /* Retrieve variable NB: use GTT version, that "knows" all limits */
-    (void)nco_msa_var_get_trv(nc_id,wgt_var,trv_tbl);
+    wgt_trv = trv_tbl_var_nm_fll(wgt_nm, trv_tbl);
+    (void)nco_inq_grp_full_ncid(nc_id, wgt_trv->grp_nm_fll, &grp_id);
+    (void)nco_inq_varid(grp_id, wgt_trv->nm, &var_id);
+    /* Case of input limits, reconstruct limits and hyperslab */
+    if (lmt_nbr) {
+      lmt_sct **lmt = NULL_CEWI;  /* [sct] User defined limits */
+      lmt = nco_lmt_prs(lmt_nbr, lmt_arg);
+      nco_bld_lmt_var(nc_id, MSA_USR_RDR, lmt_nbr, lmt, FORTRAN_IDX_CNV, wgt_trv);
+      /* Transfer from table to local variable */
+      wgt_var = nco_var_fll_trv(grp_id, var_id, wgt_trv, trv_tbl);
+      /* Assign the hyperslab information for a variable 'var_sct'  from the obtained GTT variable */
+      /* Similar to nco_msa_var_get_trv() but just with one input GTT variable */
+      (void)nco_msa_var_get_sct(nc_id, wgt_var, wgt_trv);
+      lmt = nco_lmt_lst_free(lmt, lmt_nbr);
+    }
+    else {
+      /* Transfer from table to local variable */
+      wgt_var = nco_var_fll_trv(grp_id, var_id, wgt_trv, trv_tbl);
+      /* Retrieve variable NB: use GTT version, that "knows" all limits */
+      (void)nco_msa_var_get_trv(nc_id, wgt_var, trv_tbl);
+    }
     return wgt_var;
-  }else{
+  }
+  else {
     /* Relative name given for weight. Must identify most-in-scope match... */
-    int wgt_nbr=0; /* [nbr] Number of weight/mask variables in file */
-    trv_sct **wgt_trv=NULL; /* [sct] Weight/mask list */
+    int wgt_nbr = 0; /* [nbr] Number of weight/mask variables in file */
+    trv_sct **wgt_tbl = NULL; /* [sct] Weight/mask list */
 
     /* Count matching weight names in order to allocate space */
-    for(unsigned tbl_idx=0;tbl_idx<trv_tbl->nbr;tbl_idx++)
-      if(trv_tbl->lst[tbl_idx].nco_typ == nco_obj_typ_var && (!strcmp(trv_tbl->lst[tbl_idx].nm,wgt_nm))) wgt_nbr++;
+    for (unsigned tbl_idx = 0; tbl_idx < trv_tbl->nbr; tbl_idx++)
+      if (trv_tbl->lst[tbl_idx].nco_typ == nco_obj_typ_var && (!strcmp(trv_tbl->lst[tbl_idx].nm, wgt_nm))) wgt_nbr++;
 
     /* Fill-in variable structure list for all weights */
-    wgt_trv=(trv_sct **)nco_malloc(wgt_nbr*sizeof(trv_sct *));
-    idx_wgt=0;
+    wgt_tbl = (trv_sct **)nco_malloc(wgt_nbr * sizeof(trv_sct *));
+    idx_wgt = 0;
 
-    /* Creat list of potential weight structures */
-    for(unsigned tbl_idx=0;tbl_idx<trv_tbl->nbr;tbl_idx++){
-      if(trv_tbl->lst[tbl_idx].nco_typ == nco_obj_typ_var && !strcmp(trv_tbl->lst[tbl_idx].nm,wgt_nm)){
-        wgt_trv[idx_wgt]=&trv_tbl->lst[tbl_idx]; 
+    /* Create list of potential weight structures */
+    for (unsigned tbl_idx = 0; tbl_idx < trv_tbl->nbr; tbl_idx++) {
+      if (trv_tbl->lst[tbl_idx].nco_typ == nco_obj_typ_var && !strcmp(trv_tbl->lst[tbl_idx].nm, wgt_nm)) {
+        wgt_tbl[idx_wgt] = &trv_tbl->lst[tbl_idx];
         idx_wgt++;
       } /* endif */
     } /* !tbl_idx */
 
-    for(unsigned idx_var=0;idx_var<trv_tbl->nbr;idx_var++){
+    for (unsigned idx_var = 0; idx_var < trv_tbl->nbr; idx_var++) {
       /* Find variable that needs weight/mask */
-      if(trv_tbl->lst[idx_var].nco_typ == nco_obj_typ_var &&
-	 trv_tbl->lst[idx_var].flg_xtr &&
-	 !strcmp(trv_tbl->lst[idx_var].nm_fll,var->nm_fll)){
-	trv_sct var_trv=trv_tbl->lst[idx_var];  
-
-	/* 20150711: This is buggy, at best it returns last weight found, not closest-in-scope */
-	/* Which weight is closest-in-scope to variable? */
-	for(idx_wgt=0;idx_wgt<wgt_nbr;idx_wgt++){
-	  if(!strcmp(wgt_trv[idx_wgt]->grp_nm_fll,var_trv.grp_nm_fll)){
-	    (void)nco_inq_grp_full_ncid(nc_id,wgt_trv[idx_wgt]->grp_nm_fll,&grp_id);
-	    (void)nco_inq_varid(grp_id,wgt_trv[idx_wgt]->nm,&var_id);
-	    /* Transfer from table to local variable */
-	    wgt_var=nco_var_fll_trv(grp_id,var_id,wgt_trv[idx_wgt],trv_tbl);
-	    /* Retrieve variable NB: use GTT version, that "knows" all limits */
-	    (void)nco_msa_var_get_trv(nc_id,wgt_var,trv_tbl);
-	    wgt_trv=(trv_sct **)nco_free(wgt_trv);
-	    return wgt_var;
-	  } /* !strcmp() */
-	} /* !idx_wgt */
+      if (trv_tbl->lst[idx_var].nco_typ == nco_obj_typ_var
+        && trv_tbl->lst[idx_var].flg_xtr
+        && !strcmp(trv_tbl->lst[idx_var].nm_fll, var->nm_fll)) {
+        trv_sct var_trv = trv_tbl->lst[idx_var];
+
+        /* 20150711: This is buggy, at best it returns last weight found, not closest-in-scope */
+        /* 20170620: Broken because it requires that weight and variable be in same group */
+        /* Which weight is closest-in-scope to variable? */
+        for (idx_wgt = 0; idx_wgt < wgt_nbr; idx_wgt++) {
+          trv_sct *wgt_trv = wgt_tbl[idx_wgt];
+          /* 20170620: Change from strcmp() to strstr() so weight can be in any ancestor group
+          This still does NOT have the desired behavior of selecting the _closest-in-scope_,
+          but at least it allows weights to be in ancestor groups */
+          if (strstr(wgt_trv->grp_nm_fll, var_trv.grp_nm_fll)) {
+            (void)nco_inq_grp_full_ncid(nc_id, wgt_trv->grp_nm_fll, &grp_id);
+            (void)nco_inq_varid(grp_id, wgt_trv->nm, &var_id);
+
+            /* Case of input limits, reconstruct limits and hyperslab */
+            if (lmt_nbr) {
+              lmt_sct **lmt = NULL_CEWI;  /* [sct] User defined limits */
+              lmt = nco_lmt_prs(lmt_nbr, lmt_arg);
+              nco_bld_lmt_var(nc_id, MSA_USR_RDR, lmt_nbr, lmt, FORTRAN_IDX_CNV, wgt_trv);
+              /* Transfer from table to local variable */
+              wgt_var = nco_var_fll_trv(grp_id, var_id, wgt_trv, trv_tbl);
+              /* Assign the hyperslab information for a variable 'var_sct'  from the obtained GTT variable */
+              /* Similar to nco_msa_var_get_trv() but just with one input GTT variable */
+              (void)nco_msa_var_get_sct(nc_id, wgt_var, wgt_trv);
+              lmt = nco_lmt_lst_free(lmt, lmt_nbr);
+            }
+            else {
+              /* Retrieve hyperslabs from table */
+              /* Transfer from table to local variable */
+              wgt_var = nco_var_fll_trv(grp_id, var_id, wgt_trv, trv_tbl);
+              /* Retrieve variable NB: use GTT version, that "knows" all limits */
+              (void)nco_msa_var_get_trv(nc_id, wgt_var, trv_tbl);
+            }
+
+            wgt_tbl = (trv_sct **)nco_free(wgt_tbl);
+            return wgt_var;
+          } /* !strcmp() */
+        } /* !idx_wgt */
       } /* !var */
     } /* !idx_var */
   } /* !Relative name */
 
   /* If function has not yet returned, then variable was not found */
-  (void)fprintf(stdout,"%s: ERROR nco_var_get_wgt_trv() reports unable to find specified weight or mask variable \"%s\"\n",nco_prg_nm_get(),wgt_nm);
-  nco_exit(EXIT_FAILURE); 
+  (void)fprintf(stdout, "%s: ERROR nco_var_get_wgt_trv() reports unable to find specified weight or mask variable \"%s\"\n", nco_prg_nm_get(), wgt_nm);
+  nco_exit(EXIT_FAILURE);
 
   return NULL;
 } /* nco_var_get_wgt_trv() */
@@ -10062,3 +10346,33 @@ nco_var_xtr_trv                       /* [fnc] Print all variables to extract (d
     } /* Filter variables  */
   } /* Loop table */
 } /* nco_var_xtr_trv() */
+
+crd_sct*
+nco_get_crd_sct                       /* [fnc] Return a coordinate variable crd_sct for a given table variable var_trv */
+(trv_sct * const var_trv,             /* I [sct] GTT Variable */
+ int lmt_nbr,                         /* I [nbr] Number of user-specified dimension limits */
+ lmt_sct **lmt)                       /* I [sct] Limit array. Structure comming from nco_lmt_prs() */
+{
+  /* Return a coordinate variable crd_sct for a given table variable var_trv that matches a specified limit name
+  NB: assumed the limit name is a coordinate variable */
+
+  /* Loop input variable dimensions */
+  for (int idx_var_dmn = 0; idx_var_dmn < var_trv->nbr_dmn; idx_var_dmn++) {
+
+    /* Loop input name list */
+    for (int lmt_idx = 0; lmt_idx < lmt_nbr; lmt_idx++) {
+
+      /* Match input relative name to dimension relative name */
+      if (!strcmp(lmt[lmt_idx]->nm, var_trv->var_dmn[idx_var_dmn].dmn_nm)) {
+
+        /* Dimension has coordinate variables */
+        if (var_trv->var_dmn[idx_var_dmn].crd) {
+          crd_sct *crd = var_trv->var_dmn[idx_var_dmn].crd;
+          return crd;
+        }
+      }
+    }
+  }
+  return NULL;
+}
+
diff --git a/src/nco/nco_grp_utl.h b/src/nco/nco_grp_utl.h
index d57b2a5..c08e6e4 100644
--- a/src/nco/nco_grp_utl.h
+++ b/src/nco/nco_grp_utl.h
@@ -556,6 +556,16 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
  nco_bool FORTRAN_IDX_CNV,            /* I [flg] Hyperslab indices obey Fortran convention */
  trv_tbl_sct * const trv_tbl);        /* I/O [sct] Traversal table */
 
+void
+nco_bld_lmt_var                       /* [fnc] Assign user specified dimension limits to one GTT variable */
+(const int nc_id,                     /* I [ID] netCDF file ID */
+  nco_bool MSA_USR_RDR,               /* I [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
+  int lmt_nbr,                        /* I [nbr] Number of user-specified dimension limits */
+  lmt_sct **lmt,                      /* I [sct] Structure comming from nco_lmt_prs() */
+  nco_bool FORTRAN_IDX_CNV,           /* I [flg] Hyperslab indices obey Fortran convention */
+  trv_sct *wgt_trv);                  /* I/O [sct] GTT variable (used for weight/mask) */
+ 
+
 void 
 nco_msa_var_get_rec_trv             /* [fnc] Read one record of a variable */
 (const int nc_id,                   /* I [ID] netCDF file ID */
@@ -570,10 +580,14 @@ nco_skp_var                          /* [fnc] Skip variable while doing record
  const char * const rec_nm_fll,      /* I [sng] Full name of record being done in loop (trv_tbl->lmt_rec[idx_rec]->nm_fll ) */
  const trv_tbl_sct * const trv_tbl); /* I [sct] Traversal table */
 
-var_sct *                             /* O [sct] Variable (weight) */  
+var_sct *                             /* O [sct] Variable (weight or mask) */  
 nco_var_get_wgt_trv                   /* [fnc] Retrieve weighting or mask variable */
 (const int nc_id,                     /* I [id] netCDF file ID */
- const char * const wgt_nm,           /* I [sng] Weight variable name (relative) */
+ const int lmt_nbr,                   /* I [nbr] number of dimensions with limits */
+ CST_X_PTR_CST_PTR_CST_Y(char, lmt_arg), /* I [sng] List of user-specified dimension limits */
+ nco_bool MSA_USR_RDR,                /* I [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
+ nco_bool FORTRAN_IDX_CNV,            /* I [flg] Hyperslab indices obey Fortran convention */
+ const char * const wgt_nm,           /* I [sng] Weight or mask variable name (relative or absolute) */
  const var_sct * const var,           /* I [sct] Variable that needs the weight/mask variable */
  const trv_tbl_sct * const trv_tbl);  /* I [lst] Traversal table */
 
@@ -935,6 +949,12 @@ void
 nco_var_xtr_trv                       /* [fnc] Print all variables to extract (debug) */
 (const trv_tbl_sct * const trv_tbl);  /* I [sct] Traversal table */
 
+crd_sct*
+nco_get_crd_sct                       /* [fnc] Return a coordinate variable crd_sct for a given table variable var_trv */
+(trv_sct * const var_trv,             /* I [sct] GTT Variable */
+ int lmt_nbr,                         /* I [nbr] Number of user-specified dimension limits */
+ lmt_sct **lmt);                      /* I [sct] Limit array. Structure comming from nco_lmt_prs() */
+
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif /* __cplusplus */
diff --git a/src/nco/nco_mmr.c b/src/nco/nco_mmr.c
index e4d997b..5b4442b 100644
--- a/src/nco/nco_mmr.c
+++ b/src/nco/nco_mmr.c
@@ -100,13 +100,13 @@ nco_malloc /* [fnc] Wrapper for malloc() */
     if((nvr_NCO_MMR_DBG=getenv("NCO_MMR_DBG"))) ntg_NCO_MMR_DBG=(int)strtol(nvr_NCO_MMR_DBG,&sng_cnv_rcd,NCO_SNG_CNV_BASE10); /* [sng] Environment variable NCO_MMR_DBG */
   } /* endif dbg */
 
-  if(ntg_NCO_MMR_DBG && sz > sz_thr) (void)fprintf(stdout,"%s: INFO %s received request to allocate %zu B = %zu kB = %zu MB = %zu GB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB);
+  if(ntg_NCO_MMR_DBG && sz > sz_thr) (void)fprintf(stdout,"%s: INFO %s received request to allocate %lu B = %lu kB = %lu MB = %lu GB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB);
 
-  if(sz > sz_max) (void)fprintf(stdout,"%s: WARNING %s received request to allocate %zu B = %zu kB = %zu MB = %zu GB = %zu TB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB,sz/NCO_BYT_PER_TB);
+  if(sz > sz_max) (void)fprintf(stdout,"%s: WARNING %s received request to allocate %lu B = %lu kB = %lu MB = %lu GB = %lu TB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB,sz/NCO_BYT_PER_TB);
 
   ptr=malloc(sz); /* [ptr] Pointer to new buffer */
   if(ptr == NULL){
-    (void)fprintf(stdout,"%s: ERROR %s unable to allocate %zu B = %zu kB = %zu MB = %zu GB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB);
+    (void)fprintf(stdout,"%s: ERROR %s unable to allocate %lu B = %lu kB = %lu MB = %lu GB\n",nco_prg_nm_get(),fnc_nm,sz,sz/NCO_BYT_PER_KB,sz/NCO_BYT_PER_MB,sz/NCO_BYT_PER_GB);
     (void)nco_malloc_err_hnt_prn();
     /* fxm: Should be exit(8) on ENOMEM errors? */
     nco_exit(EXIT_FAILURE);
diff --git a/src/nco/nco_msa.c b/src/nco/nco_msa.c
index 9029af6..aa12cea 100644
--- a/src/nco/nco_msa.c
+++ b/src/nco/nco_msa.c
@@ -1558,7 +1558,7 @@ nco_cpy_msa_lmt                     /* [fnc] Copy MSA struct from table to local
 } /* nco_cpy_msa_lmt() */
 
 void
-nco_msa_var_get_trv                 /* [fnc] Get variable data from disk taking account of multihyperslabs */
+nco_msa_var_get_trv                 /* [fnc] Define a 'var_sct' hyperslab fields from a GTT variable */
 (const int nc_id,                   /* I [ID] netCDF file ID */
  var_sct *var_in,                   /* I/O [sct] Variable */
  const trv_tbl_sct * const trv_tbl) /* I [sct] GTT (Group Traversal Table) */
@@ -1606,7 +1606,7 @@ nco_msa_var_get_trv                 /* [fnc] Get variable data from disk taking
     (void)fprintf(stdout,"%s: DEBUG %s reports reading %s\n",nco_prg_nm_get(),fnc_nm,var_trv->nm_fll);
     for(int idx_dmn=0;idx_dmn<var_trv->nbr_dmn;idx_dmn++){
       (void)fprintf(stdout,"%s: DEBUG %s reports dimension %s has dmn_cnt = %ld",nco_prg_nm_get(),fnc_nm,lmt_msa[idx_dmn]->dmn_nm,lmt_msa[idx_dmn]->dmn_cnt);
-	for(int idx_lmt=0;idx_lmt<lmt_msa[idx_dmn]->lmt_dmn_nbr;idx_lmt++) (void)fprintf(stdout," : %ld (%ld->%ld)",lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->cnt,lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->srt,lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->end);
+  for(int idx_lmt=0;idx_lmt<lmt_msa[idx_dmn]->lmt_dmn_nbr;idx_lmt++) (void)fprintf(stdout," : %ld (%ld->%ld)",lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->cnt,lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->srt,lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->end);
       (void)fprintf(stdout,"\n");
     } /* end loop over dimensions */
   } /* endif dbg */
@@ -1653,6 +1653,98 @@ do_upk:
 } /* end nco_msa_var_get_trv() */
 
 void
+nco_msa_var_get_sct                 /* [fnc] Define a 'var_sct' hyperslab fields from a GTT variable ('trv_sct')*/
+(const int nc_id,                   /* I [ID] netCDF file ID */
+  var_sct *var_in,                  /* I/O [sct] Variable */
+  const trv_sct * const var_trv)    /* I [sct] GTT variable */
+{
+  /* Same as nco_msa_var_get_trv() but with input 'var_trv' '
+  TODO Deprecate nco_msa_var_get_trv() and use this function */
+
+  const char fnc_nm[] = "nco_msa_var_get_sct()"; /* [sng] Function name  */
+
+  int nbr_dim;
+  int grp_id;
+
+  lmt_msa_sct **lmt_msa;
+  lmt_sct **lmt;
+
+  nc_type mss_typ_tmp = NC_NAT; /* CEWI */
+
+  /* Obtain group ID */
+  (void)nco_inq_grp_full_ncid(nc_id, var_trv->grp_nm_fll, &grp_id);
+
+  nbr_dim = var_in->nbr_dim;
+  var_in->nc_id = grp_id;
+
+  assert(nbr_dim == var_trv->nbr_dmn);
+  assert(!strcmp(var_in->nm_fll, var_trv->nm_fll));
+
+  /* Scalars */
+  if (nbr_dim == 0) {
+    var_in->val.vp = nco_malloc(nco_typ_lng(var_in->typ_dsk));
+    (void)nco_get_var1(var_in->nc_id, var_in->id, 0L, var_in->val.vp, var_in->typ_dsk);
+    goto do_upk;
+  } /* end if scalar */
+
+    /* Allocate local MSA */
+  lmt_msa = (lmt_msa_sct **)nco_malloc(var_trv->nbr_dmn * sizeof(lmt_msa_sct *));
+  lmt = (lmt_sct **)nco_malloc(var_trv->nbr_dmn * sizeof(lmt_sct *));
+
+  /* Copy from table to local MSA */
+  (void)nco_cpy_msa_lmt(var_trv, &lmt_msa);
+
+  if (nco_dbg_lvl_get() == nco_dbg_old) {
+    (void)fprintf(stdout, "%s: DEBUG %s reports reading %s\n", nco_prg_nm_get(), fnc_nm, var_trv->nm_fll);
+    for (int idx_dmn = 0; idx_dmn < var_trv->nbr_dmn; idx_dmn++) {
+      (void)fprintf(stdout, "%s: DEBUG %s reports dimension %s has dmn_cnt = %ld", nco_prg_nm_get(), fnc_nm, lmt_msa[idx_dmn]->dmn_nm, lmt_msa[idx_dmn]->dmn_cnt);
+      for (int idx_lmt = 0; idx_lmt < lmt_msa[idx_dmn]->lmt_dmn_nbr; idx_lmt++) (void)fprintf(stdout, " : %ld (%ld->%ld)", lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->cnt, lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->srt, lmt_msa[idx_dmn]->lmt_dmn[idx_lmt]->end);
+      (void)fprintf(stdout, "\n");
+    } /* end loop over dimensions */
+  } /* endif dbg */
+
+    /* Call super-dooper recursive routine
+    nco_msa_rcr_clc requires that var_in->type be on-disk type
+    Could replace var->type by var->typ_dsk in nco_msa_rcr_clc() but that seems inelegant
+    Instead, risk putting val and mss_val types briefly out-of-sync by pretending var->type is typ_dsk
+    Save current type of missing value in RAM in temporary variable and conform new variable to that below
+    20140930: This is (too?) confusing and hard-to-follow, a better solution is to add a field mss_val_typ
+    to var_sct and then separately and explicitly track types of both val and mss_val members. */
+  mss_typ_tmp = var_in->type;
+  var_in->type = var_in->typ_dsk;
+  var_in->val.vp = nco_msa_rcr_clc((int)0, nbr_dim, lmt, lmt_msa, var_in);
+  var_in->type = mss_typ_tmp;
+
+  /* Free */
+  (void)nco_lmt_msa_free(var_trv->nbr_dmn, lmt_msa);
+  lmt = (lmt_sct **)nco_free(lmt);
+
+do_upk:
+  /* Missing value type synchronization:
+  Avoid re-reading missing value every ncra record by converting input value to disk type
+  var_in->type still reflects missing value type, not variable value type */
+  if (var_in->pck_dsk && (mss_typ_tmp != var_in->typ_dsk)) var_in = nco_cnv_mss_val_typ(var_in, var_in->typ_dsk);
+  var_in->type = var_in->typ_dsk;
+
+  /* Type of variable and missing value in memory are now same as type on disk */
+
+  /* Packing in RAM is now same as packing on disk pck_dbg
+  fxm: This nco_pck_dsk_inq() call is never necessary for non-packed variables */
+  (void)nco_pck_dsk_inq(grp_id, var_in);
+
+  /* Packing/Unpacking */
+  if (nco_is_rth_opr(nco_prg_id_get())) {
+    /* Arithmetic operators must unpack variables before performing arithmetic
+    Otherwise arithmetic will produce garbage results */
+    /* 20050519: Not sure why I originally made nco_var_upk() call SMP-critical
+    20050629: Making this region multi-threaded causes no problems */
+    if (var_in->pck_dsk) var_in = nco_var_upk(var_in);
+  } /* endif arithmetic operator */
+
+  return;
+} /* end nco_msa_var_get_sct() */
+
+void
 nco_lmt_msa_free                    /* [fnc] Free MSA */
 (const int nbr_dmn,                 /* I [nbr] Number of dimensions */
  lmt_msa_sct **lmt_msa)             /* I [sct] MSA */
diff --git a/src/nco/nco_msa.h b/src/nco/nco_msa.h
index 5c843ad..36f32ed 100644
--- a/src/nco/nco_msa.h
+++ b/src/nco/nco_msa.h
@@ -155,12 +155,18 @@ nco_cpy_msa_lmt                     /* [fnc] Copy MSA struct from table to local
  lmt_msa_sct ***lmt_msa);           /* O [sct] MSA array for dimensions */
 
 void
-nco_msa_var_get_trv                 /* [fnc] Get variable data from disk taking account of multihyperslabs */
+nco_msa_var_get_trv                 /* [fnc] Define a 'var_sct' hyperslab fields from a GTT variable */
 (const int nc_id,                   /* I [ID] netCDF file ID */
  var_sct *var_in,                   /* I/O [sct] Variable */
  const trv_tbl_sct * const trv_tbl);/* I [sct] GTT (Group Traversal Table) */
 
 void
+nco_msa_var_get_sct                 /* [fnc] Define a 'var_sct' hyperslab fields from a GTT variable ('trv_sct')*/
+(const int nc_id,                   /* I [ID] netCDF file ID */
+  var_sct *var_in,                  /* I/O [sct] Variable */
+  const trv_sct * const var_trv);   /* I [sct] GTT variable */
+
+void
 nco_lmt_msa_free                    /* [fnc] Free MSA */
 (const int nbr_dmn,                 /* I [nbr] Number of dimensions */
  lmt_msa_sct **lmt_msa);            /* I [sct] MSA */
diff --git a/src/nco/nco_mta.c b/src/nco/nco_mta.c
index 58662f7..1a27d2e 100644
--- a/src/nco/nco_mta.c
+++ b/src/nco/nco_mta.c
@@ -170,11 +170,11 @@ nco_sng_split /* [fnc] Split string by delimiter */
   return sng_fnl;
 } /* end nco_sng_split() */
 
-int /* O [flg] Is flag */
-nco_is_flag /* [fnc] Check whether input is a flag */
+int /* O [flg] Option is flag */
+nco_opt_is_flg /* [fnc] Check whether option is registered as NCO flag */
 (const char* flag) /* I [sng] Input string */
 {
-  const char fnc_nm[]="nco_is_flag()"; /* [sng] Function name */
+  const char fnc_nm[]="nco_opt_is_flg()"; /* [sng] Function name */
   const char *rgr_flags[]={
     "no_area",
     "no_area_out",
@@ -258,7 +258,7 @@ nco_input_check /* [fnc] Check whether input has valid syntax */
   
   if(!strstr(args,"=")){ // If no equal sign in arguments
     char *arg_copy=strdup(args);
-    if(!nco_is_flag(nco_remove_hyphens(arg_copy))){
+    if(!nco_opt_is_flg(nco_remove_hyphens(arg_copy))){
       (void)fprintf(stderr,"%s: ERROR %s did not detect equal sign between key and value for argument \"%s\".\n%s: HINT This can occur when the designated or default key-value delimiter string \"%s\" is mixed into the literal text of the value. Try changing delimiter to a string guaranteed not to appear in the value string with, e.g., --dlm=\"##\".\n",nco_prg_nm_get(),fnc_nm,args,nco_prg_nm_get(),nco_mta_dlm_get());
       nco_free(arg_copy);
       return NCO_ERR;
diff --git a/src/nco/nco_mta.h b/src/nco/nco_mta.h
index 8810270..3ad2f13 100644
--- a/src/nco/nco_mta.h
+++ b/src/nco/nco_mta.h
@@ -62,6 +62,10 @@ extern "C" {
   (const char *source, /* I [sng] Source string */
    const char *delimiter); /* I [char] Delimiter */
 
+  int /* O [flg] Option is flag */
+  nco_opt_is_flg /* [fnc] Check whether option is registered as NCO flag */
+  (const char* flag); /* I [sng] Input string */
+
   int /* O [int] the boolean for the checking result */
   nco_input_check /* [fnc] check whether the input is legal and give feedback accordingly. */
   (const char *args); /* O [sng] input arguments */
diff --git a/src/nco/nco_netcdf.c b/src/nco/nco_netcdf.c
index 988ef06..965c718 100644
--- a/src/nco/nco_netcdf.c
+++ b/src/nco/nco_netcdf.c
@@ -78,23 +78,23 @@ nco_err_exit /* [fnc] Print netCDF error message, routine name, then exit */
   switch(rcd){
   case NC_EACCESS:  /* netcdf.h added NC_EACCESS in ~2012 */
     (void)fprintf(stdout,"ERROR NC_EACCESS Access failure\nHINT: NC_EACCESS errors signify a problem receiving data from a DAP server. This can occur, e.g., when NCO requests (with nco_var_get()) more data than the server is configured to dispense at one time. A workaround might be to request smaller chunks of data at one time. This can be accomplished by accessing hyperslabs or multi-slabs of data as described at http://nco.sf.net/nco.html#mlt\n"); break; /* NB: NC_EACCESS added to netc [...]
-  case NC_EBADTYPE: (void)fprintf(stdout,"ERROR NC_BADTYPE Not a netCDF data type\nHINT: NC_EBADTYPE errors can occur when NCO tries to write netCDF4 features to a netCDF3 file. Features that cannot be defined in a netCDF3 file, and that thus will trigger this error, include groups and netCDF4 atomic types (e.g., NC_STRING, NC_UBYTE). The workaround is to remove all netCDF4 features before attempting the conversion, or to just give up and write a netCDF4 output file instead of a netCDF3  [...]
+  case NC_EBADTYPE: (void)fprintf(stdout,"ERROR NC_BADTYPE Not a netCDF data type\nHINT: NC_EBADTYPE errors can occur when NCO tries to write netCDF4 features to a netCDF3 file, and, separately, when a variable's type conflicts with its _FillValue type. 1. netCDF4 features that cannot be defined in a netCDF3 file, and that thus will trigger this error, include groups and netCDF4 atomic types (e.g., NC_STRING, NC_UBYTE). To avoid this, remove all netCDF4 features before attempting to conv [...]
   case NC_ECANTWRITE: (void)fprintf(stdout,"ERROR NC_ECANTWRITE Can't write file\nHINT: NC_ECANTWRITE errors can occur when NCO tries to write to an HDF5 file that is not netCDF4-compliant. One workaround is translate the file to a netCDF4-compliant file first, e.g., with \'ncks in.h5 out.nc\'.\n"); break;
   case NC_EINVAL: (void)fprintf(stdout,"ERROR NC_EINVAL Invalid argument\nHINT: NC_EINVAL errors can occur for many reasons. Three common ones are described here. 1. When invalid chunking directives are given, e.g., to unchunk a record variable or to chunk a variable with an invalid size (such as zero or larger than a fixed dimension). This is the most frequent/likely cause in our experience. 2. When HDF4-enabled NCO attempts to directly write to an HDF4 (not HDF5) file. Not all HDF5 cal [...]
   case NC_EIO: /* netcdf.h added NC_EIO in ~2012 */
     (void)fprintf(stdout,"ERROR NC_EIO Generic IO error\nHINT: NC_EIO errors can occur when NCO tries to read a file through a non-existant DAP location. Then NCO automatically tries to retrieve the file through another method, e.g., searching for a file of the same name in the current directory. This can trigger a subsequent error. When debugging the problem, first address the originating error (from NC_EIO).\n"); break;
   case NC_ELATEFILL: /* netcdf.h replaced NC_EFILLVALUE by NC_ELATEFILL after about netCDF ~4.2.1 */ 
-     (void)fprintf(stdout,"ERROR NC_ELATEFILL (formerly NC_EFILLVALUE) Attempt to define fill value when data already exists\nHINT: NC_ELATEFILL errors can occur when NCO attempts to create, modify, or overwrite  a _FillValue attribute for an existing variable in a netCDF4 file. The netCDF4 format (unlike netCDF3) does not permit this. Does your output file need to be netCDF4 or netCDF4_classic format? One workaround is to change the output format to netCDF3 (e.g., ncks -3 in.nc out.nc), [...]
+     (void)fprintf(stdout,"ERROR NC_ELATEFILL (formerly NC_EFILLVALUE) Attempt to define fill value when data already exists\nHINT: NC_ELATEFILL errors can occur when NCO attempts to create, modify, or overwrite a _FillValue attribute for an existing variable in a netCDF4 file. The netCDF4 format (unlike netCDF3) does not permit this. Does your output file need to be netCDF4 or netCDF4_classic format? One workaround is to change the output format to netCDF3 (e.g., ncks -3 in.nc out.nc),  [...]
 #ifdef ENABLE_NETCDF4 
-  case NC_ENOTBUILT: (void)fprintf(stdout,"ERROR NC_ENOTBUILT Attempt to use feature that was not turned on when netCDF was built\nHINT: NC_ENOTBUILT errors occur only, in our experience, when NCO attempts to access an HDF4 (including HDF-EOS2) file. It is only possible to access HDF4 files from NCO if NCO is first re-linked to a version of netCDF configured with the --enable-hdf4 option, which itself must be linked to a version of HDF4 configured with the --disable-netcdf option. These  [...]
+  case NC_ENOTBUILT: (void)fprintf(stdout,"ERROR NC_ENOTBUILT Attempt to use feature that was not turned on when netCDF was built\nHINT: NC_ENOTBUILT errors occur only, in our experience, when NCO attempts to access an HDF4 (including HDF-EOS2) file. It is only possible to access HDF4 files from NCO if NCO is first re-linked to a version of netCDF configured with the --enable-hdf4 option, which itself must be linked to a version of HDF4 configured with the --disable-netcdf option. These  [...]
 #endif /* !ENABLE_NETCDF4 */
   case NC_ENOTNC: (void)fprintf(stdout,"ERROR NC_ENOTNC Not a netCDF file\nHINT: NC_ENOTNC errors can occur for many reasons. If your use-case matches one of the four listed below, take the corrective action indicated:\n1. An NCO operator linked only to the classic netCDF3 library attempts to read netCDF4 (or HDF4 or HDF5) files. "); 
 #ifdef ENABLE_NETCDF4 
-     (void)fprintf(stdout," However, this executable seems to have been built with the capability to manipulate netCDF4 files, so it is unlikely that this command failed only because the input datasets are netCDF4 format. Something else is going wrong. \n"); 
+     (void)fprintf(stdout,"However, this executable seems to have been built with the capability to manipulate netCDF4 files, so it is unlikely that this command failed only because the input datasets are netCDF4 format. Something else is going wrong. \n"); 
 #else /* !ENABLE_NETCDF4 */ 
      (void)fprintf(stdout,"Are your input files netCDF4 format?  (http://nco.sf.net/nco.html#fmt_inq shows how to tell.) If so then installing or re-building a netCDF4-compatible version of NCO should solve this problem. First upgrade netCDF to version 4.x, then install NCO using those netCDF 4.x libraries.\n2. NC_ENOTNC can occur when users attempt to utilize diskless (i.e., RAM) files.  In this case remove the diskless switches (e.g., --ram or --diskless) and then re-issue the command. \n"); 
 #endif /* !ENABLE_NETCDF4 */ 
-     (void)fprintf(stdout,"2. NCO attempts to read other filetypes (HDF4, HDF-EOS2, pnetCDF) for which support must be (but was not) enabled at netCDF build-time. NCO can access HDF4 files if NCO is first re-linked to a version of netCDF configured with the --enable-hdf4 option. This is a non-standard netCDF build option described here: http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html. NCO can access pnetCDF files if NCO is first re-linked to netCDF version 4.4.0 or later [...]
+     (void)fprintf(stdout,"2. NCO attempts to read other filetypes (HDF4, HDF-EOS2, pnetCDF/CDF5) for which support must be (but was not) enabled at netCDF build-time. NCO can access HDF4 files if NCO is first re-linked to a version of netCDF configured with the --enable-hdf4 option. This is a non-standard netCDF build option described here: http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html. NCO can access pnetCDF/CDF5 files if NCO is first re-linked to netCDF version 4.4. [...]
   case NC_ERANGE: (void)fprintf(stdout,"ERROR NC_ERANGE Result not representable in output file\nHINT: NC_ERANGE errors typically occur after an arithmetic operation results in a value not representible by the output variable type when NCO attempts to write those values to an output file.  Possible workaround: Promote the variable to higher precision before attempting arithmetic.  For example,\nncap2 -O -s \'foo=double(foo);\' in.nc in.nc\nFor more details, see http://nco.sf.net/nco.html [...]
   case NC_EUNLIMIT: (void)fprintf(stdout,"ERROR NC_UNLIMIT NC_UNLIMITED size already in use\nHINT: NC_EUNLIMIT errors can occur when attempting to convert netCDF4 classic files that contain multiple record dimensions into a netCDF3 file that allows only one record dimension. In this case, try first fixing the excess record dimension(s) (with, e.g., ncks --fix_rec_dmn) and then convert to netCDF3. For more details, see http://nco.sf.net/nco.html#fix_rec_dmn\n"); break;
   case NC_EVARSIZE: (void)fprintf(stdout,"ERROR NC_EVARSIZE One or more variable sizes violate format constraints\nHINT: NC_EVARSIZE errors can occur when attempting to aggregate netCDF3 classic files together into outputs that exceed the capacity of the netCDF3 classic file format, e.g., a variable with size in excess of 2^31 bytes. In this case, try altering the output file type to netCDF3 classic with 64-bit offsets (with --64) or to netCDF4 (with -4). For more details, see http://nco [...]
@@ -2177,6 +2177,7 @@ int
 nco_put_att(const int nc_id,const int var_id,const char * const att_nm,const nc_type att_typ,const long att_len,const void * const vp)
 {
   /* Purpose: Wrapper for nc_put_att_*() */
+  const char fnc_nm[]="nco_put_att()";
   int rcd=NC_NOERR;
   switch(att_typ){
   case NC_FLOAT: rcd=nc_put_att_float(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const float *)vp); break;
@@ -2197,6 +2198,13 @@ nco_put_att(const int nc_id,const int var_id,const char * const att_nm,const nc_
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
+  /* 20170811: netCDF 4.5.x enforces rule attempting to add _FillValue to root/group (NC_GLOBAL) returns NC_EGLOBAL */
+  if(rcd == NC_EGLOBAL && !strcmp(att_nm,"_FillValue")){
+    char grp_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_grpname(nc_id,grp_nm);
+    (void)fprintf(stdout,"WARNING: %s received NC_EGLOBAL error writing attribute \"%s\" to metadata for group \"%s\". netCDF 4.5.x forbids this with the _FillValue attribute, though earlier versions allow it. Proceeding normally without writing %s attribute...\n",fnc_nm,att_nm,grp_nm,att_nm);
+    rcd=NC_NOERR;
+  } /* !rcd */
   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_att()");
   return rcd;
 } /* end nco_put_att */
diff --git a/src/nco/nco_omp.c b/src/nco/nco_omp.c
index 6e332fa..7e60a21 100644
--- a/src/nco/nco_omp.c
+++ b/src/nco/nco_omp.c
@@ -104,7 +104,7 @@ nco_openmp_ini /* [fnc] Initialize OpenMP threading environment */
     /* ...if possible... */
     if(nco_dbg_lvl_get() >= nco_dbg_scl) (void)fprintf(fp_stderr,"%s: INFO Command-line requests %d thread%s\n",nco_prg_nm_get(),thr_nbr,(thr_nbr > 1) ? "s" : "");
     if(thr_nbr > thr_nbr_max){
-      (void)fprintf(fp_stderr,"%s: WARNING Reducing user-requested thread number = %d to maximum thread number allowed = %d\n",nco_prg_nm_get(),thr_nbr,thr_nbr_max);
+      (void)fprintf(fp_stderr,"%s: INFO Reducing user-requested thread number = %d to maximum thread number allowed = %d\n",nco_prg_nm_get(),thr_nbr,thr_nbr_max);
       thr_nbr_rqs=thr_nbr_max; /* [nbr] Number of threads to request */
     } /* endif */
   }else{ /* !USR_SPC_THR_RQS */
diff --git a/src/nco/nco_pck.c b/src/nco/nco_pck.c
index f271485..2cfd078 100644
--- a/src/nco/nco_pck.c
+++ b/src/nco/nco_pck.c
@@ -711,11 +711,15 @@ nco_var_pck /* [fnc] Pack variable in memory */
      NB: Value buffer var->val.vp is usually free()'d here
      Variables in calling routine which point to var->val.vp will be left dangling */
 
-  nco_bool PURE_MSS_VAL_FLD=False; /* [flg] Field is pure missing_value, i.e., no valid values */
   const char fnc_nm[]="nco_var_pck()"; /* [sng] Function name */
+
   double scl_fct_dbl=double_CEWI; /* [sct] Double precision value of scale_factor */
   double add_fst_dbl=double_CEWI; /* [sct] Double precision value of add_offset */
 
+  nco_bool PURE_MSS_VAL_FLD=False; /* [flg] Field is pure missing_value, i.e., no valid values */
+
+  static nco_bool FIRST_WARNING=True;
+
   /* Set flag true once new scale_factor/add_offset generated */
   *PCK_VAR_WITH_NEW_PCK_ATT=False;
 
@@ -884,7 +888,8 @@ nco_var_pck /* [fnc] Pack variable in memory */
 
       mss_val_dbl=ptr_unn_mss_val_dbl.dp[0];
       if(nc_typ_pck != NC_STRING && (mss_val_dbl < pck_rng_min_dbl || mss_val_dbl > pck_rng_max_dbl)){ 
-	(void)fprintf(stdout,"%s: WARNING %s reports mss_val_dbl (= %g) is outside range (%g <= x <= %g) represented by packed data type (= %s). Conversion of missing values is unpredictable and could lead to erroneous results. Workaround is to set _FillValue to be within packed range with, e.g.,\nncatted -O -a _FillValue,,o,f,%g inout.nc\nFor more information on this workaround, see\nhttp://nco.sf.net/nco.html#mss_val\n",nco_prg_nm_get(),fnc_nm,mss_val_dbl,pck_rng_min_dbl,pck_rng_max_dbl,nco_t [...]
+	if(FIRST_WARNING) (void)fprintf(stdout,"%s: WARNING %s reports mss_val_dbl (= %g) is outside range (%g <= x <= %g) represented by packed data type (= %s). Conversion of missing values is unpredictable and could lead to erroneous results. Workaround is to set _FillValue to be within packed range with, e.g.,\nncatted -O -a _FillValue,,o,f,%g inout.nc\nTo avoid excessive noise, NCO prints this WARNING at most once per dataset. For more information on this workaround, see\nhttp://nco.sf.net [...]
+	FIRST_WARNING=False;
       } /* NC_STRING */
     } /* end if(var->has_mss_val && !PURE_MSS_VAL_FLD) */
 
diff --git a/src/nco/nco_prn.c b/src/nco/nco_prn.c
index b1a6a81..3ad63d3 100644
--- a/src/nco/nco_prn.c
+++ b/src/nco/nco_prn.c
@@ -335,12 +335,11 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
       att[idx].val.vp = (void *) nco_malloc(att[idx].sz * nco_typ_lng(att[idx].type));
       (void) nco_get_att(grp_id, var_id, att[idx].nm, att[idx].val.vp, att[idx].type);
 
-      /* an NC_CHAR can have zero length size maybe others ? -create with a single FILL value */
-      if(att[idx].sz==0){
+      /* NC_CHAR can have zero length size maybe others? Create with a single FILL value */
+      if(att[idx].sz == 0L){
         att[idx].val=nco_mss_val_mk(att[idx].type);
         att[idx].sz=1;
-      }
-
+      } /* !att.sz */
     } /* idx == att_nbr */
     
     /* Copy value to avoid indirection in loop over att_sz */
@@ -435,7 +434,8 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
 	  rcd_prn=snprintf(val_sng,(size_t)NCO_ATM_SNG_LNG,att_sng_pln,val_flt);
 	  (void)sng_trm_trl_zro(val_sng,prn_flg->nbr_zro);
 	}else{
-	  if(isnan(val_flt)) (void)sprintf(val_sng,"NaNf"); else if(isinf(val_flt)) (void)sprintf(val_sng,"%sInfinityf",(val_flt < 0.0f) ? "-" : "");
+	  if(isnan(val_flt)) (void)sprintf(val_sng,(JSN) ? "null" : "NaNf");
+	  else if(isinf(val_flt)) (void)sprintf(val_sng,"%s",(JSN) ? "null" : (val_flt < 0.0f) ? "-Infinityf" : "Infinityf");
 	} /* endelse */
 	(void)fprintf(stdout,"%s%s",val_sng,(lmn != att_szm1) ? spr_sng : "");
       } /* end loop */
@@ -447,7 +447,8 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
 	  rcd_prn=snprintf(val_sng,(size_t)NCO_ATM_SNG_LNG,att_sng_pln,val_dbl);
 	  (void)sng_trm_trl_zro(val_sng,prn_flg->nbr_zro);
 	}else{
-	  if(isnan(val_dbl)) (void)sprintf(val_sng,"NaN"); else if(isinf(val_dbl)) (void)sprintf(val_sng,"%sInfinity",(val_dbl < 0.0) ? "-" : "");
+	  if(isnan(val_dbl)) (void)sprintf(val_sng,(JSN) ? "null" : "NaN");
+	  else if(isinf(val_dbl)) (void)sprintf(val_sng,"%s",(JSN) ? "null" : (val_dbl < 0.0) ? "-Infinity" : "Infinity");
 	} /* endelse */
 	(void)fprintf(stdout,"%s%s",val_sng,(lmn != att_szm1) ? spr_sng : "");
       } /* end loop */
@@ -510,9 +511,8 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
     case NC_STRING:
       for(lmn=0;lmn<att_sz;lmn++){
 	sng_val=att[idx].val.sngp[lmn];
-    /* In strict CDL an NC_STRING null is indictaed by NIL, for now we output an empty string */
-    if(!sng_val) sng_val="";
-	sng_lng=strlen(sng_val);
+	/* In strict CDL an NC_STRING null is indictaed by NIL, for now we output an empty string */
+	if(sng_val) sng_lng=strlen(sng_val); else sng_lng=0L;
 	sng_lngm1=sng_lng-1UL;
 	if(CDL||XML||JSN){
 	  /* Worst case is printable strings are six or four times longer than unformatted, i.e., '\"' == """ or '\\' == "\\\\" */
@@ -833,7 +833,6 @@ nco_typ_fmt_sng /* [fnc] Provide sprintf() format string for specified type */
   return (char *)NULL;
 } /* end nco_typ_fmt_sng() */
 
-
 void
 nco_prn_var_val_cmt /* 0 print to stdout var values as CDL comment (delimited by comma ) */
 (var_sct *var,          /* I [sct] variable to print */
@@ -1491,11 +1490,10 @@ nco_prn_var_dfn                     /* [fnc] Print variable metadata */
     if(prn_flg->PRN_VAR_DATA || prn_flg->PRN_VAR_METADATA) (void)fprintf(stdout,"%s>\n",dmn_sng); else (void)fprintf(stdout,"%s />\n",dmn_sng);
   } /* !xml */
 
-  /* add a comma as next in queue is the atts - nb DONT LIKE THIS */
+  /* Add comma as next in queue is the atts - NB: DONT LIKE THIS */
   if(prn_flg->jsn){
-    if(nbr_dim > 0)
-       (void)fprintf(stdout,"%s\n",dmn_sng); 
-    /* print netCDF type - use same names as XML */ 
+    if(nbr_dim > 0) (void)fprintf(stdout,"%s\n",dmn_sng); 
+    /* Print netCDF type with same names as XML */ 
     (void)fprintf(stdout,"%*s\"type\": \"%s\"",prn_ndn+prn_flg->sxn_fst,spc_sng,jsn_typ_nm(var_typ));
   } /* !xml */
 
@@ -1682,46 +1680,33 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
   /* Refresh missing value attribute, if any */
   var->has_mss_val=nco_mss_val_get(var->nc_id,var);
 
-
-  /* only TRD and CDL need units at this stage and have this flag set */
+  /* Only TRD and CDL need units at this stage and have this flag set */
   if(prn_flg->PRN_DMN_UNITS) {
     int cf_var_id;
     char *cln_sng = (char *) NULL;
     var_sct *var_tmp=NULL_CEWI;
     var_sct *var_swp=NULL_CEWI;
 
-    if (!nco_is_spc_in_cf_att(grp_id, "bounds", var->id, &cf_var_id) &&
-        !nco_is_spc_in_cf_att(grp_id, "climatology", var->id, &cf_var_id))
+    if(!nco_is_spc_in_cf_att(grp_id, "bounds", var->id, &cf_var_id) &&
+       !nco_is_spc_in_cf_att(grp_id, "climatology", var->id, &cf_var_id))
       cf_var_id = var->id;
 
-
-    unit_sng_var = nco_lmt_get_udu_att(grp_id, cf_var_id, "units");
-    if (unit_sng_var && strlen(unit_sng_var)) {
-
+    unit_sng_var=nco_lmt_get_udu_att(grp_id, cf_var_id, "units");
+    if(unit_sng_var && strlen(unit_sng_var)){
       flg_malloc_unit_var = True;
       //unit_cln_var = nco_cln_chk_tm(unit_sng_var);
 
       cln_sng = nco_lmt_get_udu_att(grp_id, cf_var_id, "calendar");
-      if (cln_sng)
-        lmt_cln = nco_cln_get_cln_typ(cln_sng);
-      else
-        lmt_cln = cln_std;
-
-
-      if (cln_sng)
-        cln_sng = (char *) nco_free(cln_sng);
-
-    }
+      if(cln_sng) lmt_cln = nco_cln_get_cln_typ(cln_sng); else lmt_cln=cln_std;
+      if(cln_sng) cln_sng=(char *)nco_free(cln_sng);
+    } 
 
-    /* set default for TRD */
-    if(TRD && flg_malloc_unit_var ==False){
+    /* Set default for TRD */
+    if(TRD && flg_malloc_unit_var == False){
       unit_sng_var=strdup("(no units)");
       flg_malloc_unit_var=True;
-    }
-    else if(CDL && flg_malloc_unit_var == True)
-      if(prn_flg->PRN_CLN_LGB || nco_dbg_lvl_get()== nco_dbg_std) {
-
-
+    }else if(CDL && flg_malloc_unit_var == True){
+      if(prn_flg->PRN_CLN_LGB || nco_dbg_lvl_get()== nco_dbg_std){
         var_tmp=nco_var_dpl(var);
 
         var_aux = nco_var_dpl(var);
@@ -1734,26 +1719,22 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
         nco_var_cnf_typ(NC_STRING, var_aux);
 
         /* nb nco_cln_var_prs modifies var_tmp and var_aux */
-        if (nco_cln_var_prs(unit_sng_var, lmt_cln, 2, var_tmp, var_aux) == NCO_ERR)
+        if (nco_cln_var_prs(unit_sng_var, lmt_cln, prn_flg->cdl_fmt_dt , var_tmp, var_aux) == NCO_ERR)
           var_aux = nco_var_free(var_aux);
         /* swap values about */
         else if (prn_flg->PRN_CLN_LGB) { var_swp=var;var=var_aux;var_aux=var_swp; }
 
         if(var_tmp) var_tmp=(var_sct*)nco_var_free(var_tmp);
-      }
-
-    }else{
-      flg_malloc_unit_var=False;
-      unit_sng_var=&nul_chr;
-  }
-
-
-
+      } /* !PRN_CLN_LGB */
+    } /* !CDL */
+  }else{
+    flg_malloc_unit_var=False;
+    unit_sng_var=&nul_chr;
+  } /* !TRD */
 
   if(var->has_mss_val) val_sz_byt=nco_typ_lng(var->type);
 
-  if(var->nbr_dim)
-  { 
+  if(var->nbr_dim){ 
     /* Allocate space for dimension information */
     dim=(dmn_sct *)nco_malloc(var->nbr_dim*sizeof(dmn_sct));
     /* Ensure val.vp is NULL-initialized (and thus not inadvertently free'd) when PRN_DMN_IDX_CRD_VAL is False */
@@ -1776,12 +1757,11 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
       for(int jdx=idx;jdx<var->nbr_dim;jdx++)
         mod_map_cnt[idx]*=lmt_msa[jdx]->dmn_cnt;
 
-    /* create mod_map_rv_cnt */ 
+    /* Create mod_map_rv_cnt */ 
     long rsz=1L;
     for(int jdx=var->nbr_dim-1;jdx>=0;jdx--)
-        mod_map_rv_cnt[jdx]=rsz*=lmt_msa[jdx]->dmn_cnt;
-
-  }
+      mod_map_rv_cnt[jdx]=rsz*=lmt_msa[jdx]->dmn_cnt;
+  } /* !var->nbr_dim */
 
   /* Call also initializes var.sz with final size */
   if(prn_flg->md5)
@@ -1792,11 +1772,9 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
     if(nco_pck_dsk_inq(grp_id,var))
       (void)fprintf(stderr,"%s: WARNING will print packed values of variable \"%s\". Unpack first (with ncpdq -U) to see actual values.\n",nco_prg_nm_get(),var_nm);
 
-
   if(prn_flg->dlm_sng) dlm_sng=strdup(prn_flg->dlm_sng); /* [sng] User-specified delimiter string, if any */
 
-
-  if(dlm_sng ){
+  if(dlm_sng){
     /* Print variable with user-supplied dlm_sng (includes nbr_dmn == 0) */
     char *fmt_sng_mss_val=NULL;
 
@@ -1967,7 +1945,8 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
             rcd_prn=snprintf(val_sng,(size_t)NCO_ATM_SNG_LNG,fmt_sng,val_flt);
             (void)sng_trm_trl_zro(val_sng,prn_flg->nbr_zro);
           }else{
-            if(isnan(val_flt)) (void)sprintf(val_sng,"NaN"); else if(isinf(val_flt)) (void)sprintf(val_sng,"%sInfinity",(val_flt < 0.0f) ? "-" : "");
+	    if(isnan(val_flt)) (void)sprintf(val_sng,(JSN) ? "null" : "NaNf");
+	    else if(isinf(val_flt)) (void)sprintf(val_sng,"%s",(JSN) ? "null" : (val_flt < 0.0f) ? "-Infinityf" : "Infinityf");
           } /* endelse */
           break;
         case NC_DOUBLE:
@@ -1976,7 +1955,8 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
             rcd_prn=snprintf(val_sng,(size_t)NCO_ATM_SNG_LNG,fmt_sng,val_dbl);
             (void)sng_trm_trl_zro(val_sng,prn_flg->nbr_zro);
           }else{
-            if(isnan(val_dbl)) (void)sprintf(val_sng,"NaN"); else if(isinf(val_dbl)) (void)sprintf(val_sng,"%sInfinity",(val_dbl < 0.0) ? "-" : "");
+	    if(isnan(val_dbl)) (void)sprintf(val_sng,(JSN) ? "null" : "NaN");
+	    else if(isinf(val_dbl)) (void)sprintf(val_sng,"%s",(JSN) ? "null" : (val_dbl < 0.0) ? "-Infinity" : "Infinity");
           } /* endelse */
           break;
         case NC_SHORT: (void)sprintf(val_sng,fmt_sng,var->val.sp[lmn]); break;
@@ -2057,28 +2037,25 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
       if(CDL && var->nbr_dim && lmn< var_szm1 && (lmn+1) % lmt_msa[var->nbr_dim-1]->dmn_cnt  ==0)
         (void)fprintf(stdout,"\n%*s",prn_ndn,spc_sng);
 
-
-
       /* if(var.type != NC_CHAR && var.type != NC_STRING ) (void)fprintf(stdout,"%s%s",val_sng,(lmn != var_szm1) ? spr_sng : ""); */
 
     } /* end loop over element */
     rcd_prn+=0; /* CEWI */
 
-    if(CDL) {
+    if(CDL){
       char tmp_sng[100] = {0};
-      if (nco_dbg_lvl_get() >= nco_dbg_std && flg_malloc_unit_var)
+      if(nco_dbg_lvl_get() >= nco_dbg_std && flg_malloc_unit_var)
         (void) sprintf(tmp_sng, "units=\"%s\"", unit_sng_var);
 
-      if (nco_dbg_lvl_get() == nco_dbg_std && var_aux) {
+      if(nco_dbg_lvl_get() == nco_dbg_std && var_aux){
         fprintf(stdout, "; // %s  ", tmp_sng);
-        // print out list of values as a CDL text comment
+        // Print values as CDL text comment
         nco_prn_var_val_cmt(var_aux, prn_flg);
-
-      } else if (tmp_sng[0])
-        (void) fprintf(stdout, " ; // %s\n", tmp_sng);
-      else
+      }else if(tmp_sng[0]){
+        (void)fprintf(stdout, " ; // %s\n", tmp_sng);
+      }else{
         (void) fprintf(stdout, " ; \n");
-
+      }
     }
 
     if(XML) (void)fprintf(stdout,"</values>\n");
@@ -2087,7 +2064,6 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
 
   } /* end if CDL_OR_JSN_OR_XML */
 
-
   if(var->nbr_dim == 0 && !dlm_sng && TRD){
     /* Variable is scalar, byte, or character */
     lmn=0L;
@@ -2148,7 +2124,6 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
 
   if(var->nbr_dim > 0 && !dlm_sng && TRD){
 
-
     /* Read coordinate dimensions if required */
     if(prn_flg->PRN_DMN_IDX_CRD_VAL){
 
@@ -2439,9 +2414,7 @@ lbl_chr_prn:
 
   } /* end if variable has more than one dimension */
 
-
-
-  /* Free value buffer *
+  /* Free value buffer
   if(var->type == NC_STRING)
      //nco_string_lst_free(var.val.sngp,var.sz);
       for(lmn=0;lmn<var->sz;lmn++)
@@ -2450,8 +2423,7 @@ lbl_chr_prn:
   var->val.vp=nco_free(var->val.vp);
 
   var->mss_val.vp=nco_free(var->mss_val.vp);
-  var->nm=(char *)nco_free(var->nm);
-  */
+  var->nm=(char *)nco_free(var->nm); */
 
   if(flg_malloc_unit_crd) unit_sng_crd=(char *)nco_free(unit_sng_crd);
   if(flg_malloc_unit_var) unit_sng_var=(char *)nco_free(unit_sng_var);
@@ -3417,7 +3389,6 @@ nco_prn_xml /* [fnc] Recursively print group contents */
     sub_grp_nm_fll=(char *)nco_free(sub_grp_nm_fll);
   } /* end loop over grp_idx */
 
-
   /* Mark end of output */
   if(grp_dpt == 0) (void)fprintf(stdout,"</netcdf>\n"); 
   if(grp_dpt > 0) (void)fprintf(stdout,"%*s</group>\n",grp_dpt*prn_flg->spc_per_lvl,spc_sng); 
@@ -3425,9 +3396,6 @@ nco_prn_xml /* [fnc] Recursively print group contents */
   return rcd;
 } /* end nco_grp_prn_xml() */
 
-
-
-
 int /* [rcd] Return code */
 nco_prn_jsn /* [fnc] Recursively print group contents */
 (const int nc_id, /* I [id] netCDF file ID */
@@ -3519,18 +3487,14 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
     dmn_lst[dmn_idx].nm=strdup(trv_tbl->lst_dmn[dmn_idx_grp[dmn_idx]].nm);
   } /* end loop over dmn_idx */
 
-  /* prn_ndn is the indentation of the group id tag -offsets for vars/atts/groups tag are from this */
-  if(grp_dpt==0)
-      prn_ndn=0;   
-  else
-      prn_ndn=2*grp_dpt*prn_flg->spc_per_lvl;
+  /* prn_ndn is indentation of group ID tag; offsets for vars/atts/groups tag are from this */
+  if(grp_dpt == 0) prn_ndn=0; else prn_ndn=2*grp_dpt*prn_flg->spc_per_lvl;
      
   nm_jsn=nm2sng_jsn(nco_gpe_evl_stb(prn_flg->gpe,trv_tbl->lst[obj_idx].nm_fll));
  
  if(grp_dpt==0) (void)fprintf(stdout,"{\n"); else (void)fprintf(stdout,"%*s\"%s\": {\n",prn_ndn,spc_sng,nm_jsn);
   nm_jsn=(char *)nco_free(nm_jsn);  
 
-
   if(dmn_nbr > 0 ) 
       (void)fprintf(stdout,"%*s\"dimensions\": {\n",prn_ndn+prn_flg->spc_per_lvl,spc_sng);
  
@@ -3539,11 +3503,7 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
     nm_jsn=nm2sng_jsn(dmn_lst[dmn_idx].nm);
     (void)fprintf(stdout,"%*s\"%s\": %lu",prn_ndn+2*prn_flg->spc_per_lvl,spc_sng,nm_jsn,(unsigned long)trv_tbl->lst_dmn[dmn_lst[dmn_idx].id].lmt_msa.dmn_cnt);   
     /* Add comma and carriage-return unless last element */
-    if(dmn_idx<dmn_nbr-1) 
-          (void)printf(",\n");
-    else
-      (void)printf("\n%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);         
-       
+    if(dmn_idx<dmn_nbr-1) (void)printf(",\n"); else (void)printf("\n%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);         
     nm_jsn=(char *)nco_free(nm_jsn);   
     JSN_BLOCK=True;    
   } /* end loop over dimension */
@@ -3555,7 +3515,6 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
 
   /* Create array to hold names and indices of extracted variables in this group */
   var_lst=(nm_id_sct *)nco_malloc(nbr_var*(sizeof(nm_id_sct)));
-
       
   for(var_idx=0;var_idx<nbr_var;var_idx++){
     /* Get variable name */
@@ -3598,67 +3557,46 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
 
   /* Sort variables alphabetically */
   if(var_nbr_xtr > 1) var_lst=nco_lst_srt_nm_id(var_lst,var_nbr_xtr,prn_flg->ALPHA_BY_STUB_GROUP);
-    
 
   for(var_idx=0;var_idx<var_nbr_xtr;var_idx++){
     trv_sct var_trv=trv_tbl->lst[var_lst[var_idx].id];
     /* Obtain variable ID */
     (void)nco_inq_varid(grp_id,var_trv.nm,&var_id);
-
    
-    /* deal with first iteration */   
-    if(var_idx==0) 
-    { 
-      if(JSN_BLOCK) 
-	(void)fprintf(stdout,",\n"); 
-      else
-	JSN_BLOCK=True;              
-         
+    /* Deal with first iteration */   
+    if(var_idx == 0){ 
+      if(JSN_BLOCK) (void)fprintf(stdout,",\n"); else JSN_BLOCK=True;              
       (void)fprintf(stdout,"%*s\"variables\": {\n",prn_ndn+prn_flg->spc_per_lvl,spc_sng);   
     } 
         
     /* DOES NOT include a return as we may wanna add a COMMA */
     prn_flg->ndn=prn_ndn+2*prn_flg->spc_per_lvl; 
-
     (void)nco_prn_var_dfn(nc_id,prn_flg,&var_trv);
 
-
     /* nco_prn_att() prints the final brace but no return - as we may need to add a comma */ 
-    if( prn_flg->PRN_VAR_METADATA  && nco_att_nbr(grp_id,var_id)>0)
-    {     
+    if(prn_flg->PRN_VAR_METADATA && nco_att_nbr(grp_id,var_id) > 0){     
       (void)fprintf(stdout,",\n");            
       //prn_flg->ndn=prn_ndn+2*prn_flg->spc_per_lvl;  
       (void)nco_prn_att(grp_id,prn_flg,var_id);
     } 
         
-    if( prn_flg->PRN_VAR_DATA)
-    {  
+    if( prn_flg->PRN_VAR_DATA){  
       (void)fprintf(stdout,",\n");  
       // prn_flg->ndn=prn_ndn+2*prn_flg->spc_per_lvl;  
       (void)nco_prn_var_val_trv(nc_id,prn_flg,&trv_tbl->lst[var_lst[var_idx].id],trv_tbl);      
-    }
-    else 
-    {
+    }else{
       (void)fprintf(stdout,"\n");        
     }
-    /* close json tag -but dont add return as we may need to add comma later*/
+    /* Close json tag -but dont add return as we may need to add comma later*/
     (void)fprintf(stdout,"%*s}%s",prn_flg->ndn,spc_sng, (var_idx<var_nbr_xtr-1 ?",\n":"\n")  );   
     
   } /* end loop over var_idx */
 
   /* close out json variable tag */
-  if(var_nbr_xtr>0) 
-    (void)fprintf(stdout,"%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng );   
-
-
-
-  if((nbr_att > 0 || (prn_flg->hdn && grp_dpt == 0)) && prn_flg->PRN_GLB_METADATA)
-  {
-    if(JSN_BLOCK) 
-      (void)fprintf(stdout,",\n"); 
-    else
-      JSN_BLOCK=True;              
+  if(var_nbr_xtr>0) (void)fprintf(stdout,"%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);   
 
+  if((nbr_att > 0 || (prn_flg->hdn && grp_dpt == 0)) && prn_flg->PRN_GLB_METADATA){
+    if(JSN_BLOCK) (void)fprintf(stdout,",\n"); else JSN_BLOCK=True;              
     prn_flg->ndn=prn_ndn+prn_flg->spc_per_lvl;  
     nco_prn_att(grp_id,prn_flg,NC_GLOBAL);
   }  
@@ -3670,7 +3608,6 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
   grp_ids=(int *)nco_malloc(nbr_grp*sizeof(int)); 
   rcd+=nco_inq_grps(grp_id,(int *)NULL,grp_ids);
 
-
   /*
   if( nbr_grp > 0) 
   {  
@@ -3707,20 +3644,14 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
 	  break;
     
     /* Is sub-group to be extracted? If so, recurse */
-    if(trv_tbl->lst[obj_idx].flg_xtr)
-    {  
+    if(trv_tbl->lst[obj_idx].flg_xtr){  
       /* print groups tag for first extracted group */ 
-      if(nbr_grp_xtr++==0)    
-      {   
-         if(JSN_BLOCK) 
-             (void)fprintf(stdout,",\n"); 
-
+      if(nbr_grp_xtr++ == 0){   
+         if(JSN_BLOCK) (void)fprintf(stdout,",\n"); 
          (void)fprintf(stdout,"%*s\"groups\": {\n",prn_ndn+prn_flg->spc_per_lvl,spc_sng);       
-
-      }  
-      else   
+      }else{
          (void)fprintf(stdout,",\n"); 
-
+      }
       rcd+=nco_prn_jsn(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);        
     }  
 
@@ -3728,19 +3659,13 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
     sub_grp_nm_fll=(char *)nco_free(sub_grp_nm_fll);
   } /* end loop over grp_idx */
 
-  /* print closing tag for group tag */
-  if( nbr_grp>0 && nbr_grp_xtr>0 )     
-    fprintf(stdout,"\n%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);         
-
+  /* Print closing tag for group tag */
+  if(nbr_grp > 0 && nbr_grp_xtr > 0) (void)fprintf(stdout,"\n%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);         
   if(grp_dpt ==0) (void)fprintf(stdout,"\n}\n"); 
-
   if(grp_dpt >0) (void)fprintf(stdout,"\n%*s}",prn_ndn,spc_sng);
   
-
-  
   return rcd;
-  } /* end nco_prn_jsn() */
-
+} /* end nco_prn_jsn() */
 
 nco_bool                            /* O [flg] Variable is compound */
 nco_prn_cpd_chk                     /* [fnc] Check whether variable is compound */
diff --git a/src/nco/nco_prn.h b/src/nco/nco_prn.h
index 8420bb4..b77dd20 100644
--- a/src/nco/nco_prn.h
+++ b/src/nco/nco_prn.h
@@ -118,7 +118,6 @@ nco_prn_cdl_trd /* [fnc] Recursively print group contents in cdl or trd format *
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
  const trv_tbl_sct * const trv_tbl); /* I [sct] Traversal table */
 
-
 int /* [rcd] Return code */
 nco_prn_jsn /* [fnc] Recursively print group contents in JSON format */
 (const int nc_id, /* I [id] netCDF file ID */
@@ -133,8 +132,6 @@ nco_prn_xml /* [fnc] Recursively print group contents in XML format */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
  const trv_tbl_sct * const trv_tbl); /* I [sct] Traversal table */
 
-
-
 nco_bool /* O [flg] Variable is compound */
 nco_prn_cpd_chk /* [fnc] Check whether variable is compound */
 (const trv_sct * const var_trv, /* I [sct] Variable to check */
diff --git a/src/nco/nco_rgr.c b/src/nco/nco_rgr.c
index 0f24264..70bbd84 100644
--- a/src/nco/nco_rgr.c
+++ b/src/nco/nco_rgr.c
@@ -145,7 +145,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
   /* Allocate */
   rgr=(rgr_sct *)nco_malloc(sizeof(rgr_sct));
   
-  /* Initialize variable directly or indirectly set via command-line (except for key-value arguments) */
+  /* Initialize variables directly or indirectly set via command-line (except for key-value arguments) */
   rgr->cmd_ln=strdup(cmd_ln); /* [sng] Command-line */
 
   rgr->flg_usr_rqs=False; /* [flg] User requested regridding */
@@ -718,6 +718,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   char cnv_sng_UC[]="Conventions"; /* [sng] Unidata standard     string (uppercase) */
   char cnv_sng_LC[]="conventions"; /* [sng] Unidata non-standard string (lowercase) */
   char cnv_sng_tps[]="Title"; /* [sng] Tempest uses "Title" not "Conventions" attribute */
+  char cnv_sng_ttl[]="title"; /* [sng] ERWG 7.1 weight_only uses "title" not "Conventions" attribute */
   char name0_sng[]="name0"; /* [sng] Attribute where Tempest stores least-rapidly-varying dimension name */
   
   long att_sz;
@@ -727,7 +728,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   nco_rgr_mpf_typ_enm nco_rgr_mpf_typ=nco_rgr_mpf_nil; /* [enm] Type of remapping file */
   nco_rgr_typ_enm nco_rgr_typ=nco_rgr_grd_nil; /* [enm] Type of grid conversion */
   
-  /* Look for map-type signature in Conventions attribute */
+  /* Look for map-type signature in [cC]onventions or [tT]itle attribute */
   cnv_sng=cnv_sng_UC;
   rcd=nco_inq_att_flg(in_id,NC_GLOBAL,cnv_sng,&att_typ,&att_sz);
   if(rcd != NC_NOERR){
@@ -736,11 +737,18 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd=nco_inq_att_flg(in_id,NC_GLOBAL,cnv_sng,&att_typ,&att_sz);
   } /* endif lowercase */
   if(rcd != NC_NOERR){
-    /* Re-try with Tempest */
+    /* Re-try with Tempest "Title" */
     cnv_sng=cnv_sng_tps;
     rcd=nco_inq_att_flg(in_id,NC_GLOBAL,cnv_sng,&att_typ,&att_sz);
   } /* endif Tempest */
+  if(rcd != NC_NOERR){
+    /* Re-try with ERWG "title" */
+    /* ERWG 7.1+ --weight_only has "title" == "ESMF Regrid Weight Generator" and no "Conventions" */
+    cnv_sng=cnv_sng_ttl;
+    rcd=nco_inq_att_flg(in_id,NC_GLOBAL,cnv_sng,&att_typ,&att_sz);
+  } /* endif Tempest */
   
+  /* If "Conventions" attribute was found, it determines map-file type... */
   if(rcd == NC_NOERR && att_typ == NC_CHAR){
     att_val=(char *)nco_malloc((att_sz+1L)*nco_typ_lng(att_typ));
     rcd+=nco_get_att(in_id,NC_GLOBAL,cnv_sng,att_val,att_typ);
@@ -748,8 +756,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     att_val[att_sz]='\0';
     /* ESMF conventions */
     if(strstr(att_val,"NCAR-CSM")) nco_rgr_mpf_typ=nco_rgr_mpf_ESMF;
-    if(strstr(att_val,"SCRIP")) nco_rgr_mpf_typ=nco_rgr_mpf_SCRIP;
-    if(strstr(att_val,"Tempest")) nco_rgr_mpf_typ=nco_rgr_mpf_Tempest;
+    else if(strstr(att_val,"SCRIP")) nco_rgr_mpf_typ=nco_rgr_mpf_SCRIP;
+    else if(strstr(att_val,"Tempest")) nco_rgr_mpf_typ=nco_rgr_mpf_Tempest;
+    else if(strstr(att_val,"ESMF Regrid Weight Generator")) nco_rgr_mpf_typ=nco_rgr_mpf_ESMF_weight_only;
     if(nco_rgr_mpf_typ == nco_rgr_mpf_nil) (void)fprintf(stderr,"%s: ERROR %s unrecognized map-type specified in attribute Conventions = %s\n",nco_prg_nm_get(),fnc_nm,att_val);
     if(att_val) att_val=(char *)nco_free(att_val);
   } /* end rcd && att_typ */
@@ -764,7 +773,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd+=nco_inq_dimid(in_id,"dst_grid_rank",&dst_grid_rank_id);
     rcd+=nco_inq_dimid(in_id,"num_links",&num_links_id);
     rcd+=nco_inq_dimid(in_id,"num_wgts",&num_wgts_id);
-  break;
+    break;
+  case nco_rgr_mpf_ESMF_weight_only:
+    rcd+=nco_inq_dimid(in_id,"n_s",&num_links_id);
+    break;
   case nco_rgr_mpf_ESMF:
   case nco_rgr_mpf_Tempest:
     rcd+=nco_inq_dimid(in_id,"n_a",&src_grid_size_id);
@@ -773,8 +785,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd+=nco_inq_dimid(in_id,"nv_b",&dst_grid_corners_id);
     rcd+=nco_inq_dimid(in_id,"src_grid_rank",&src_grid_rank_id);
     rcd+=nco_inq_dimid(in_id,"dst_grid_rank",&dst_grid_rank_id);
-    rcd+=nco_inq_dimid(in_id,"n_s",&num_links_id);
     if(nco_rgr_mpf_typ != nco_rgr_mpf_Tempest) rcd+=nco_inq_dimid(in_id,"num_wgts",&num_wgts_id);
+    rcd+=nco_inq_dimid(in_id,"n_s",&num_links_id);
     break;
   default:
     (void)fprintf(stderr,"%s: ERROR %s unknown map-file type\n",nco_prg_nm_get(),fnc_nm);
@@ -787,16 +799,26 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* end switch */
 
   /* Use dimension IDs to get dimension sizes */
-  rcd+=nco_inq_dimlen(in_id,src_grid_size_id,&rgr_map.src_grid_size);
-  rcd+=nco_inq_dimlen(in_id,dst_grid_size_id,&rgr_map.dst_grid_size);
-  rcd+=nco_inq_dimlen(in_id,src_grid_corners_id,&rgr_map.src_grid_corners);
-  rcd+=nco_inq_dimlen(in_id,dst_grid_corners_id,&rgr_map.dst_grid_corners);
-  rcd+=nco_inq_dimlen(in_id,src_grid_rank_id,&rgr_map.src_grid_rank);
-  rcd+=nco_inq_dimlen(in_id,dst_grid_rank_id,&rgr_map.dst_grid_rank);
   rcd+=nco_inq_dimlen(in_id,num_links_id,&rgr_map.num_links);
-  /* TempestRemap does not generate num_wgts */
-  if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest) rgr_map.num_wgts=int_CEWI; else rcd+=nco_inq_dimlen(in_id,num_wgts_id,&rgr_map.num_wgts); 
-  assert(rgr_map.src_grid_size < INT_MAX && rgr_map.dst_grid_size < INT_MAX);
+  if(nco_rgr_mpf_typ != nco_rgr_mpf_ESMF_weight_only){
+    rcd+=nco_inq_dimlen(in_id,src_grid_size_id,&rgr_map.src_grid_size);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_size_id,&rgr_map.dst_grid_size);
+    rcd+=nco_inq_dimlen(in_id,src_grid_corners_id,&rgr_map.src_grid_corners);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_corners_id,&rgr_map.dst_grid_corners);
+    rcd+=nco_inq_dimlen(in_id,src_grid_rank_id,&rgr_map.src_grid_rank);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_rank_id,&rgr_map.dst_grid_rank);
+    /* TempestRemap does not generate num_wgts */
+    if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest) rgr_map.num_wgts=int_CEWI; else rcd+=nco_inq_dimlen(in_id,num_wgts_id,&rgr_map.num_wgts); 
+    assert(rgr_map.src_grid_size < INT_MAX && rgr_map.dst_grid_size < INT_MAX);
+  }else{
+    rgr_map.src_grid_size=long_CEWI;
+    rgr_map.dst_grid_size=long_CEWI;
+    rgr_map.src_grid_corners=long_CEWI;
+    rgr_map.dst_grid_corners=long_CEWI;
+    rgr_map.src_grid_rank=long_CEWI;
+    rgr_map.dst_grid_rank=long_CEWI;
+    rgr_map.num_wgts=int_CEWI;
+  } /* !ESMF_weight_only */
   
   cnv_sng=strdup("normalization");
   nco_rgr_nrm_typ_enm nco_rgr_nrm_typ=nco_rgr_nrm_nil;
@@ -812,8 +834,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     if(strstr(att_val,"none")) nco_rgr_nrm_typ=nco_rgr_nrm_none;
     if(att_val) att_val=(char *)nco_free(att_val);
   }else{
-    /* 20150712: Tempest does not store a normalization attribute */
-    if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest) nco_rgr_nrm_typ=nco_rgr_nrm_unknown;
+    /* 20150712: Tempest does not store a normalization attribute
+       20170620: ESMF weight_only does not store a normalization attribute */
+    if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest || nco_rgr_mpf_typ == nco_rgr_mpf_ESMF_weight_only) nco_rgr_nrm_typ=nco_rgr_nrm_unknown;
   } /* endif normalization */
   assert(nco_rgr_nrm_typ != nco_rgr_nrm_nil);
   if(cnv_sng) cnv_sng=(char *)nco_free(cnv_sng);
@@ -847,6 +870,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     nco_exit(EXIT_FAILURE);
   } /* !msk */
     
+  /* Got to here in bullet-proofing code for weight-only map-files */
+  if(nco_rgr_mpf_typ == nco_rgr_mpf_ESMF_weight_only) (void)fprintf(stderr,"%s: WARNING %s reached end of ESMF_weight_only section\n",nco_prg_nm_get(),fnc_nm);
+  assert(nco_rgr_mpf_typ != nco_rgr_mpf_ESMF_weight_only);
+ 
   /* Set type of grid conversion */
   if(rgr_map.src_grid_rank == 1 && rgr_map.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_1D_to_1D;
   if(rgr_map.src_grid_rank == 1 && rgr_map.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_1D_to_2D;
@@ -893,13 +920,16 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd+=nco_inq_varid(in_id,"remap_matrix",&wgt_raw_id); /* NB: remap_matrix[num_links,num_wgts] != S[n_s] */
     break;
   case nco_rgr_mpf_ESMF:
+  case nco_rgr_mpf_ESMF_weight_only:
   case nco_rgr_mpf_Tempest:
-    rcd+=nco_inq_varid(in_id,"area_b",&area_dst_id); /* SCRIP: dst_grid_area */
-    rcd+=nco_inq_varid(in_id,"xc_b",&dst_grd_ctr_lon_id); /* SCRIP: dst_grid_center_lon */
-    rcd+=nco_inq_varid(in_id,"yc_b",&dst_grd_ctr_lat_id); /* SCRIP: dst_grid_center_lat */
-    rcd+=nco_inq_varid(in_id,"xv_b",&dst_grd_crn_lon_id); /* SCRIP: dst_grid_corner_lon */
-    rcd+=nco_inq_varid(in_id,"yv_b",&dst_grd_crn_lat_id); /* SCRIP: dst_grid_corner_lat */
-    rcd+=nco_inq_varid(in_id,"frac_b",&frc_dst_id); /* SCRIP: dst_grid_frac */
+    if(nco_rgr_mpf_typ != nco_rgr_mpf_ESMF_weight_only){
+      rcd+=nco_inq_varid(in_id,"area_b",&area_dst_id); /* SCRIP: dst_grid_area */
+      rcd+=nco_inq_varid(in_id,"xc_b",&dst_grd_ctr_lon_id); /* SCRIP: dst_grid_center_lon */
+      rcd+=nco_inq_varid(in_id,"yc_b",&dst_grd_ctr_lat_id); /* SCRIP: dst_grid_center_lat */
+      rcd+=nco_inq_varid(in_id,"xv_b",&dst_grd_crn_lon_id); /* SCRIP: dst_grid_corner_lon */
+      rcd+=nco_inq_varid(in_id,"yv_b",&dst_grd_crn_lat_id); /* SCRIP: dst_grid_corner_lat */
+      rcd+=nco_inq_varid(in_id,"frac_b",&frc_dst_id); /* SCRIP: dst_grid_frac */
+    } /* !nco_rgr_mpf_ESMF_weight_only */
     rcd+=nco_inq_varid(in_id,"row",&row_dst_adr_id); /* SCRIP: dst_address */
     rcd+=nco_inq_varid(in_id,"col",&col_src_adr_id); /* SCRIP: src_address */
     rcd+=nco_inq_varid(in_id,"S",&wgt_raw_id); /* NB: remap_matrix[num_links,num_wgts] != S[n_s] */
@@ -913,6 +943,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     return NCO_ERR;
     break;
   } /* end switch */
+
   /* Obtain fields whose presence depends on mapfile type */
   nco_bool flg_msk_out=rgr->flg_msk_out; /* [flg] Add mask to output */
   if(flg_msk_out){
@@ -1407,8 +1438,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     lat_wgt_ttl=0.0;
     for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_ttl+=lat_wgt_out[idx];
     lat_wgt_ttl_xpc=sin(dgr2rdn*lat_bnd_out[2*(lat_nbr_out-1)+1])-sin(dgr2rdn*lat_bnd_out[0]);
-    if(nco_grd_lat_typ != nco_grd_lat_unk) assert(1.0-lat_wgt_ttl/lat_wgt_ttl_xpc < eps_rlt);
-    if(lat_wgt_ttl_xpc < 0.0) abort();  /* CEWI Use lat_wgt_ttl_xpc at least once outside of assert() to avoid gcc 4.8.2 set-but-not-used warning */
+    if(nco_grd_lat_typ != nco_grd_lat_unk){
+      assert(1.0-lat_wgt_ttl/lat_wgt_ttl_xpc < eps_rlt);
+      if(lat_wgt_ttl_xpc < 0.0) abort(); /* CEWI Use lat_wgt_ttl_xpc at least once outside of assert() to avoid gcc 4.8.2 set-but-not-used warning */
+    } /* !nco_grd_lat_unk */
   } /* !flg_grd_out_rct */
     
   /* When possible, ensure area_out is non-zero
@@ -1678,8 +1711,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !sbs_ptr */
     /* Final coordinate name begins where coordinate string starts */
     crd_nm[crd_nbr]=crd_dpl;
+    /* Change crd_nbr from 0-based index to actual coordinate number */
+    crd_nbr++;
     if(crd_nbr < 2){
-      (void)fprintf(stderr,"%s: WARNING %s found only %d coordinates in coordinates attribute \"%s\", at least two are required. Turning-off CF coordinates search.\n",nco_prg_nm_get(),fnc_nm,crd_nbr,cf->crd_sng);
+      (void)fprintf(stderr,"%s: WARNING %s found only %d coordinate(s) in \"coordinates\" attribute \"%s\", at least two are required. Turning-off CF coordinates search.\n",nco_prg_nm_get(),fnc_nm,crd_nbr,cf->crd_sng);
       goto skp_cf;
     } /* !crd_nbr */
     /* If more than two coordinate names are present, choose first two (searching backwards from end) with "degree" in units attributes, otherwise just choose first two */
@@ -1852,10 +1887,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     else if((rcd=nco_inq_dimid_flg(in_id,"Cell_Along_Swath:mod04",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("Cell_Along_Swath:mod04"); /* MODIS MOD04 L2 */
     else if((rcd=nco_inq_dimid_flg(in_id,"Cell_Along_Swath_mod04",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("Cell_Along_Swath_mod04"); /* MODIS MOD04 L2 (ncl_convert2nc changes colon to underscore) */
     else if((rcd=nco_inq_dimid_flg(in_id,"CO_Latitude",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("CO_Latitude");
+    else if((rcd=nco_inq_dimid_flg(in_id,"j",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("j"); /* CMIP5 NorESM1 ocean */
+    else if((rcd=nco_inq_dimid_flg(in_id,"latitude0",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("latitude0"); /* Oxford */
     else if((rcd=nco_inq_dimid_flg(in_id,"y",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("y"); /* NEMO */
     else if((rcd=nco_inq_dimid_flg(in_id,"x",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("x"); /* NSIDC polar stereographic (NB: unfortunate incompatible conflict between NEMO & NSIDC names) */
     else{
-      (void)fprintf(stdout,"%s: ERROR %s reports unable to find latitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of latitude dimension name with --rgr lat_nm=name\n",nco_prg_nm_get(),fnc_nm);
+      (void)fprintf(stdout,"%s: ERROR %s reports unable to find latitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of input latitude dimension name with --rgr lat_nm_in=name\n",nco_prg_nm_get(),fnc_nm);
       nco_exit(EXIT_FAILURE);
     } /* !lat */
     rcd=nco_inq_dimlen(in_id,dmn_id_lat,&lat_nbr_in_dat);
@@ -1883,10 +1920,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     else if((rcd=nco_inq_dimid_flg(in_id,"GeoXTrack:L2_Standard_atmospheric&surface_product",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("GeoXTrack:L2_Standard_atmospheric&surface_product"); /* AIRS L2 HDF */
     else if((rcd=nco_inq_dimid_flg(in_id,"Cell_Across_Swath:mod04",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("Cell_Across_Swath:mod04"); /* MODIS MOD04 L2 */
     else if((rcd=nco_inq_dimid_flg(in_id,"Cell_Across_Swath_mod04",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("Cell_Across_Swath_mod04"); /* MODIS MOD04 L2 (ncl_convert2nc changes colon to underscore) */
+    else if((rcd=nco_inq_dimid_flg(in_id,"i",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("i"); /* CMIP5 NorESM1 ocean */
+    else if((rcd=nco_inq_dimid_flg(in_id,"longitude0",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("longitude0"); /* Oxford */
     else if((rcd=nco_inq_dimid_flg(in_id,"x",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("x"); /* NEMO */
     else if((rcd=nco_inq_dimid_flg(in_id,"y",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("y"); /* NSIDC polar stereographic (NB: unfortunate incompatible conflict between NEMO & NSIDC names) */
     else{
-      (void)fprintf(stdout,"%s: ERROR %s reports unable to find longitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of longitude dimension name with --rgr lon_nm=name\n",nco_prg_nm_get(),fnc_nm);
+      (void)fprintf(stdout,"%s: ERROR %s reports unable to find longitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of input longitude dimension name with --rgr lon_nm_in=name\n",nco_prg_nm_get(),fnc_nm);
       nco_exit(EXIT_FAILURE);
     } /* !lat */
     rcd=nco_inq_dimlen(in_id,dmn_id_lon,&lon_nbr_in_dat);
@@ -1917,13 +1956,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      NEMO: nav_lat, nav_lon
      OCO2: latitude_bnds, longitude_bnds
      OMI DOMINO: Latitude, LatitudeCornerpoints, Longitude, LongitudeCornerpoints
+     Oxford: global_latitude0, global_longitude0, latitude0, longitude0
      POP: TLAT, TLONG, ULAT, ULONG  (NB: CICE uses ?LON and POP uses ?LONG) (POP does not archive spatial bounds)
      TRMM: Latitude, Longitude
      UV-CDAT regridder: bounds_lat, bounds_lon
      Unknown: XLAT_M, XLONG_M
      WRF: XLAT, XLONG */
-  const int var_xcl_lst_nbr=46; /* [nbr] Number of objects on exclusion list */
-  const char *var_xcl_lst[]={"/area","/areaCell","/gridcell_area","/gw","/LAT","/lat","/latCell","/Latitude","/latitude","/nav_lat","/slat","/TLAT","/ULAT","/XLAT","/XLAT_M","/CO_Latitude","/S1_Latitude","/lat_bnds","/lat_vertices","/latt_bounds","/latu_bounds","/latitude_bnds","/LatitudeCornerpoints","/bounds_lat","/LON","/lon","/lonCell","/Longitude","/longitude","/nav_lon","/slon","/TLON","/TLONG","/ULON","/ULONG","/XLONG","/XLONG_M","/CO_Longitude","/S1_Longitude","/lon_bnds","/lon_v [...]
+  const int var_xcl_lst_nbr=50; /* [nbr] Number of objects on exclusion list */
+  const char *var_xcl_lst[]={"/area","/areaCell","/gridcell_area","/gw","/LAT","/lat","/latCell","/Latitude","/latitude","/nav_lat","/global_latitude0","/latitude0","/slat","/TLAT","/ULAT","/XLAT","/XLAT_M","/CO_Latitude","/S1_Latitude","/lat_bnds","/lat_vertices","/latt_bounds","/latu_bounds","/latitude_bnds","/LatitudeCornerpoints","/bounds_lat","/LON","/lon","/lonCell","/Longitude","/longitude","/nav_lon","/global_longitude0","/longitude0","/slon","/TLON","/TLONG","/ULON","/ULONG","/X [...]
   int var_cpy_nbr=0; /* [nbr] Number of copied variables */
   int var_rgr_nbr=0; /* [nbr] Number of regridded variables */
   int var_xcl_nbr=0; /* [nbr] Number of deleted variables */
@@ -3273,7 +3313,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	   Extensive variables (population, counts, numbers of things) depend on gridcell boundaries
 	   Extensive variables are the exception in models, yet are commonly used for sampling information, e.g., 
 	   number of photons, number of overpasses 
-	   Pass NCO the extensive variable list with, e.g., --xtn=TSurfStd_ct,... */
+	   Pass extensive variable list to NCO with, e.g., --xtn=TSurfStd_ct,... */
 	  
 	/* Apply weights */
 	if(!has_mss_val){
@@ -3596,7 +3636,7 @@ nco_lat_wgt_gss /* [fnc] Compute and return sine of Gaussian latitudes and their
   lat_sin_p1=(double *)nco_malloc((lat_nbr+1)*sizeof(double)); // Sine of Gaussian latitudes double precision
   wgt_Gss_p1=(double *)nco_malloc((lat_nbr+1)*sizeof(double)); // Gaussian weights double precision
     
-  /* Use Newton iteration to find abscissas */
+  /* Use Newton iteration to find abscissae */
   c_cff=0.25*(1.0-4.0/(pi*pi));
   lat_nbr_dbl=lat_nbr;
   lat_nbr_rcp2=lat_nbr/2; // NB: Integer arithmetic
@@ -3654,7 +3694,7 @@ nco_lat_wgt_gss /* [fnc] Compute and return sine of Gaussian latitudes and their
   //memcpy(lat_sin,lat_sin_p1,lat_nbr*sizeof(double));
   //memcpy(wgt_Gss,wgt_Gss_p1,lat_nbr*sizeof(double));
   
-  /* Reverse and shift arrays because original CCM code algorithm computed latitudes from north-to-south
+  /* Reverse and shift arrays because original CCM code algorithm computes latitudes from north-to-south
      Shift by one to remove Fortran offset in p1 arrays */
   for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
     lat_sin[lat_idx]=lat_sin_p1[lat_nbr-lat_idx];
@@ -3689,9 +3729,9 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
      semi-perimeter = half-perimeter of triangle = 0.5*(a+b+c)
      Spherical Excess (SE) difference between the sum of the angles of a spherical triangle area and a planar triangle area with same interior angles (which has sum equal to pi)
      SE is also the solid angle subtended by the spherical triangle and that's, well, astonishing and pretty cool
-     Wikipedia shows a better SE formula for triangles which are ill-conditioned for L'Huillier's formula because a = b ~ 0.5c
+     Wikipedia shows a better SE formula for triangles which are ill-conditioned for L'Huilier's formula because a = b ~ 0.5c
      https://en.wikipedia.org/wiki/Spherical_trigonometry#Area_and_spherical_excess 
-     See also interesting discussion of L'Huillier by Charles Karney who suggests his own alternative:
+     See also interesting discussion of L'Huilier by Charles Karney who suggests his own alternative:
      http://osgeo-org.1560.x6.nabble.com/Area-of-a-spherical-polygon-td3841625.html
      The discussion mentions Mil94
      Robert D. Miller, Computing the area of a spherical polygon, Graphic Gems IV, chapter II.4, pages 132-137.
@@ -3718,7 +3758,7 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
      1. Girard method: Loses precision due to mismatch between pi and small spherical excesses
         A. Find interior angles/arc-lengths (a,b,c,d...) using spherical law of cosines along each edge
         B. Apply generalized Girard formula SE_n = Sum(A_n) - (N-2) - pi
-     2. L'Huillier method, N-2 triangle version by Zender: 
+     2. L'Huilier method, N-2 triangle version by Zender: 
         Convert polygon into triangles by cycling spoke through all sides from common apex
         This method requires computation of N-2 (not N) triangles, though fewer sides due to optimization
 	It works on all convex polygons (interior angles less than 180) but not, in general, concave polygons
@@ -3728,16 +3768,16 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
 	   ii. Third vertice of preceding triangle becomes second vertice of next triangle
 	   iii. Next non-identical point becomes last vertice of next triangle
 	   iv. Side C of previous triangle is side A of next triangle
-	B. For each triangle, compute area with L'Huillier formula unless A = B ~ 0.5*C
-     3. L'Huillier method, N triangle version by Taylor: 
+	B. For each triangle, compute area with L'Huilier formula unless A = B ~ 0.5*C
+     3. L'Huilier method, N triangle version by Taylor: 
         Compute polygon centroid and treat this as hub from which spokes are drawn to all vertices
         This method requires computation of N triangles, though fewer sides due to optimization
 	Moreover, it works on all convex polygons and on slightly concave polygons
 	Centroid/hub has clear view of interior of most simple concave polygons
-     4. L'Huillier method with exact RLL grids by Zender and Agress 20160918
+     4. L'Huilier method with exact RLL grids by Zender and Agress 20160918
         A. Decompose polygon into triangles via and method (e.g., method 2 or 3 above)
 	B. Determine whether triangle is spherical or contains RLL (constant latitude)
-	C. Spherical triangles use L'Huillier, RLL triangles use series expansion */
+	C. Spherical triangles use L'Huilier, RLL triangles use series expansion */
   const char fnc_nm[]="nco_sph_plg_area()";
   const double dgr2rdn=M_PI/180.0;
   short int bnd_idx;
@@ -3881,7 +3921,7 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
       } /* !ill */
       /* Semi-perimeter */
       prm_smi=0.5*(ngl_a+ngl_b+ngl_c);
-      /* L'Huillier's formula */
+      /* L'Huilier's formula */
       xcs_sph_qtr_tan=sqrt(tan(0.5*prm_smi)*tan(0.5*(prm_smi-ngl_a))*tan(0.5*(prm_smi-ngl_b))*tan(0.5*(prm_smi-ngl_c)));
       xcs_sph=4.0*atan(xcs_sph_qtr_tan);
       area[col_idx]+=xcs_sph;
@@ -4150,7 +4190,7 @@ nco_rgr_mth_sng /* [fnc] Convert regridding method enum to string */
   case nco_rgr_mth_conservative: return "Conservative remapping";
   case nco_rgr_mth_bilinear: return "Bilinear remapping";
   case nco_rgr_mth_none: return "none";
-  case nco_rgr_mth_unknown: return "Unknown (TempestRemap)";
+  case nco_rgr_mth_unknown: return "Unknown (TempestRemap or ESMF_weight_only)";
   default: nco_dfl_case_generic_err(); break;
   } /* end switch */
 
@@ -4164,9 +4204,10 @@ nco_rgr_mpf_sng /* [fnc] Convert mapfile generator enum to string */
 {
   /* Purpose: Convert mapfile generator enum to string */
   switch(nco_rgr_mpf_typ){
-  case nco_rgr_mpf_ESMF: return "ESMF Offline Regridding Weight Generator (either ESMF_RegridWeightGen directly or via NCL)";
+  case nco_rgr_mpf_ESMF: return "ESMF Offline Regridding Weight Generator (ERWG), either from ESMF_RegridWeightGen directly or via NCL";
   case nco_rgr_mpf_SCRIP: return "SCRIP (original LANL package)";
   case nco_rgr_mpf_Tempest: return "TempestRemap (GenerateOfflineMap)";
+  case nco_rgr_mpf_ESMF_weight_only: return "ESMF Offline Regridding Weight Generator (ERWG), either from ESMF_RegridWeightGen directly or via NCL, with --weight_only option from ERWG 7.1+";
   default: nco_dfl_case_generic_err(); break;
   } /* end switch */
 
@@ -4183,7 +4224,7 @@ nco_rgr_nrm_sng /* [fnc] Convert regridding normalization enum to string */
   case nco_rgr_nrm_fracarea: return "fracarea";
   case nco_rgr_nrm_destarea: return "destarea";
   case nco_rgr_nrm_none: return "none";
-  case nco_rgr_nrm_unknown: return "Unknown (TempestRemap)";
+  case nco_rgr_nrm_unknown: return "Unknown (TempestRemap or ESMF_weight_only)";
   default: nco_dfl_case_generic_err(); break;
   } /* end switch */
 
@@ -5756,8 +5797,10 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     } /* !sbs_ptr */
     /* Final coordinate name begins where coordinate string starts */
     crd_nm[crd_nbr]=crd_dpl;
+    /* Change crd_nbr from 0-based index to actual coordinate number */
+    crd_nbr++;
     if(crd_nbr < 2){
-      (void)fprintf(stderr,"%s: WARNING %s found only %d coordinates in coordinates attribute \"%s\", at least two are required. Turning-off CF coordinates search.\n",nco_prg_nm_get(),fnc_nm,crd_nbr,cf->crd_sng);
+      (void)fprintf(stderr,"%s: WARNING %s found only %d coordinate(s) in \"coordinates\" attribute \"%s\", at least two are required. Turning-off CF coordinates search.\n",nco_prg_nm_get(),fnc_nm,crd_nbr,cf->crd_sng);
       goto skp_cf;
     } /* !crd_nbr */
     /* If more than two coordinate names are present, choose first two (searching backwards from end) with "degree" in units attributes, otherwise just choose first two */
@@ -5909,6 +5952,8 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     else if((rcd=nco_inq_varid_flg(in_id,"ULAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("ULAT"); /* CICE, POP */
     else if((rcd=nco_inq_varid_flg(in_id,"latCell",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("latCell"); /* MPAS-O/I */
     else if((rcd=nco_inq_varid_flg(in_id,"nav_lat",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("nav_lat"); /* NEMO */
+    else if((rcd=nco_inq_varid_flg(in_id,"global_latitude0",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("global_latitude0"); /* Oxford */
+    else if((rcd=nco_inq_varid_flg(in_id,"latitude0",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("latitude0"); /* Oxford NB: Must search for global_* first */
     else if((rcd=nco_inq_varid_flg(in_id,"CO_Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("CO_Latitude"); /* MLS */
     else if((rcd=nco_inq_varid_flg(in_id,"S1_Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("S1_Latitude"); /* GPM */
     else if((rcd=nco_inq_varid_flg(in_id,"yc",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("yc"); /* RTM */
@@ -5929,6 +5974,8 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     else if((rcd=nco_inq_varid_flg(in_id,"ULONG",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("ULONG"); /* POP */
     else if((rcd=nco_inq_varid_flg(in_id,"lonCell",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("lonCell"); /* MPAS-O/I */
     else if((rcd=nco_inq_varid_flg(in_id,"nav_lon",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("nav_lon"); /* NEMO */
+    else if((rcd=nco_inq_varid_flg(in_id,"global_longitude0",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("global_longitude0"); /* Oxford NB: Must search for global_* first */
+    else if((rcd=nco_inq_varid_flg(in_id,"longitude0",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("longitude0"); /* Oxford */
     else if((rcd=nco_inq_varid_flg(in_id,"CO_Longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("CO_Longitude"); /* MLS */
     else if((rcd=nco_inq_varid_flg(in_id,"S1_Longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("S1_Longitude"); /* GPM */
     else if((rcd=nco_inq_varid_flg(in_id,"xc",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("xc"); /* RTM */
@@ -6140,8 +6187,13 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 
   msk_nm_in=rgr->msk_var;
   if(msk_nm_in){
-    /* User-supplied name overrides database */
-    rcd=nco_inq_varid(in_id,msk_nm_in,&msk_id);
+    if(!strcasecmp(msk_nm_in,"none")){
+      /* 20170814: Some variables named "*mask*" are, e.g., quality control masks not regridding masks per se */
+      msk_nm_in=(char *)nco_free(msk_nm_in);
+    }else{
+      /* User-supplied name overrides database */
+      rcd=nco_inq_varid(in_id,msk_nm_in,&msk_id);
+    } /* !msk_nm_in */
   }else{
     /* Otherwise search database */
     if((rcd=nco_inq_varid_flg(in_id,"mask",&msk_id)) == NC_NOERR) msk_nm_in=strdup("mask");
@@ -6154,7 +6206,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
   /* Mask field requires special handling for non-conformant models */
   if(msk_id != NC_MIN_INT){
     /* 20151201: All models tested define mask as NC_INT except CICE which uses NC_FLOAT
-       20160111: No observations tested define mask except AMSR which uses NC_SHORT to store bitmasks. Bitmask is 1 for missing data, and up to 128 for various quality levels of valid data. Hence, almost better to ignore AMSR mask variable. */
+       20160111: Few observations tested define mask. Exceptions include AMSR and GHRSST. AMSR uses NC_SHORT to store bitmasks. Bitmask is 1 for missing data, and up to 128 for various quality levels of valid data. Hence, almost better to ignore AMSR mask variable. GHRSST uses NC_BYTE for its 3D "mask" bit-mask of surface-type values 1,2,4,8,16. */
     rcd=nco_inq_varndims(in_id,msk_id,&msk_rnk_nbr);
     if(msk_rnk_nbr != grd_rnk_nbr && nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO %s reports input mask variable \"%s\" is rank %d while grid is rank %ld so will use first timestep/layer to determine output mask\n",nco_prg_nm_get(),fnc_nm,msk_nm_in,msk_rnk_nbr,grd_rnk_nbr);
     rcd=nco_inq_vartype(in_id,msk_id,&msk_typ);
@@ -6913,7 +6965,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
        20150526: T42 grid from SCRIP and related maps are only accurate to ~eight digits
        20150611: map_ne120np4_to_fv801x1600_bilin.150418.nc has yc_b[1600]=-89.775000006 not expected exact value lat_ctr[1]=-89.775000000000006
        20170521: T62 grid from NCEP-NCAR Reanalysis 1 worse than single precision, has yc_[192]=-86.6531 not expected exact value lat_ctr[1]=-86.6532 */
-    if(lat_ctr[0] > 0.0) (void)fprintf(stderr,"%s: WARNING %s reports lat_ctr[0] = %g is positive and lat_ctr[%ld] = %g is negative. Grid inferral currently assumes 2D global grids run from south-to-north, not north-to-south. Global N-to-S grids may not be correctly recognized. Please contact us if full support for inferring N-to-S grids is important to you.\nHINT: Re-try inferring grid after reversing input dataset's latitude coordinate (with, e.g., ncpdq -a time,-lat,lon in.nc out.nc)\ [...]
+    if(lat_ctr[0] > lat_ctr[lat_nbr-1L]) (void)fprintf(stderr,"%s: WARNING %s reports lat_ctr[0] = %g > %g = lat_ctr[%ld]. Grid inferral currently assumes 2D grids run from south-to-north, not north-to-south. N-to-S grids may not be correctly recognized. Please contact us if full support for inferring N-to-S grids is important to you.\nHINT: If present command fails, re-try inferring grid after reversing input dataset's latitude coordinate (with, e.g., ncpdq -a time,-lat,lon in.nc out.nc [...]
     if((float)lat_ctr[1] == (float)lat_ctr_tst_eqa) lat_typ=nco_grd_lat_eqa;
     if((float)lat_ctr[1] == (float)lat_ctr_tst_fv) lat_typ=nco_grd_lat_fv;
     double *lat_sin=NULL_CEWI; // [frc] Sine of Gaussian latitudes double precision
@@ -7278,9 +7330,14 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
        Applications: 
        ALM/CLM mask (landmask) is NC_FLOAT and defines but does not use NC_FLOAT missing value
        CICE mask (tmask/umask) is NC_FLOAT and defines and uses NC_FLOAT missing value
-       AMSR mask is NC_SHORT and has no missing value */
-  switch(msk_typ){
-    case NC_FLOAT:
+       AMSR mask is NC_SHORT and has no missing value
+       GHRSST mask is NC_BYTE and is a multi-valued surface-type flag with missing value == -1b */
+    if(msk_typ != NC_INT){
+      if(nco_dbg_lvl_get() == nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s mask variable \"%s\" has odd type = %s. Re-run with higher debugging level for more information.\n",nco_prg_nm_get(),fnc_nm,msk_nm,nco_typ_sng(msk_typ));
+      if(nco_dbg_lvl_get() > nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s mask variable \"%s\" has odd type = %s. Regridding weight generators require a mask variable of type NC_INT to specify points to include/exclude as sources/destinations. Points where the mask variable is zero will be excluded (ignored) in regridding, all other points will be included. When inferring gridfiles, NCO assumes the first variable with a \"mask\"-like name (\"mask\", \"Mask\", \"grid_imask\", \"landmask [...]
+    } /* msk_typ */
+    switch(msk_typ){
+      case NC_FLOAT:
       if(has_mss_val_msk){
 	const float mss_val_flt=mss_val_msk_dbl;
 	for(idx=0;idx<grd_sz_nbr;idx++)
@@ -7323,8 +7380,19 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	//	for(idx=0;idx<grd_sz_nbr;idx++) if(msk[idx] == 1) msk[idx]=0;
       } /* !mss_val */
       break;
+    case NC_BYTE:
+      if(has_mss_val_msk){
+	const nco_byte mss_val_byt=mss_val_msk_dbl;
+	for(idx=0;idx<grd_sz_nbr;idx++)
+	  if(msk_unn.bp[idx] == mss_val_byt || msk_unn.bp[idx] == ((nco_byte)0)) msk[idx]=0;
+      }else{
+	for(idx=0;idx<grd_sz_nbr;idx++)
+	  if(msk_unn.bp[idx] == ((nco_byte)0)) msk[idx]=0;
+	/* 20170811: GHRSST kludge? */
+      } /* !mss_val */
+      break;
     default:
-      (void)fprintf(stderr,"%s: ERROR %s unknown mask type\n",nco_prg_nm_get(),fnc_nm);
+      (void)fprintf(stderr,"%s: ERROR %s mask variable \"%s\" has unsupported type = %s\n",nco_prg_nm_get(),fnc_nm,msk_nm,nco_typ_sng(msk_typ));
       nco_dfl_case_generic_err();
       return NCO_ERR;
       break;
@@ -7771,16 +7839,25 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     dmn_ids[0]=dmn_id_dg;
     dmn_ids[1]=dmn_id_npe;
     rcd=nco_def_var(out_id,dg_nd_nm,(nc_type)NC_INT,dmn_nbr_2D,dmn_ids,&dg_nd_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dg_nd_id,shuffle,deflate,dfl_lvl);
     dmn_ids[0]=dmn_id_fc;
     dmn_ids[1]=dmn_id_npf;
     rcd=nco_def_var(out_id,fc_nd_nm,(nc_type)NC_INT,dmn_nbr_2D,dmn_ids,&fc_nd_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,fc_nd_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,msh_nm,(nc_type)NC_INT,dmn_nbr_0D,(int *)NULL,&msh_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,msh_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,ndx_nm,crd_typ,dmn_nbr_1D,&dmn_id_nd,&ndx_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,ndx_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,ndy_nm,crd_typ,dmn_nbr_1D,&dmn_id_nd,&ndy_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,ndy_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,dgx_nm,crd_typ,dmn_nbr_1D,&dmn_id_dg,&dgx_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dgx_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,dgy_nm,crd_typ,dmn_nbr_1D,&dmn_id_dg,&dgy_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dgy_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,fcx_nm,crd_typ,dmn_nbr_1D,&dmn_id_fc,&fcx_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,fcx_id,shuffle,deflate,dfl_lvl);
     rcd=nco_def_var(out_id,fcy_nm,crd_typ,dmn_nbr_1D,&dmn_id_fc,&fcy_id);
+    if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,fcy_id,shuffle,deflate,dfl_lvl);
 
     att_nm=strdup("Conventions");
     att_val=strdup("CF-1.6, UGRID-1.0");
diff --git a/src/nco/nco_rgr.h b/src/nco/nco_rgr.h
index 7de4283..3f668dc 100644
--- a/src/nco/nco_rgr.h
+++ b/src/nco/nco_rgr.h
@@ -55,6 +55,7 @@ extern "C" {
     nco_rgr_mpf_ESMF,
     nco_rgr_mpf_SCRIP,
     nco_rgr_mpf_Tempest,
+    nco_rgr_mpf_ESMF_weight_only,
   } nco_rgr_mpf_typ_enm;
 
   typedef enum nco_rgr_typ_enm{ /* [enm] Regrid type enum */
diff --git a/src/nco/nco_scm.c b/src/nco/nco_scm.c
index c63feed..7f3e79b 100644
--- a/src/nco/nco_scm.c
+++ b/src/nco/nco_scm.c
@@ -149,7 +149,7 @@ nco_cpy_prn(void) /* [fnc] Print copyright notice */
 {
   /* Purpose: Print copyright notice */
   (void)fprintf(stderr,"Copyright (C) 1995--2017 Charlie Zender\n");
-  (void)fprintf(stdout,"This program is part of NCO, the netCDF Operators.\nNCO is free software and comes with a BIG FAT KISS and ABOLUTELY NO WARRANTY\nYou may redistribute and/or modify NCO under the terms of the\nGNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file\nGPL: http://www.gnu.org/copyleft/gpl.html\nLICENSE: https://github.com/nco/nco/tree/master/LICENSE\n");
+  (void)fprintf(stdout,"This program is part of NCO, the netCDF Operators.\nNCO is free software and comes with a BIG FAT KISS and ABSOLUTELY NO WARRANTY\nYou may redistribute and/or modify NCO under the terms of the\nGNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file\nGPL: http://www.gnu.org/copyleft/gpl.html\nLICENSE: https://github.com/nco/nco/tree/master/LICENSE\n");
 } /* end copyright_prn() */
 
 void
@@ -174,7 +174,7 @@ nco_vrs_prn /* [fnc] Print NCO version */
   char vrs_cpp[]=TKN2SNG(NCO_VERSION); /* [sng] Version from C pre-processor */
 
   /* 20170417: vrs_cpp is typically something like "4.6.6-alpha08" (quotes included) 
-     The quotation marks annyoy me yet are necessary to protect the string in nco.h 
+     The quotation marks annoy me yet are necessary to protect the string in nco.h 
      Here we remove the quotation marks by pointing past the first and putting NUL in the last */
   char *vrs_sng; /* [sng] NCO version */
   vrs_sng=vrs_cpp;
diff --git a/src/nco/nco_sng_utl.c b/src/nco/nco_sng_utl.c
index c819319..9f5d82d 100644
--- a/src/nco/nco_sng_utl.c
+++ b/src/nco/nco_sng_utl.c
@@ -263,6 +263,8 @@ nm2sng_cdl /* [fnc] Turn variable/dimension/attribute name into legal CDL */
   while(*chr_in_ptr){
     if(isascii(*chr_in_ptr)){
       if(iscntrl(*chr_in_ptr)){	/* Render control chars as two hex digits, \%xx */
+	/* 20170810: GCC7.x produces -Wformat-truncation warning here, that 4 B destination is too small
+	   False-positive warning? How to eliminate? */
 	snprintf(chr_out_ptr,4,"\\%%%.2x",*chr_in_ptr);
 	chr_out_ptr+=4;
       }else{
@@ -342,12 +344,9 @@ nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal CDL */
   chr_out_ptr[0]='\0';
 
   /* Search and replace special characters */
-  while(*chr_in_ptr)
-  {
-    if(iscntrl(*chr_in_ptr))
-    { 
-      switch(*chr_in_ptr)
-      {    
+  while(*chr_in_ptr){
+    if(iscntrl(*chr_in_ptr)){ 
+      switch(*chr_in_ptr){    
          case '\b':
          case '\f':
          case '\n':
@@ -355,24 +354,22 @@ nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal CDL */
          case '\t': 
          case '\\': 
          case '\"': 
-	 /* according to json spec control char  '/' should be escaped bu this is mangles filepaths so leave it out for now */
+	 /* According to json spec control char  '/' should be escaped but this is mangles filepaths so leave it out for now */
          /* case '\/': */
-         case '\0':	
+         case '\0':
            *chr_out_ptr++='\\';
 	   *chr_out_ptr++=*chr_in_ptr;
 	   break;
          default: 
             /* ignore other control chars */
       	  break;
-      }
-    }
-    else
-    {
+      } /* !switch */
+    }else{ /* !iscntrl() */
       *chr_out_ptr++=*chr_in_ptr;
-    }
+    } /* !iscntrl() */
     /* Advance character */
     chr_in_ptr++;
-  }      
+  } /* !while() */
   /* NUL-terminate */
   *chr_out_ptr='\0';
 
@@ -382,8 +379,6 @@ nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal CDL */
   return nm_jsn;
 } /* end nm2sng_jsn() */
 
-
-
 char * /* O [sng] CDL-compatible name */
 nm2sng_fl /* [fnc] Turn file name into legal string for shell commands */
 (const char * const nm_sng) /* I [sng] Name to sanitize */
@@ -423,6 +418,8 @@ nm2sng_fl /* [fnc] Turn file name into legal string for shell commands */
   while(*chr_in_ptr){
     if(isascii(*chr_in_ptr)){
       if(iscntrl(*chr_in_ptr)){	/* Render control chars as two hex digits, \%xx */
+	/* 20170810: GCC7.x produces -Wformat-truncation warning here, that 4 B destination is too small 
+	   False-positive warning? How to eliminate? */
 	snprintf(chr_out_ptr,4,"\\%%%.2x",*chr_in_ptr);
 	chr_out_ptr+=4;
       }else{
diff --git a/src/nco/nco_uthash.h b/src/nco/nco_uthash.h
index 27a4538..5b226d9 100644
--- a/src/nco/nco_uthash.h
+++ b/src/nco/nco_uthash.h
@@ -445,15 +445,25 @@ do {
   hashv += keylen;                                                               \
   switch ( _hj_k ) {                                                             \
      case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \
-     case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
+     case 10: hashv += ( (unsigned)_hj_key[9] << 16 );			\
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 5:  _hj_j += _hj_key[4];                                               \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \
+       /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
      case 1:  _hj_i += _hj_key[0];                                               \
   }                                                                              \
   HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \
@@ -582,7 +592,9 @@ do {                                                                   \
   _mur_k1=0;                                                           \
   switch((keylen) & 3) {                                               \
     case 3: _mur_k1 ^= _mur_tail[2] << 16;                             \
+    /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
     case 2: _mur_k1 ^= _mur_tail[1] << 8;                              \
+    /* FALLTHRU CSZ CEWI to avoid GCC7+ implicit-fallthrough warning 20170810 */ \
     case 1: _mur_k1 ^= _mur_tail[0];                                   \
     _mur_k1 *= _mur_c1;                                                \
     _mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \
diff --git a/src/nco/nco_var_utl.c b/src/nco/nco_var_utl.c
index 0e8774e..3558dc0 100644
--- a/src/nco/nco_var_utl.c
+++ b/src/nco/nco_var_utl.c
@@ -1474,8 +1474,8 @@ nco_is_spc_in_cf_att /* [fnc] Variable is listed in this CF attribute, thereby a
 } /* end nco_is_spc_in_cf_att() */
 
 
-char *** /* O [ptr]  list of lists - each ragged array terminated with empty string    */
-nco_lst_cf_att /* [fnc] look in all vars for att cf_nm  */
+char *** /* O [ptr] List of lists - each ragged array terminated with empty string */
+nco_lst_cf_att /* [fnc] look in all vars for att cf_nm */
 (const int nc_id, /* I [id] netCDF file ID */
  const char *const cf_nm, /* I [sng] CF att name */
  int *nbr_lst) /* O [nbr] number of ragged arrays returned */
@@ -1491,7 +1491,6 @@ nco_lst_cf_att /* [fnc] look in all vars for att cf_nm  */
      It is based on nco_is_spc_in_crd_att() */
 
   const char dlm_sng[]=" "; /* [sng] Delimiter string */
-  const char fnc_nm[]="nco_lst_cf_att()"; /* [sng] Function name */
   char **cf_lst; /* [sng] 1D array of list elements */
   char **int_lst=NULL_CEWI; /* store pointer to ragged array */
   char *att_val;
@@ -1560,7 +1559,6 @@ nco_lst_cf_att /* [fnc] look in all vars for att cf_nm  */
   return ra_lst;
 } /* end nco_lst_cf_att() */
 
-
 nco_bool /* [flg] Variable is listed in a "coordinates" attribute */
 nco_is_spc_in_crd_att /* [fnc] Variable is listed in a "coordinates" attribute */
 (const int nc_id, /* I [id] netCDF file ID */
diff --git a/src/nco/ncpdq.c b/src/nco/ncpdq.c
index 432ba13..7fbd848 100644
--- a/src/nco/ncpdq.c
+++ b/src/nco/ncpdq.c
@@ -862,7 +862,7 @@ main(int argc,char **argv)
       } /* endif nco_pck_plc != nco_pck_plc_nil */
 
       if(var_trv->ppc != NC_MAX_INT){
-        if(var_trv->flg_nsd) (void)nco_ppc_bitmask(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);
+        if(var_trv->flg_nsd) (void)nco_ppc_bitmask(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 */
       if(nco_is_xcp(var_trv->nm)) nco_xcp_prc(var_trv->nm,var_prc_out[idx]->type,var_prc_out[idx]->sz,(char *)var_prc_out[idx]->val.vp);
 
diff --git a/src/nco/ncra.c b/src/nco/ncra.c
index 17d0e6e..b74ee88 100644
--- a/src/nco/ncra.c
+++ b/src/nco/ncra.c
@@ -1131,7 +1131,7 @@ main(int argc,char **argv)
 
   if(wgt_nm && (nco_op_typ == nco_op_avg || nco_op_typ == nco_op_mebs)){
     /* Find weight variable that matches current variable */
-    wgt=nco_var_get_wgt_trv(in_id,wgt_nm,var_prc[0],trv_tbl);
+    wgt=nco_var_get_wgt_trv(in_id,lmt_nbr,lmt_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,wgt_nm,var_prc[0],trv_tbl);
     assert(wgt->nbr_dim < 2);
     /* Change wgt from a normal full variable to one that only holds one record at a time
        This differs from ncwa wgt treatment
@@ -1737,7 +1737,7 @@ main(int argc,char **argv)
     for(idx_rec=0;idx_rec<nbr_rec;idx_rec++){
       /* Check subcycle for each record */
       if(lmt_rec[idx_rec]->ssc != 1L && (lmt_rec[idx_rec]->lmt_typ == lmt_crd_val || lmt_rec[idx_rec]->lmt_typ == lmt_udu_sng)){
-        (void)fprintf(stderr,"\n%s: WARNING Subcycle argument SSC used in hyperslab specification for %s which will be determined based on coordinate values rather than dimension indices. The behavior of the subcycle hyperslab argument is ambiguous for coordinate-based hyperslabs---it could mean select the first SSC elements that are within the min and max coordinate values beginning with each strided point, or it could mean always select the first _consecutive_ SSC elements beginning wi [...]
+        (void)fprintf(stderr,"\n%s: WARNING Subcycle argument SSC used in hyperslab specification for %s which will be determined based on coordinate values rather than dimension indices. The behavior of the subcycle hyperslab argument is ambiguous for coordinate-based hyperslabs---it could mean select the first SSC elements that are within the min and max coordinate values beginning with each strided point, or it could mean always select the first _consecutive_ SSC elements beginning wi [...]
       } /* Check subcycle for each record */
     } /* !idx_rec */
   } /* Subcycle argument warning */
diff --git a/src/nco/ncwa.c b/src/nco/ncwa.c
index 0419f6a..e950086 100644
--- a/src/nco/ncwa.c
+++ b/src/nco/ncwa.c
@@ -575,7 +575,7 @@ main(int argc,char **argv)
     case 'm': /* Name of variable to use as mask in reducing. Default is none */
       msk_nm=(char *)strdup(optarg);
       break;
-    case 'M': /* Good data defined by relation to mask value. Default is 1. */
+    case 'M': /* Good data defined by relation to mask value. Default is 1.0 */
       msk_val=strtod(optarg,&sng_cnv_rcd);
       if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtod",sng_cnv_rcd);
       break;
@@ -884,8 +884,8 @@ main(int argc,char **argv)
        firstprivate(): rcd gets incremented, so keep initial value
        lastprivate(): retain rcd value from last thread
        private(): wgt_avg does not need initialization
-       shared(): msk and wgt are not altered within loop */
-#pragma omp parallel for default(none) firstprivate(DO_CONFORM_MSK,DO_CONFORM_WGT,ddra_info,rcd) lastprivate(rcd) private(idx,in_id,wgt_avg) shared(MULTIPLY_BY_TALLY,MUST_CONFORM,NRM_BY_DNM,WGT_MSK_CRD_VAR,dmn_avg,dmn_avg_nbr,flg_ddra,flg_rdd,gpe,in_id_arr,msk_nm,msk_val,nbr_var_prc,nco_dbg_lvl,nco_op_typ,nco_prg_nm,op_typ_rlt,out_id,trv_tbl,var_prc,var_prc_out,wgt_nm)
+       shared(): msk, wgt and lmt_nbr are not altered within loop */
+#pragma omp parallel for default(none) firstprivate(DO_CONFORM_MSK,DO_CONFORM_WGT,ddra_info,rcd) lastprivate(rcd) private(idx,in_id,wgt_avg) shared(MULTIPLY_BY_TALLY,MUST_CONFORM,NRM_BY_DNM,WGT_MSK_CRD_VAR,dmn_avg,dmn_avg_nbr,flg_ddra,flg_rdd,gpe,in_id_arr,msk_nm,msk_val,nbr_var_prc,nco_dbg_lvl,nco_op_typ,nco_prg_nm,op_typ_rlt,out_id,trv_tbl,var_prc,var_prc_out,wgt_nm,lmt_nbr,lmt_arg,FORTRAN_IDX_CNV,MSA_USR_RDR)
 #endif /* !_OPENMP */
     for(idx=0;idx<nbr_var_prc;idx++){ /* Process all variables in current file */
       char *grp_out_fll=NULL; /* [sng] Group name */
@@ -900,12 +900,6 @@ main(int argc,char **argv)
 
       in_id=in_id_arr[omp_get_thread_num()];
 
-      /* Find weighting variable that matches current variable */
-      if(wgt_nm) wgt=nco_var_get_wgt_trv(in_id,wgt_nm,var_prc[idx],trv_tbl);
-
-      /* Find mask variable that matches current variable */
-      if(msk_nm) msk=nco_var_get_wgt_trv(in_id,msk_nm,var_prc[idx],trv_tbl);
-
       /* Obtain variable GTT object using full variable name */
       var_trv=trv_tbl_var_nm_fll(var_prc[idx]->nm_fll,trv_tbl);
 
@@ -932,11 +926,17 @@ main(int argc,char **argv)
 
       (void)nco_var_mtd_refresh(grp_id,var_prc[idx]);
 
+      /* Find weighting variable that matches current variable */
+      if(wgt_nm) wgt=nco_var_get_wgt_trv(in_id,lmt_nbr,lmt_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,wgt_nm,var_prc[idx],trv_tbl);
+
+      /* Find mask variable that matches current variable */
+      if(msk_nm) msk=nco_var_get_wgt_trv(in_id,lmt_nbr,lmt_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,msk_nm,var_prc[idx],trv_tbl);
+
       /* Retrieve variable from disk into memory */
       (void)nco_msa_var_get_trv(in_id,var_prc[idx],trv_tbl);
       /* var_prc_out still has type = packed type for packed variables
-	 nco_typ_cnv_rth() fixes that for most operations, though not for minimization or maximization
-	 Following line is necessary only for packed variables subject to minimization or maximization */
+      nco_typ_cnv_rth() fixes that for most operations, though not for minimization or maximization
+      Following line is necessary only for packed variables subject to minimization or maximization */
       if(var_prc[idx]->typ_dsk != var_prc[idx]->type && var_prc[idx]->typ_upk == var_prc[idx]->type) var_prc_out[idx]=nco_var_cnf_typ(var_prc[idx]->type,var_prc_out[idx]);
 
       /* Convert char, short, long, int, and float types to doubles before arithmetic */
diff --git a/src/nco_c++/Makefile.in b/src/nco_c++/Makefile.in
index 0e5559f..de7ebf8 100644
--- a/src/nco_c++/Makefile.in
+++ b/src/nco_c++/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/nco.git



More information about the Pkg-grass-devel mailing list