[nco] 01/06: New upstream version 4.7.0

Bas Couwenberg sebastic at debian.org
Thu Nov 9 18:23:47 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 70e46368f6f143beacebf055c0abc859db91b8b1
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu Nov 9 19:05:01 2017 +0100

    New upstream version 4.7.0
---
 .gitignore               |   1 +
 CMakeLists.txt           |  37 ++-
 bld/Makefile             |   7 +-
 bld/nco.spec             |  11 +-
 bld/nco_dst.pl           |  30 +-
 bm/NCO_rgr.pm            |  33 +-
 configure                |  20 +-
 configure.ac             |   2 +-
 configure.eg             |  50 ++-
 data/.gitignore          |   4 +
 data/in.cdl              |  52 ++-
 data/in_grp.cdl          |  45 +++
 data/ncclimo             |  61 +++-
 data/ncremap             |  30 +-
 debian/changelog         |   6 +
 doc/ANNOUNCE             | 123 ++++---
 doc/ChangeLog            | 120 +++++++
 doc/MANIFEST             |   2 +
 doc/README_msvc.txt      |  79 -----
 doc/VERSION              |   2 +-
 doc/alg_cf2_oog.png      | Bin 0 -> 195467 bytes
 doc/alg_cf2_oog.pptx     | Bin 0 -> 56888 bytes
 doc/build_hints.shtml    |   5 +-
 doc/conda.txt            |  38 +++
 doc/debian.txt           | 162 +++++-----
 doc/highlights_old.shtml |  66 +++-
 doc/index.shtml          | 205 +++++-------
 doc/logo_qt.png          | Bin 3654 -> 0 bytes
 doc/logo_vs2010.png      | Bin 4046 -> 0 bytes
 doc/milestones_old.shtml |  16 +-
 doc/nco.texi             | 393 ++++++++++++++++-------
 doc/nco_qt_msvc.shtml    |  97 ------
 man/ncclimo.1            |  17 +-
 man/ncremap.1            |   5 +-
 src/nco++/fmc_all_cls.cc |   2 +-
 src/nco/Makefile.am      |   2 +
 src/nco/Makefile.in      |  25 +-
 src/nco/libnco.h         |   1 +
 src/nco/ncatted.c        |   2 +-
 src/nco/ncflint.c        |   2 +-
 src/nco/ncks.c           |   8 +-
 src/nco/nco.h            |   8 +-
 src/nco/nco_ctl.c        |   4 +-
 src/nco/nco_fl_utl.c     |  13 +-
 src/nco/nco_grp_utl.c    |   1 -
 src/nco/nco_lmt.c        |  19 +-
 src/nco/nco_map.c        | 818 +++++++++++++++++++++++++++++++++++++++++++++++
 src/nco/nco_map.h        |  75 +++++
 src/nco/nco_mmr.c        |   2 +-
 src/nco/nco_netcdf.c     |  66 +++-
 src/nco/nco_ppc.c        |   2 +-
 src/nco/nco_rgr.c        | 202 ++++++------
 src/nco/nco_rgr.h        |  11 +-
 src/nco/nco_sld.c        |  43 ---
 src/nco/nco_sld.h        |   5 -
 src/nco/ncra.c           |  48 ++-
 src/nco/ncrename.c       |  22 +-
 src/nco/ncwa.c           |   6 +-
 58 files changed, 2211 insertions(+), 895 deletions(-)

diff --git a/.gitignore b/.gitignore
index 445c584..66ecb1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ cmake_install.cmake
 # Odd files, litter
 gmon.out
 PET0.RegridWeightGen.Log
+texput.log
 
 # Editors
 
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6cb7c1a..c6d63a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,10 +110,12 @@ set(CMAKE_REQUIRED_LIBRARIES ${NETCDF_LIBRARY})
 
 check_library_exists(${NETCDF_LIBRARY} nc_inq_path "" has_nc_inq_path)
 if (has_nc_inq_path)
+  message("-- Found nc_inq_path in: " ${NETCDF_LIBRARY})
   add_definitions(-DHAVE_NC_INQ_PATH)
 endif()
 check_library_exists(${NETCDF_LIBRARY} nc_inq_format "" has_nc_inq_format)
 if (has_nc_inq_format)
+  message("-- Found nc_inq_format in: " ${NETCDF_LIBRARY})
   add_definitions(-DHAVE_NC_INQ_FORMAT)
 endif()
 
@@ -362,6 +364,7 @@ set(nco_SOURCES ${nco_SOURCES} src/nco/nco_grp_utl.c src/nco/nco_grp_utl.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_lmt.c src/nco/nco_lmt.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_lst_utl.c src/nco/nco_lst_utl.h)
+set(nco_SOURCES ${nco_SOURCES} src/nco/nco_map.c src/nco/nco_map.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_md5.c src/nco/nco_md5.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_mmr.c src/nco/nco_mmr.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_mpi.h)
@@ -598,6 +601,18 @@ if(ANTLR_INCLUDE AND ANTLR_LIBRARY)
   add_executable(ncap2 ${ncap2_SOURCES})
   target_include_directories(ncap2 PRIVATE src/nco ${ANTLR_INCLUDE})
   target_link_libraries (ncap2 ${nco_LIB} ${LIB_DEP} ${ANTLR_LIBRARY}) 
+  
+  #//////////////////////////
+  # macros used in ncap2 to use advanced math: erf, erfc, gamma
+  # LINUX LINUXAMD64 MACOSX
+  #//////////////////////////
+  
+  if(APPLE)
+    add_definitions(-DMACOSX)
+  endif() 
+  if(UNIX AND NOT APPLE)
+   add_definitions(-DLINUX)
+  endif() 
 endif()
 
 
@@ -626,7 +641,7 @@ find_library(MATH_LIBRARY NAMES m ${find_opt})
 if(MATH_LIBRARY)
   message("-- Checking for math library functions at: " ${MATH_LIBRARY})
   set(CMAKE_REQUIRED_LIBRARIES m)
-  set(CMAKE_REQUIRED_QUIET 1)
+  set(CMAKE_REQUIRED_QUIET 0)
   macro(nco_check_funcs func)
   unset(have_result CACHE)
   check_function_exists(${ARGV0} have_result)
@@ -802,15 +817,18 @@ message("-- Installing data/ncremap;data/ncclimo to: " ${CMAKE_INSTALL_PREFIX})
 # create a symbolic link <new> naming <old>. 
 #//////////////////////////
 
-macro(install_links src dest)
-add_custom_command(TARGET ncra POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${src} ${dest} DEPENDS ${src})
+macro(install_links target src dest)
+add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink ${src} ${dest} 
+COMMENT "Making symbolic link ${src} -> ${dest}")
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${dest} DESTINATION . PERMISSIONS ${PERMISSIONS_DEFAULT})
 endmacro(install_links)
-install_links(ncra ncea)
-install_links(ncra nces)
-install_links(ncra ncrcat)
-install_links(ncbo ncdiff)
-install_links(ncpdq ncunpack)
+if(UNIX)
+  install_links(ncra ${CMAKE_INSTALL_PREFIX}/ncra ncea)
+  install_links(ncra ${CMAKE_INSTALL_PREFIX}/ncra nces)
+  install_links(ncra ${CMAKE_INSTALL_PREFIX}/ncra ncrcat)
+  install_links(ncbo ${CMAKE_INSTALL_PREFIX}/ncbo ncdiff)
+  install_links(ncpdq ${CMAKE_INSTALL_PREFIX}/ncpdq ncunpack)
+endif()
 message("-- Installing links ncea;nces;ncrcat;ncdiff;ncunpack to: " ${CMAKE_INSTALL_PREFIX})
 
 #//////////////////////////
@@ -846,6 +864,7 @@ if (PATH_TO_NCGEN)
   COMMAND ${PATH_TO_NCGEN} -k netCDF-4 -b -o ${PATH_DATA}/mdl_2.nc ${PATH_DATA}/mdl_2.cdl
   COMMAND ${PATH_TO_NCGEN} -k netCDF-4 -b -o ${PATH_DATA}/mdl_3.nc ${PATH_DATA}/mdl_3.cdl
   COMMAND ${PATH_TO_NCGEN} -k netCDF-4 -b -o ${PATH_DATA}/cmip5.nc ${PATH_DATA}/cmip5.cdl
+  COMMAND ${PATH_TO_NCGEN} -k netCDF-4 -b -o ${PATH_DATA}/split.nc ${PATH_DATA}/split.cdl
   COMMAND ${PATH_TO_NCGEN} -k netCDF-4 -b -o ${PATH_DATA}/obs.nc ${PATH_DATA}/obs.cdl)
 
 #//////////////////////////
@@ -875,7 +894,7 @@ if (NOT test_w)
  set(can_write 1)
 endif()
 
-if(can_write)
+if(can_write AND UNIX)
   message("${color_blue}-- Generating check/install target with executables at: ${CMAKE_INSTALL_PREFIX}${color_reset}")
   add_custom_target(check
   COMMENT "${color_green}Running self-tests with NCO executables in ${CMAKE_INSTALL_PREFIX}${color_reset}"
diff --git a/bld/Makefile b/bld/Makefile
index c956309..11ddc06 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -14,11 +14,11 @@
 
 # Machine build parameters
 #                         Source     Method   Packages Compiler
-# aerosol.ess.uci.edu: NCO          Configure All else LLVM
+# aerosol.ess.uci.edu: NCO          Configure All else clang
 # 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          Configure All else GCC
+# firn.ess.uci.edu   : NCO          Configure All else clang
+# frazil.ess.uci.edu : NCO          Configure All else clang
 # glace.ess.uci.edu  : NCO          CMake     All else GCC
 # grele.ess.uci.edu  : NCO          Makefile  All else GCC
 # rhea.ccs.ornl.gov  : NCO          Makefile  All else GCC
@@ -1953,6 +1953,7 @@ ${libnco}.a: ${libnco}.a(${MY_OBJ_DIR}/nco_att_utl.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_grp_utl.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_lmt.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_lst_utl.o) \
+	${libnco}.a(${MY_OBJ_DIR}/nco_map.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_md5.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_mmr.o) \
 	${libnco}.a(${MY_OBJ_DIR}/nco_msa.o) \
diff --git a/bld/nco.spec b/bld/nco.spec
index ebf07ba..6733e95 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.9
+Version:        4.7.0
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.6.9-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.7.0-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.9-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-4.6.9/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
+# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.7.0-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.7.0/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 Nov 08 2017 Charlie Zender <zender at uci.edu> - 4.7.0-1
+- new upstream 4.7.0
+
 * Mon Sep 18 2017 Charlie Zender <zender at uci.edu> - 4.6.9-1
 - new upstream 4.6.9
 
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index 88639af..6644798 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.9.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.9 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.6.9 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.6.9 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.6.9 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.6.9
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.6.9
+# /usr/bin/scp ${DATA}/nco-4.7.0.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.7.0 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.7.0 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.7.0 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.7.0 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.7.0
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.7.0
 
 # 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.9/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.7.0/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_rgr.pm b/bm/NCO_rgr.pm
index 95cd013..d38d98f 100644
--- a/bm/NCO_rgr.pm
+++ b/bm/NCO_rgr.pm
@@ -108,6 +108,9 @@ sub tst_rgr {
     # 440 (for library 4.4.0)
     # 441 (for library 4.4.1.x)
     # 450 (for library 4.5.0)
+    # 451 (for library 4.5.1)
+    # 452 (for library 4.5.2)
+    # 453 (for library 4.5.3)
 
   if($exit_value == 410){print "netCDF version 4.1.x detected\n";}
   if($exit_value == 431){print "netCDF version 4.3.1 detected\n";}
@@ -117,6 +120,8 @@ sub tst_rgr {
   if($exit_value == 441){print "netCDF version 4.4.1 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 == 452){print "netCDF version 4.5.2 detected\n";}
+  if($exit_value == 453){print "netCDF version 4.5.3 detected\n";}
 
   if($exit_value >= 400){$RUN_NETCDF4_TESTS=1;}
   if($exit_value >= 431){$RUN_NETCDF4_TESTS_VERSION_GE_431=1;}
@@ -286,7 +291,7 @@ if($USER eq 'zender'){
 # ncks -O --rgr skl=~/skl_t42.nc --rgr grid=~/grd_t42.nc --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
 # ncks -O --rgr grid=~/grd_2x2.nc --rgr latlon=90,180 --rgr lat_typ=eqa --rgr lon_typ=Grn_wst ~/nco/data/in.nc ~/foo.nc
 # ncap2 -O -s 'tst[lat,lon]=1.0f' ~/skl_t42.nc ~/dat_t42.nc
-# /bin/rm -f ~/foo_map_t42_to_2x2.nc
+# /bin/rm -f ~/map_t42_to_2x2.nc
 # ncremap -a conserve -s ~/grd_t42.nc -g ~/grd_2x2.nc -m ~/map_t42_to_2x2.nc
 # ncremap -i ~/dat_t42.nc -m ~/map_t42_to_2x2.nc -o ~/dat_2x2.nc
 # ncwa -O ~/dat_2x2.nc ~/dat_avg.nc
@@ -1891,11 +1896,13 @@ if($USER eq 'zender'){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
     
-#ncks #25 groups: Extract global attributes
-    $dsc_sng="Extract global attributes";
+# ncks -O ~/nco/data/in_grp.nc ~/foo.nc
+# ncks -M --trd ~/foo.nc | grep Conventions | cut -d ' ' -f 11
+#ncks #25 groups: Extract global attribute
+    $dsc_sng="Extract global attribute";
     $tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg $in_pth_arg in_grp.nc %tmp_fl_00%";
-    $tst_cmd[1]="ncks --trd %tmp_fl_00% | grep Conventions";
-    $tst_cmd[2]="Global attribute 0: Conventions, size = 6 NC_CHAR, value = CF-1.0";
+    $tst_cmd[1]="ncks -M --trd %tmp_fl_00% | grep Conventions | cut -d ' ' -f 11";
+    $tst_cmd[2]="CF-1.0";
     $tst_cmd[3]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
@@ -2976,6 +2983,8 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     $#tst_cmd=0; # Reset array
 	
 # ncks #120 
+# ncks -O -d time,'1979-01-01 0:0:0','1981-01-01 0:0:0' -v time,time_bnds ~/nco/data/split.nc ~/foo.nc
+# ncap2 -O -v -C -s 'time_ttl=time.total();print(time_ttl);' ~/foo.nc ~/foo1.nc
     $dsc_sng="Test UDUNITS with dates as limits - fails without UDUNITS";
     $tst_cmd[0]="ncks -O $nco_D_flg -d time,'1979-01-01 0:0:0','1981-01-01 0:0:0' -v time,time_bnds $in_pth_arg split.nc %tmp_fl_00%";
     $tst_cmd[1]="ncap2 -O -v -C -s 'time_ttl=time.total();print(time_ttl);' %tmp_fl_00% %tmp_fl_01%";
@@ -5474,10 +5483,10 @@ if(0){
 #################### Attributes
 
 #ncrename #1
-#ncrename -O -a .nothing,new_nothing ~/nco/data/in_grp.nc ~/foo.nc 
+#ncrename -O -D 1 -a .nothing,new_nothing ~/nco/data/in_grp.nc ~/foo.nc 
 #optional relative rename nothing to new_nothing (print warning)
     $dsc_sng="Attributes: Optional relative rename '.nothing' to 'new_nothing'";
-    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -a .nothing,new_nothing $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -D 1 -a .nothing,new_nothing $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncrename: In total renamed 0 attributes, 0 dimensions, 0 groups, and 0 variables";
     $tst_cmd[2]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
@@ -5615,7 +5624,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 # Absolute non existing absolute rename
 
     $dsc_sng="Dimensions: Optional non-existing absolute rename './lat_non_existing,new_lat' to 'new_lat'";
-    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -d ./lat_non_existing,new_lat $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -D 1 -d ./lat_non_existing,new_lat $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncrename: In total renamed 0 attributes, 0 dimensions, 0 groups, and 0 variables";
     $tst_cmd[2]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
@@ -5677,7 +5686,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #Optional non-existing absolute rename '/g1/v1_not'
 
     $dsc_sng="Variables: Optional non-existing absolute rename './g1/v1_not' to '/g1/new_v1'";
-    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -v ./g1/v1_not,new_v1 $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -D 1 -v ./g1/v1_not,new_v1 $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncrename: In total renamed 0 attributes, 0 dimensions, 0 groups, and 0 variables";
     $tst_cmd[2]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
@@ -5730,7 +5739,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 # optional relative rename gfoo to new_g1 (print warning)
 
     $dsc_sng="Groups: Optional relative rename '.gfoo' to 'new_g1'";
-    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -g .gfoo,new_g1 $in_pth_arg in_grp.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -D 1 -g .gfoo,new_g1 $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncrename: In total renamed 0 attributes, 0 dimensions, 0 groups, and 0 variables";
     $tst_cmd[2]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
@@ -5780,7 +5789,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #Fail when required attribute not present
 
     $dsc_sng="Attributes: Fail when required attribute not present";
-    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -a xyz,abc $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -D 1 -a xyz,abc $in_pth_arg in.nc %tmp_fl_00%";
     $tst_cmd[1]="In total renamed 0 attributes, 0 dimensions, 0 groups, and 0 variables";
     $tst_cmd[2]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
@@ -5910,7 +5919,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #ncrename -O -d lev,z -d lat,y -d lon,x ~/nco/data/in_grp.nc ~/foo.nc
 #ncks -H --trd -s %d -v one ~/foo.nc
 # Check for corruption after simultaneously renaming multiple dimensions in netCDF4 file
-    $dsc_sng="netCDF4: Simultaneously rename multiple dimensions (netCDF bug, will require netCDF 4.5.???)";
+    $dsc_sng="netCDF4: Simultaneously rename multiple dimensions (netCDF bug, will require Unidata to fix in netCDF 4.5.???)";
     $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -d lev,z -d lat,y -d lon,x $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -H --trd -s %d -v one %tmp_fl_00%";
     $tst_cmd[2]="1";
diff --git a/configure b/configure
index efaba13..ce77161 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.9.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.7.0.
 #
 # 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.9'
-PACKAGE_STRING='NCO netCDF Operators 4.6.9'
+PACKAGE_VERSION='4.7.0'
+PACKAGE_STRING='NCO netCDF Operators 4.7.0'
 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.9 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.7.0 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.9:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.7.0:";;
    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.9
+NCO netCDF Operators configure 4.7.0
 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.9, which was
+It was created by NCO netCDF Operators $as_me 4.7.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3755,7 +3755,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nco'
- VERSION='4.6.9'
+ VERSION='4.7.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21526,7 +21526,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.9, which was
+This file was extended by NCO netCDF Operators $as_me 4.7.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21592,7 +21592,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.9
+NCO netCDF Operators config.status 4.7.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 819b4e6..97c2ca3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@
 # 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.9],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[4.7.0],[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
diff --git a/configure.eg b/configure.eg
index 28bd6f7..516d195 100644
--- a/configure.eg
+++ b/configure.eg
@@ -239,7 +239,7 @@ Commands for LINUX are the only ones "regularly" used after ~2010
 # 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.9
-# Request: NCO 4.6.9 was released 5/26 and contains many features of interest to your ACME users. Please upgrade the system NCO module to 4.6.9 and make that the default NCO module. Thanks!
+# Request: NCO 4.6.9 was released 9/18 and contains many features of interest to your ACME users. Please upgrade the system NCO module to 4.6.9 and make that the default NCO module. Thanks!
 
 zender at dust:~/nco$ pvmgetarch;uname -a;~/nco/autobld/config.guess
 LINUX
@@ -320,7 +320,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # Sysadmin upgrade request: https://nersc.service-now.com/navpage.do
 # Latest sysadmin-compiled module usage: module load nco/4.6.7 # 20170612 (without ncap2)
 # Personal recipe last modified: 20170411
-# Personal recipe last used successfully: 20170816
+# Personal recipe last used successfully: 20170919
 module load szip
 module load gsl
 module load udunits
@@ -341,7 +341,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # Latest ticket: INC0106410 on 20170804
 # Latest sysadmin-compiled module usage: module load nco/4.6.7 # 20170809 (with ncap2)
 # Personal recipe last modified: 20170807
-# Personal recipe last used successfully: 20170916
+# Personal recipe last used successfully: 20170927
 module load szip
 module load gsl
 module load udunits2
@@ -360,7 +360,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # Sysadmin upgrade request: 
 # Latest sysadmin-compiled module usage: 
 # Personal recipe last modified: 2016??
-# Personal recipe last used successfully: 20170816
+# Personal recipe last used successfully: 20170918
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/usr/local/uvcdat/2016-01-21/Externals' UDUNITS2_PATH='/usr/local/uvcdat/2016-01-21/Externals' ./configure --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
@@ -409,22 +409,34 @@ 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
+# Latest ticket: 172597 on 20170526
+# Latest sysadmin-compiled module usage: module load nco/4.6.9 # 20171002
 # Personal recipe last modified: 20170812
-# Personal recipe last used successfully: 20170816
+# Personal recipe last used successfully: 20170919
 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.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 -
 
+# icc/icpc 20171013 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cheyenne:
+# Sysadmin upgrade request: cislhelp at ucar.edu
+# Latest ticket: fxm on fxm
+# Latest sysadmin-compiled module usage: module load nco/4.6.9 # 20171002
+# Personal recipe last modified: 20171013
+# Personal recipe last used successfully: 20171013 (except ncap2, which would require backporting to inter 16.0.3 to get gsl)
+module add gsl
+export PATH=${PATH}:/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/17.0.1/bin # needed for ncgen
+export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/17.0.1/lib:/glade/u/apps/ch/opt/udunits/2.2.20/gnu/4.8.2/lib # needed to run NCO
+cd ~/nco;git reset --hard origin/master
+cd ~/nco/bld;make NETCDF_ROOT='/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/17.0.1' UDUNITS_INC='/glade/u/apps/ch/opt/udunits/2.2.20/gnu/4.8.2/include' UDUNITS_LIB='/glade/u/apps/ch/opt/udunits/2.2.20/gnu/4.8.2/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: 358890 on 20170526
 # Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170515
 # Personal recipe last modified: 20170814
-# Personal recipe last used successfully: 20170916
+# Personal recipe last used successfully: 20170927
 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'
@@ -432,9 +444,9 @@ module unload PE-intel # CSZ
 module load PE-gnu # CSZ 
 module add gsl hdf5
 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}
+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='/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 -
 
@@ -443,7 +455,7 @@ cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/autofs/nccs-svm1_sw/rhea/.swc
 # Latest ticket: 347675 on 20170316
 # Latest sysadmin-compiled module usage: module load nco/4.6.6 # 20170411
 # Personal recipe last modified: 20170814
-# Personal recipe last used successfully: 20170816
+# Personal recipe last used successfully: 20170919
 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
@@ -657,7 +669,7 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 sudo 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 debug NCO with pre-built (i.e., yum/dnf install'd or aptitude install'd) netCDF in /usr (frazil, glace)
+# gcc/g++ Zender uses this to debug NCO with pre-built (i.e., yum/dnf install'd or aptitude install'd) netCDF in /usr (glace)
 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
@@ -693,6 +705,18 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 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 debug NCO with custom-built netCDF binaries in /usr/local with clang (frazil)
+export GNU_TRP=`~/nco/autobld/config.guess`
+cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
+# 20170810 Produce core dumps and symbols, turn-on -Wall, without using --enable-debug-custom
+CC='clang' CFLAGS='-Wall -DNCO_ABORT_ON_ERROR' CXX='clang -std=c++11' 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
+make check >> nco.make.${GNU_TRP}.foo 2>&1
+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 debug NCO with pre-built netCDF (and ESMF) binaries in /opt/local (this works on MACOSX with MacPorts, e.g., aerosol, firn)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
diff --git a/data/.gitignore b/data/.gitignore
index 7cb834e..758ed0b 100644
--- a/data/.gitignore
+++ b/data/.gitignore
@@ -2,3 +2,7 @@
 /Makefile
 /%tmp_fl_*
 /nco_bm.stderr
+
+in.nc5
+in_4.nc4
+in_4.nc5
diff --git a/data/in.cdl b/data/in.cdl
index f5105b0..5d4dd3a 100644
--- a/data/in.cdl
+++ b/data/in.cdl
@@ -762,6 +762,37 @@ variables:
         att_var:float_att = 73.0f,72.0f,71.0f,70.010f,69.0010f,68.010000f,67.01000100f;
 	att_var:double_att = 73.0,72.0,71.0,70.010,69.0010,68.010000,67.01000100;
 
+	int att_var_jsn;
+        att_var_jsn:char\ att\ with\ whitespace = "cf-json.org <http://cf-json.org>";
+        att_var_jsn:double\ att\ with\ whitespace = 3.14;
+        att_var_jsn:int\ att\ with\ whitespace = 1;
+        att_var_jsn:int_array\ att\ with\ whitespace = 1,2;
+
+	// Purpose: Test special characters in names
+	// Most special characters need backslash protection
+	int att_var_spc_chr;
+	att_var_spc_chr:space\ in\ name = "foo";
+	att_var_spc_chr:comma_in_name\, = "foo";
+	att_var_spc_chr:lt_in_name\< = "foo";
+	att_var_spc_chr:gt_in_name\> = "foo";
+	att_var_spc_chr:hash_in_name\# = "foo";
+	att_var_spc_chr:xclaim_in_name\! = "foo";
+	att_var_spc_chr:dollar_in_name\$ = "foo";
+	att_var_spc_chr:ampersand_in_name\& = "foo";
+	att_var_spc_chr:equals_in_name\= = "foo";
+	att_var_spc_chr:semicolon_in_name\; = "foo";
+	att_var_spc_chr:colon_in_name\: = "foo";
+	att_var_spc_chr:lbrace_in_name\{ = "foo";
+	att_var_spc_chr:rbrace_in_name\} = "foo";
+	att_var_spc_chr:lparen_in_name\( = "foo";
+	att_var_spc_chr:rparen_in_name\) = "foo";
+	att_var_spc_chr:lbracket_in_name\[ = "foo";
+	att_var_spc_chr:rbracket_in_name\] = "foo";
+	att_var_spc_chr:plus_in_name+ = "foo";
+	//  : period_in_name. = "foo"; // Likely to cause DAP server error
+	att_var_spc_chr:hyphen_in_name- = "foo";
+	att_var_spc_chr:at_in_name@ = "foo";
+
 	int bnd_var(lev,bnd);
 	bnd_var:byte_att = '\0';
 	bnd_var:char_att = "Sentence one.\nSentence two.\n";
@@ -1200,6 +1231,14 @@ variables:
 	three_dmn_rec_var:units = "watt meter-2";
 	three_dmn_rec_var:_FillValue = -99.;
 
+	short three_dmn_rec_var_pck(time,lat,lon);
+	three_dmn_rec_var_pck:long_name = "three dimensional record variable";
+	three_dmn_rec_var_pck:purpose = "should unpack into identical values with three_dmn_rec_var (i.e., 1..80)";
+	three_dmn_rec_var_pck:units = "watt meter-2";
+	three_dmn_rec_var_pck:_FillValue = -99.;
+        three_dmn_rec_var_pck:add_offset = 40.5f ;
+        three_dmn_rec_var_pck:scale_factor = -0.001205518f ;
+
 	int three_dmn_var_int(time,lat,lon);
 	three_dmn_var_int:long_name = "three dimensional record variable of type int";
 	three_dmn_var_int:units = "watt meter-2";
@@ -1295,6 +1334,8 @@ data:
 //	None in this file
 //	netCDF3 atomic types:
 	att_var=10.0,10.1,10.20,10.3000,10.40101,10.500001,10.60000001,10.7000001,10.80,10.9900;
+	att_var_jsn=73;
+	att_var_spc_chr=73;
 	area=10.,10.;
 	area2=20.,5.;
 	area_asm=1.,2.;
@@ -1423,7 +1464,6 @@ data:
 	var_mss_1=0.,_,2.,3.;
 	var_mss_2=0.,1.,_,3.;
 	var_mss_3=0.,1.,2.,_;
-	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.;
 	orog2=1.,1.,1.,1.,1.,1.,1.,1.;
@@ -1731,6 +1771,16 @@ data:
 				57,58,59,60,61,62,63,64,
 				65,66,67,68,69,70,71,72,
 				73,74,75,76,77,78,79,80;
+	three_dmn_rec_var_pck=  32766, 31936, 31107, 30277, 29448, 28618, 27789, 26959, 
+	  26130, 25300, 24471, 23641, 22812, 21982, 21153, 20323, 
+	  19494, 18664, 17835, 17005, 16176, 15346, 14517, 13687, 
+	  12858, 12028, 11199, 10369, 9539, 8710, 7880, 7051, 
+	  6221, 5392, 4562, 3733, 2903, 2074, 1244, 415, 
+	  -415, -1244, -2074, -2903, -3733, -4562, -5392, -6221, 
+	  -7051, -7880, -8710, -9539, -10369, -11199, -12028, -12858, 
+	  -13687, -14517, -15346, -16176, -17005, -17835, -18664, -19494, 
+	  -20323, -21153, -21982, -22812, -23641, -24471, -25300, -26130, 
+	  -26959, -27789, -28618, -29448, -30277, -31107, -31936, -32766 ; 
 	prs_sfc=		 1, 2, 3, 4, 5, 6, 7, 8,
 				 9,10,11,12,13,14,15,16,
 				17,18,19,20,21,22,23,24,
diff --git a/data/in_grp.cdl b/data/in_grp.cdl
index 5fdf630..0c44423 100644
--- a/data/in_grp.cdl
+++ b/data/in_grp.cdl
@@ -97,6 +97,47 @@ netcdf in_grp {
   
   float lat_lon(lat,lon);
 
+  float att_var(time);
+ att_var:byte_att = '\000','\001','\002','\177','\200','\201','\376','\377';
+ att_var:char_att = "Sentence one.\nSentence two.\n";
+ att_var:short_att = 37s;
+ att_var:int_att = 73;
+ att_var:long_att = 73;
+ att_var:float_att = 73.0f,72.0f,71.0f,70.010f,69.0010f,68.010000f,67.01000100f;
+ att_var:double_att = 73.0,72.0,71.0,70.010,69.0010,68.010000,67.01000100;
+  
+  int att_var_jsn;
+ att_var_jsn:char\ att\ with\ whitespace = "cf-json.org <http://cf-json.org>";
+ att_var_jsn:double\ att\ with\ whitespace = 3.14;
+ att_var_jsn:int\ att\ with\ whitespace = 1;
+ att_var_jsn:int_array\ att\ with\ whitespace = 1,2;
+ string att_var_jsn:string_array\ att\ with\ whitespace = "1","2";
+  
+  // Purpose: Test special characters in names
+  // Most special characters need backslash protection
+  int att_var_spc_chr;
+ att_var_spc_chr:space\ in\ name = "foo";
+ att_var_spc_chr:comma_in_name\, = "foo";
+ att_var_spc_chr:lt_in_name\< = "foo";
+ att_var_spc_chr:gt_in_name\> = "foo";
+ att_var_spc_chr:hash_in_name\# = "foo";
+ att_var_spc_chr:xclaim_in_name\! = "foo";
+ att_var_spc_chr:dollar_in_name\$ = "foo";
+ att_var_spc_chr:ampersand_in_name\& = "foo";
+ att_var_spc_chr:equals_in_name\= = "foo";
+ att_var_spc_chr:semicolon_in_name\; = "foo";
+ att_var_spc_chr:colon_in_name\: = "foo";
+ att_var_spc_chr:lbrace_in_name\{ = "foo";
+ att_var_spc_chr:rbrace_in_name\} = "foo";
+ att_var_spc_chr:lparen_in_name\( = "foo";
+ att_var_spc_chr:rparen_in_name\) = "foo";
+ att_var_spc_chr:lbracket_in_name\[ = "foo";
+ att_var_spc_chr:rbracket_in_name\] = "foo";
+ att_var_spc_chr:plus_in_name+ = "foo";
+  //  : period_in_name. = "foo"; // Likely to cause DAP server error
+ att_var_spc_chr:hyphen_in_name- = "foo";
+ att_var_spc_chr:at_in_name@ = "foo";
+  
 // Global attributes
   :Conventions = "CF-1.0";
   :history = "History global attribute.\n";
@@ -118,6 +159,9 @@ netcdf in_grp {
   time=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.;
   unique=73;
   val_one_mss=1.,1.0e36;
+  att_var=10.0,10.1,10.20,10.3000,10.40101,10.500001,10.60000001,10.7000001,10.80,10.9900;
+  att_var_jsn=73;
+  att_var_spc_chr=73;
 
  group: g1 { 
   :history = "History group attribute.\n";
@@ -487,6 +531,7 @@ netcdf in_grp {
  group: g12 { // Level 1
     // Purpose: Test special characters in names
     // Most special characters need backslash protection
+  : space\ in\ name = "foo";
   : comma_in_name\, = "foo";
   : lt_in_name\< = "foo";
   : gt_in_name\> = "foo";
diff --git a/data/ncclimo b/data/ncclimo
index cdf0b03..adafbbb 100755
--- a/data/ncclimo
+++ b/data/ncclimo
@@ -77,9 +77,9 @@ fi # HOSTNAME
 if [ -z "${DATA}" ]; then
     case "${HOSTNAME}" in 
 	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 
+	blues* | blogin* | b[0123456789][0123456789][0123456789] ) DATA="/lcrc/project/ACME/${USER}" ; ;; # ALCF blues compute nodes named bNNN, 36|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)
+	cori* | edison* ) DATA="${SCRATCH}" ; ;; # NERSC cori/edison compute nodes all named nidNNNNN, edison 24|64 cores|GB/node; cori 32|(96/128) cores|GB/node (knl/haswell) (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
@@ -89,7 +89,7 @@ fi # DATA
 
 # Ensure batch jobs access correct 'mpirun' (or, with SLURM, 'srun') command, netCDF library, and NCO executables and library
 # 20170914 Entire block is identical between ncclimo and ncremap---keep it that way!
-# hrd_pth a placeholder no-op that could one day be used as a command-line option to control environment
+# hrd_pth is a placeholder no-op that could be a command-line option to control environment
 # Set NCO_PATH_OVERRIDE to 'No' to prevent NCO from executing next block that overrides PATH:
 # export NCO_PATH_OVERRIDE='No'
 hrd_pth='Yes' # [sng] Hard-code machine-dependent paths/modules if HOSTNAME in database
@@ -292,7 +292,8 @@ fi # !hrd_pth && !NCO_PATH_OVERRIDE
 # 2. Cobalt appends stdout/stderr to existing output files, if any, whereas PBS overwrites existing files
 # 3. Cobalt uses ${COBALT_NODEFILE} and (NA) whereas PBS uses ${PBS_NODEFILE} and ${PBS_NUM_PPN}, respectively, and SLURM uses ${SLURM_NODELIST} and ${SLURM_CPUS_ON_NODE}, respectively
 # 4. SLURM automatically combines stdout and stderr, yet does not understand tilde (~ = home directory) expansion in error/output filenames
-# Differences 1 & 2 impose slightly different invocations; difference 3 requires abstracting environment variables; difference 4 requires omitting ~'s
+# 5. After merger of Cori Phase 1 Haswell and Phase 2 KNL cabinets in ~2017, SLURM on Cori requires Quality-of-Service (QOS) argument, either -C haswell or -C knl
+# Differences 1 & 2 impose slightly different invocations; difference 3 requires abstracting environment variables; difference 4 requires omitting ~'s; difference 5 requires -C argument on Cori only
 #   Blues a):  echo "ncclimo -a scd -d 1 -p mpi -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.pbs;chmod a+x ~/ncclimo.pbs
 #   Cooley a): /bin/rm -f ~/ncclimo.err  ~/ncclimo.out
 #              echo '#!/bin/bash' > ~/ncclimo.cobalt
@@ -302,7 +303,8 @@ fi # !hrd_pth && !NCO_PATH_OVERRIDE
 #   Rhea a):   echo "ncclimo -a scd -d 1 -p mpi -c famipc5_ne120_v0.3_00003 -s 1980 -e 1983 -i /lustre/atlas1/cli115/world-shared/mbranst/famipc5_ne120_v0.3_00003-wget-test -o ${DATA}/ne120/clm -r ${DATA}/maps/map_ne120np4_to_fv257x512_aave.20150901.nc"  > ~/ncclimo.pbs;chmod a+x ~/ncclimo.pbs
 #   Blues b):  qsub -A ACME -q acme -l nodes=1 -l walltime=00:30:00 -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 #   Cooley b): qsub -A HiRes_EarthSys --nodecount=12 --time=00:30:00 --jobname ncclimo --error ~/ncclimo.err --output ~/ncclimo.out --notify zender at uci.edu ~/ncclimo.cobalt
-#   Cori,Edison b): sbatch -A acme --nodes=12 --time=00:30:00 --partition=regular --job-name=ncclimo --mail-type=END --output=${HOME}/ncclimo.out ~/ncclimo.slurm
+#   Cori b): sbatch -A acme -C haswell --nodes=12 --time=00:30:00 --partition=debug --job-name=ncclimo --mail-type=END --output=${HOME}/ncclimo.out ~/ncclimo.slurm
+#   Edison b): sbatch -A acme --nodes=12 --time=00:30:00 --partition=debug --job-name=ncclimo --mail-type=END --output=${HOME}/ncclimo.out ~/ncclimo.slurm
 #   Hopper b): qsub -A acme -V -l mppwidth=288 -l walltime=00:30:00 -q regular -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 #   Rhea b):   qsub -A CLI115 -V -l nodes=12 -l walltime=00:30:00 -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 
@@ -421,6 +423,7 @@ 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)
+dfl_lvl=0 # [enm] Deflate level
 drc_in='' # [sng] Input file directory
 drc_in_xmp="${DATA}/ne30/raw" # [sng] Input file directory for examples
 drc_in_mps="${DATA}/mpas/raw" # [sng] Input file directory for MPAS examples
@@ -434,6 +437,7 @@ drc_rgr_xmp="${DATA}/ne30/rgr" # [sng] Regrid file directory for examples
 drc_rgr_xtn='' # [sng] Regridded file directory for for extended climatology
 drc_xtn='' # [sng] Directory containing extended climatology
 dpy=365 # [nbr] Days-per-year
+fl_fmt='' # [enm] Output file format
 fl_nbr=0 # [nbr] Number of files to split
 fml_nm='' # [sng] Family name (i.e., nickname, e.g., 'amip', 'control', 'experiment')
 gaa_sng_std="--gaa climo_script=${spt_nm} --gaa climo_command=\"'${cmd_ln}'\" --gaa climo_hostname=${HOSTNAME} --gaa climo_version=${nco_vrs}" # [sng] Global attributes to add
@@ -454,6 +458,7 @@ nd_nbr=1 # [nbr] Number of nodes
 no_ntv_tms='No' # [flg] Omit native-grid split timeseries
 par_opt='' # [sng] Parallel options to shell
 par_typ='bck' # [sng] Parallelism type
+ppc_prc='' # [nbr] Precision-preserving compression precision
 rgr_map='' # [sng] Regridding map
 #rgr_map="${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc"
 rgr_opt='' # [sng] Regridding options (e.g., '--rgr col_nm=lndgrid', '--rgr col_nm=nCells')
@@ -477,6 +482,11 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     printf "${fnt_bld}${spt_nm} -v var_lst -s yr_srt -e yr_end -o drc_out -r rgr_map in1.nc in2.nc ... inN.nc${fnt_nrm} # Split, reshape, & regrid timeseries\n"
     printf "${fnt_bld}${spt_nm} --case=caseid --start=yr_srt --end=yr_end --input=drc_in --output=drc_out --map=rgr_map${fnt_nrm} # Long options\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 CDF1) [${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 (netCDF3/PnetCDF CDF5) [${fnt_tlc}fl_fmt, file_format=64bit_data${fnt_nrm}]"
+    echo "${fnt_rvr}-6${fnt_nrm}          Output file format 64BIT_OFFSET (netCDF3 64bit CDF2) [${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}dec_md${fnt_nrm}   December mode (default ${fnt_bld}${dec_md}${fnt_nrm}) [${fnt_tlc}dec_md, december_mode, dec_mode${fnt_nrm}]"
     echo "${fnt_rvr}-C${fnt_nrm} ${fnt_bld}clm_md${fnt_nrm}   Climatology mode (default ${fnt_bld}${clm_md}${fnt_nrm}) [${fnt_tlc}clm_md, climatology_mode, climo_mode${fnt_nrm}]"
     echo "${fnt_rvr}-c${fnt_nrm} ${fnt_bld}caseid${fnt_nrm}   Case ID string (default ${fnt_bld}${caseid}${fnt_nrm}) [${fnt_tlc}caseid, case_id, case${fnt_nrm}]"
@@ -484,9 +494,11 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-E${fnt_nrm} ${fnt_bld}yr_end${fnt_nrm}   End year previous climo (empty means none) (default ${fnt_bld}${yr_end_prv}${fnt_nrm}) [${fnt_tlc}yr_end_prv, prv_yr_end, previous_end${fnt_nrm}]"
     echo "${fnt_rvr}-e${fnt_nrm} ${fnt_bld}yr_end${fnt_nrm}   End year (default ${fnt_bld}${yr_end}${fnt_nrm}) [${fnt_tlc}yr_end, end_yr, year_end, end_year, end${fnt_nrm}]"
     echo "${fnt_rvr}-f${fnt_nrm} ${fnt_bld}fml_nm${fnt_nrm}   Family name (nickname) (empty means none) (default ${fnt_bld}${fml_nm}${fnt_nrm}) [${fnt_tlc}fml_nm, family_name${fnt_nrm}]"
+    echo " ${fnt_bld}--fl_fmt${fnt_nrm}   File format (empty is inherited from input) (default ${fnt_bld}${fl_fmt}${fnt_nrm}) [${fnt_tlc}fl_fmt, fmt_out, file_format, format_out${fnt_nrm}]"
     echo "${fnt_rvr}-h${fnt_nrm} ${fnt_bld}hst_nm${fnt_nrm}   History volume name (default ${fnt_bld}${hst_nm}${fnt_nrm}) [${fnt_tlc}hst_nm, history_name, history${fnt_nrm}]"
     echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}drc_in${fnt_nrm}   Input directory (default ${fnt_bld}${drc_in}${fnt_nrm}) [${fnt_tlc}drc_in, in_drc, dir_in, in_dir, input${fnt_nrm}]"
     echo "${fnt_rvr}-j${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm}  Job simultaneity for parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm}) [${fnt_tlc}job_nbr, job_number, jobs${fnt_nrm}]"
+    echo " ${fnt_bld}-L${fnt_nrm}  Deflate level (empty is none) (default ${fnt_bld}${dfl_lvl}${fnt_nrm}) [${fnt_tlc}dfl_lvl, dfl, deflate${fnt_nrm}]"
     echo "${fnt_rvr}-l${fnt_nrm} ${fnt_bld}lnk_flg${fnt_nrm}  Link E3SM/ACME-climo to AMWG-climo filenames (default ${fnt_bld}${lnk_flg}${fnt_nrm}) [${fnt_tlc}lnk_flg, link_flag, no_amwg_links${fnt_nrm}]"
     echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}mdl_nm${fnt_nrm}   Model name (default ${fnt_bld}${mdl_nm}${fnt_nrm}) [${fnt_tlc}mdl_nm, model_name, model${fnt_nrm}]"
     echo "${fnt_rvr}-n${fnt_nrm} ${fnt_bld}nco_opt${fnt_nrm}  NCO options (empty means none) (default ${fnt_bld}${nco_opt}${fnt_nrm}) [${fnt_tlc}nco_opt, nco, nco_options${fnt_nrm}]"
@@ -497,6 +509,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-O${fnt_nrm} ${fnt_bld}drc_rgr${fnt_nrm}  Regridded directory (default ${fnt_bld}${drc_rgr}${fnt_nrm}) [${fnt_tlc}drc_rgr, rgr_drc, dir_regrid, regrid${fnt_nrm}]"
     echo "${fnt_rvr}-o${fnt_nrm} ${fnt_bld}drc_out${fnt_nrm}  Output directory (default ${fnt_bld}${drc_out}${fnt_nrm}) [${fnt_tlc}drc_out, out_drc, dir_out, out_dir, output${fnt_nrm}]"
     echo "${fnt_rvr}-p${fnt_nrm} ${fnt_bld}par_typ${fnt_nrm}  Parallelism type (default ${fnt_bld}${par_typ}${fnt_nrm}) [${fnt_tlc}par_typ, par_md, parallel_type, parallel_mode, parallel${fnt_nrm}]"
+    echo " ${fnt_bld}--ppc_prc${fnt_nrm}  Precision-preserving compression precision (empty means none) (default ${fnt_bld}${ppc_prc}${fnt_nrm}) [${fnt_tlc}ppc, ppc_prc, precision, quantize${fnt_nrm}]"
     echo "${fnt_rvr}-R${fnt_nrm} ${fnt_bld}rgr_opt${fnt_nrm}  Regrid options (empty means none) (default ${fnt_bld}${rgr_opt}${fnt_nrm}) [${fnt_tlc}rgr_opt, regrid_options${fnt_nrm}]"
     echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rgr_map${fnt_nrm}  Regrid map (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}]"
@@ -576,8 +589,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 (see method by Adam Katz)
 # http://tuxtweaks.com/2014/05/bash-getopts
-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
+while getopts :34567a:C:c:d:E:e:f:h:i:j:L:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: 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) dec_md="${OPTARG}" ;; # December mode
 	C) clm_md_usr="${OPTARG}" ;; # Climatology mode
 	c) caseid="${OPTARG}" ;; # CASEID
@@ -588,6 +606,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
 	h) hst_nm="${OPTARG}" ;; # History tape name
 	i) drc_in="${OPTARG}" ;; # Input directory
 	j) job_usr="${OPTARG}" ;; # Job simultaneity
+	L) dfl_lvl="${OPTARG}" ;; # Deflate level
 	l) lnk_flg="${OPTARG}" ;; # Link E3SM/ACME to AMWG name
 	m) mdl_nm="${OPTARG}" ;; # Model name
 	n) nco_opt="${OPTARG}" ;; # NCO options
@@ -615,11 +634,13 @@ 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
 	       clm_md=?* | climatology_mode=?* | climo_mode=?* ) clm_md_usr="${LONG_OPTARG}" ;; # -C # Climatology mode
 	       caseid=?* | case_id=?* | case=?* ) caseid="${LONG_OPTARG}" ;; # -c # CASEID
 	       dbg_lvl=?* | dbg=?* | debug=?* | debug_level=?* ) dbg_lvl="${LONG_OPTARG}" ;; # -d # Debugging level
+	       dfl_lvl=?* | deflate=?* | dfl=?* ) dfl_lvl="${LONG_OPTARG}" ;; # -L # Deflate level
 	       yr_end_prv=?* | prv_yr_end=?* | previous_end=?* ) yr_end_prv="${LONG_OPTARG}" ;; # -E # End year previous
 	       yr_end=?* | end_yr=?* | year_end=?* | end_year=?* | end=?* ) yr_end="${LONG_OPTARG}" ;; # -e # End year
 	       fml_nm=?* | family_name=?* | family=?* ) fml_nm_usr="${LONG_OPTARG}" ;; # -f # Family name
 	       hst_nm=?* | history_name=?* | history=?* ) hst_nm="${LONG_OPTARG}" ;; # -h # History tape name
 	       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
 	       job_nbr=?* | job_number=?* | jobs=?* ) job_usr="${LONG_OPTARG}" ;; # -j # Job simultaneity
 	       lnk_flg | link_flag | no_amwg_link | no_amwg_links | no_AMWG_link | no_AMWG_links ) lnk_flg='No' ;; # -l # Link E3SM/ACME to AMWG name
 	       lnk_flg=?* | link_flag=?* | no_amwg_link=?* | no_amwg_links=?* | no_AMWG_link=?* | no_AMWG_links=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # -l # Link E3SM/ACME to AMWG name
@@ -636,6 +657,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
 	       drc_out=?* | out_drc=?* | dir_out=?* | out_dir=?* | output=?* ) drc_out_usr="${LONG_OPTARG}" ;; # -o # Output directory
 	       drc_rgr=?* | rgr_drc=?* | dir_regrid=?* | regrid_dir=?* | regrid=?* ) drc_rgr_usr="${LONG_OPTARG}" ;; # -O # Regridded directory
 	       par_typ=?* | par_md=?* | parallel_type=?* | parallel_mode=?* | parallel=?* ) par_typ="${LONG_OPTARG}" ;; # -p # Parallelism type
+	       ppc=?* | ppc_prc=?* | precision=?* | quantize=?* ) ppc_prc="${LONG_OPTARG}" ;; # # Precision-preserving compression
 	       rgr_opt=?* | regrid_options=?* ) rgr_opt="${LONG_OPTARG}" ;; # -R # Regridding options
 	       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
@@ -890,6 +912,24 @@ fi # !gaa_sng
 if [ -n "${job_usr}" ]; then 
     job_nbr="${job_usr}"
 fi # !job_usr
+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'
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '5' ] || [ "${fl_fmt}" = '64bit_data' ] || [ "${fl_fmt}" = 'cdf5' ]; then
+	nco_fl_fmt='--fl_fmt=64bit_data'
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '6' ] || [ "${fl_fmt}" = '64bit_offset' ] || [ "${fl_fmt}" = '64' ]; then
+	nco_fl_fmt='--fl_fmt=64bit_offset'
+    fi # !fl_fmt
+    if [ "${fl_fmt}" = '7' ] || [ "${fl_fmt}" = 'netcdf4_classic' ]; then
+	nco_fl_fmt='--fl_fmt=netcdf4_classic'
+    fi # !fl_fmt
+    nco_opt="${nco_opt} ${nco_fl_fmt}"
+fi # !fl_fmt
 if [ ${dbg_lvl} -ge 2 ]; then
     nco_opt="-D ${dbg_lvl} ${nco_opt}"
 fi # !dbg_lvl
@@ -899,6 +939,12 @@ if [ -n "${var_lst}" ] && [ "${sbs_flg}" != 'Yes' ]; then
     nco_opt="${nco_opt} -v ${var_lst}"
     # fi # !mth
 fi # !var_lst
+if [ -n "${ppc_prc}" ]; then
+    nco_opt="${nco_opt} --ppc default=${ppc_prc}"
+fi # !ppc_prc
+if [ -n "${dfl_lvl}" ]; then
+    nco_opt="${nco_opt} --dfl_lvl=${dfl_lvl}"
+fi # !dfl_lvl
 if [ -n "${hdr_pad}" ]; then
     nco_opt="${nco_opt} --hdr_pad=${hdr_pad}"
 fi # !hdr_pad
@@ -1319,6 +1365,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: csn_nbr  = ${csn_nbr}\n"
     printf "dbg: dec_md   = ${dec_md}\n"
     printf "dbg: dbg_lvl  = ${dbg_lvl}\n"
+    printf "dbg: dfl_lvl  = ${dfl_lvl}\n"
     printf "dbg: drc_in   = ${drc_in}\n"
     printf "dbg: drc_nco  = ${drc_nco}\n"
     printf "dbg: drc_out  = ${drc_out}\n"
@@ -1327,6 +1374,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: drc_rgr  = ${drc_rgr}\n"
     printf "dbg: drc_spt  = ${drc_spt}\n"
     printf "dbg: drc_xtn  = ${drc_xtn}\n"
+    printf "dbg: fl_fmt   = ${fl_fmt}\n"
     printf "dbg: fl_nbr   = ${fl_nbr}\n"
     printf "dbg: fml_nm   = ${fml_nm}\n"
     printf "dbg: gaa_sng  = ${gaa_sng}\n"
@@ -1348,6 +1396,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: nd_nbr   = ${nd_nbr}\n"
     printf "dbg: out_nm   = ${out_nm}\n"
     printf "dbg: par_typ  = ${par_typ}\n"
+    printf "dbg: ppc_prc  = ${ppc_prc}\n"
     printf "dbg: rgr_map  = ${rgr_map}\n"
     printf "dbg: rgr_sfx  = ${rgr_sfx}\n"
     printf "dbg: no_ntv   = ${no_ntv_tms}\n"
diff --git a/data/ncremap b/data/ncremap
index 4554f60..a0ac1cc 100755
--- a/data/ncremap
+++ b/data/ncremap
@@ -315,6 +315,7 @@ bch_slr='No' # [sng] SLURM batch (non-interactive) job
 cln_flg='Yes' # [flg] Clean-up (remove) intermediate files before exiting
 clm_flg='No' # [flg] Invoked by ncclimo script
 dbg_lvl=0 # [nbr] Debugging level
+dfl_lvl=0 # [enm] Deflate level
 #drc_in="${drc_pwd}" # [sng] Input file directory
 drc_in='' # [sng] Input file directory
 drc_in_xmp='~/drc_in' # [sng] Input file directory for examples
@@ -322,8 +323,8 @@ drc_out="${drc_pwd}" # [sng] Output file directory
 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
+fl_nbr=0 # [nbr] Number of files to remap
 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
@@ -354,6 +355,7 @@ nd_nbr=1 # [nbr] Number of nodes
 out_fl='' # [sng] Output file
 out_xmp='out.nc' # [sng] Output file for examples
 par_typ='nil' # [sng] Parallelism type
+ppc_prc='' # [nbr] Precision-preserving compression number of significant digits
 prc_typ='' # [sng] Procedure type
 rgr_opt='--rgr lat_nm_out=lat#lon_nm_out=lon' # [sng] Regridding options
 rnr_thr='' # [frc] Renormalization option
@@ -401,20 +403,21 @@ 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}-3${fnt_nrm}          Output file format CLASSIC (netCDF3 classic CDF1) [${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 (netCDF3 CDF5) [${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}-5${fnt_nrm}          Output file format 64BIT_DATA (netCDF3/PnetCDF CDF5) [${fnt_tlc}fl_fmt, file_format=64bit_data${fnt_nrm}]"
+    echo "${fnt_rvr}-6${fnt_nrm}          Output file format 64BIT_OFFSET (netCDF3 64bit CDF2) [${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_bld}--fl_fmt${fnt_nrm}   File format (empty is netCDF3 64bit CDF2) (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}]"
     echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}in_fl${fnt_nrm}    Input file (empty means pipe to stdin or drc_in) (default ${fnt_bld}${in_fl}${fnt_nrm}) [${fnt_tlc}in_fl, in_file, input_file${fnt_nrm}]"
     echo "${fnt_rvr}-j${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm}  Job simultaneity for parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm}) [${fnt_tlc}job_nbr, job_number, jobs${fnt_nrm}]"
+    echo " ${fnt_bld}-L${fnt_nrm}  Deflate level (empty is none) (default ${fnt_bld}${dfl_lvl}${fnt_nrm}) [${fnt_tlc}dfl_lvl, dfl, deflate${fnt_nrm}]"
     echo "${fnt_rvr}-M${fnt_nrm}          Multi-map-file toggle (unset means generate one map-file per input file) [${fnt_tlc}mlt_map, no_multimap${fnt_nrm}]"
     echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm}   Map-file (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm}) [${fnt_tlc}map_fl, map, map_file, rgr_map, regrid_map${fnt_nrm}]"
     echo " ${fnt_bld}--msk_dst${fnt_nrm}  Mask-template variable in destination file (empty means none) (default ${fnt_bld}${msk_dst}${fnt_nrm}) [${fnt_tlc}msk_dst, dst_msk, mask_destination, mask_dst${fnt_nrm}]"
@@ -428,6 +431,8 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-o${fnt_nrm} ${fnt_bld}out_fl${fnt_nrm}   Output-file (regridded file) (empty copies Input filename) (default ${fnt_bld}${out_fl}${fnt_nrm}) [${fnt_tlc}out_fl, out_file, output_file${fnt_nrm}]"
     echo "${fnt_rvr}-P${fnt_nrm} ${fnt_bld}prc_typ${fnt_nrm}  Procedure type (empty means none) (default ${fnt_bld}${prc_typ}${fnt_nrm}) [${fnt_tlc}prc_typ, pdq_typ, prm_typ, procedure${fnt_nrm}]"
     echo "${fnt_rvr}-p${fnt_nrm} ${fnt_bld}par_typ${fnt_nrm}  Parallelism type (default ${fnt_bld}${par_typ}${fnt_nrm}) [${fnt_tlc}par_typ, par_md, parallel_type, parallel_mode, parallel${fnt_nrm}]"
+# 20171101: Implement but do not yet advertise PPC in ncremap
+#    echo " ${fnt_bld}--ppc${fnt_nrm} ${fnt_bld}ppc_prc${fnt_nrm} Precision-preserving compression (empty means none) (default ${fnt_bld}${ppc_prc}${fnt_nrm}) [${fnt_tlc}ppc, precision, quantize${fnt_nrm}]"
     echo "${fnt_rvr}-R${fnt_nrm} ${fnt_bld}rgr_opt${fnt_nrm}  Regrid options (empty means none) (default ${fnt_bld}${rgr_opt}${fnt_nrm}) [${fnt_tlc}rgr_opt, regrid_options${fnt_nrm}]"
     echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rnr_thr${fnt_nrm}  Renormalization threshold (empty means none) (default ${fnt_bld}${rnr_thr}${fnt_nrm}) [${fnt_tlc}rnr_thr, thr_rnr, renormalize_threshold${fnt_nrm}]"
     echo " ${fnt_bld}--rgn_dst${fnt_nrm}  Regional destination grid [${fnt_tlc}rgn_dst, dst_rgn, regional_destination${fnt_nrm}]"
@@ -491,7 +496,7 @@ 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 :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
+while getopts :34567a:CD:d:f:g:G:h:I:i:j:L:Mm:n:O:o:P:p:R:r:s:T:t:Uu:V:v:W:w:x:-: OPT; do
     case ${OPT} in
 	3) fl_fmt='3' ;; # File format
 	4) fl_fmt='4' ;; # File format
@@ -507,6 +512,7 @@ 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:-:
 	I) drc_in="${OPTARG}" ;; # Input directory
 	i) in_fl="${OPTARG}" ;; # Input file
 	j) job_usr="${OPTARG}" ;; # Job simultaneity
+	L) dfl_lvl="${OPTARG}" ;; # Deflate level
 	M) mlt_map_flg='No' ;; # Multi-map flag
 	m) map_fl="${OPTARG}" ;; # Map-file
 	n) nco_usr="${OPTARG}" ;; # NCO options
@@ -535,6 +541,7 @@ 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:-:
 	       alg_typ=?* | algorithm=?* | regrid_algorithm=?* ) alg_typ="${LONG_OPTARG}" ;; # -a # Algorithm
 	       clm_flg=?* | climatology_flag=?* ) clm_flg='Yes' ;; # -C # Climo flag (undocumented)
 	       dbg_lvl=?* | dbg=?* | debug=?* | debug_level=?* ) dbg_lvl="${LONG_OPTARG}" ;; # -d # Debugging level
+	       dfl_lvl=?* | deflate=?* | dfl=?* ) dfl_lvl="${LONG_OPTARG}" ;; # -L # Deflate level
 	       dst_fl=?* | destination_file=?* | template_file=?* | template=?* ) dst_fl="${LONG_OPTARG}" ;; # -d # Destination file
 	       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
@@ -559,6 +566,7 @@ 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:-:
 	       out_fl=?* | output_file=?* | out_file=?* ) out_fl="${LONG_OPTARG}" ;; # -o # Output file
 	       prc_typ=?* | pdq_typ=?* | prm_typ=?* | procedure=?* ) prc_typ="${LONG_OPTARG}" ;; # -P # Procedure type
 	       par_typ=?* | par_md=?* | parallel_type=?* | parallel_mode=?* | parallel=?* ) par_typ="${LONG_OPTARG}" ;; # -p # Parallelism type
+	       ppc=?* | ppc_prc=?* | precision=?* | quantize=?* ) ppc_prc="${LONG_OPTARG}" ;; # # Precision-preserving compression
 	       rgr_opt=?* | regrid_options=?* ) rgr_opt="${LONG_OPTARG}" ;; # -R # Regridding options
 	       rnr_thr=?* | thr_rnr=?* | renormalization_threshold=?* ) rnr_thr="${LONG_OPTARG}" ;; # -r # Renormalization threshold
 	       rgn_dst=?* | dst_rgn=?* | regional_destination=?* ) hnt_dst='--dst_regional' ;; # # Regional destination grid
@@ -757,7 +765,7 @@ if [ -n "${fl_fmt}" ]; then
     fi # !fl_fmt
     if [ "${fl_fmt}" = '5' ] || [ "${fl_fmt}" = '64bit_data' ] || [ "${fl_fmt}" = 'cdf5' ]; then
 	nco_fl_fmt='--fl_fmt=64bit_data'
-	wgt_opt_esmf="${wgt_opt_esmf} --64bit_offset" # Change when ERWG supports netCDF5
+	wgt_opt_esmf="${wgt_opt_esmf} --64bit_offset" # Change when ERWG supports CDF5
     fi # !fl_fmt
     if [ "${fl_fmt}" = '6' ] || [ "${fl_fmt}" = '64bit_offset' ] || [ "${fl_fmt}" = '64' ]; then
 	nco_fl_fmt='--fl_fmt=64bit_offset'
@@ -803,6 +811,12 @@ fi # !job_usr
 if [ ${dbg_lvl} -ge 2 ]; then
     nco_opt="-D ${dbg_lvl} ${nco_opt}"
 fi # !dbg_lvl
+if [ -n "${ppc_prc}" ]; then
+    nco_opt="${nco_opt} --ppc default=${ppc_prc}"
+fi # !ppc_prc
+if [ -n "${dfl_lvl}" ]; then
+    nco_opt="${nco_opt} --dfl_lvl=${dfl_lvl}"
+fi # !dfl_lvl
 if [ -n "${nco_usr}" ]; then 
     nco_opt="${nco_usr} ${nco_opt}"
 fi # !var_lst
@@ -1138,6 +1152,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: alg_opt  = ${alg_opt}\n"
     printf "dbg: cln_flg  = ${cln_flg}\n"
     printf "dbg: dbg_lvl  = ${dbg_lvl}\n"
+    printf "dbg: dfl_lvl  = ${dfl_lvl}\n"
     printf "dbg: drc_in   = ${drc_in}\n"
     printf "dbg: drc_out  = ${drc_out}\n"
     printf "dbg: drc_tmp  = ${drc_tmp}\n"
@@ -1162,6 +1177,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: nd_nbr   = ${nd_nbr}\n"
     printf "dbg: out_fl   = ${out_fl}\n"
     printf "dbg: par_typ  = ${par_typ}\n"
+    printf "dbg: ppc_prc  = ${ppc_prc}\n"
     printf "dbg: rgr_opt  = ${rgr_opt}\n"
     printf "dbg: rnr_thr  = ${rnr_thr}\n"
     printf "dbg: sgs_frc  = ${sgs_frc}\n"
diff --git a/debian/changelog b/debian/changelog
index 0eb8f8b..14a8052 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nco (4.7.0-1) unstable; urgency=low
+
+  * new upstream version ncremap/ncclimo dfl_lvl, fl_fmt;ncclimo ppc;ncra/ncrcat neg hyp;quiet CDF5, ncrename
+
+ -- Charlie Zender <zender at uci.edu>  Wed, 08 Nov 2017 12:25:26 -0700
+
 nco (4.6.9-1) unstable; urgency=low
 
   * new upstream version CDF5, CMake, MPAS-O/I
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index 9bada1b..630a2a8 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,62 +1,60 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.6.9 are released. 
+The netCDF Operators NCO version 4.7.0 are released. 
 
 http://nco.sf.net (Homepage, Mailing lists)
 http://github.com/nco (Source Code, Releases, Developers)
 
 What's new?
-Version 4.6.9 fixes a few issues has no new major features.
-Most improvements relate to CDF5 handling and CMake builds.
-Also, ncks now prints CDL by default.
-
-I shelved my plans to skip 4.6.9 because we discovered a
-consequential bug with the netCDF CDF5 implementation.
-This led to a flurry of mini-features to diagnose and warn
-users who might inadvertently stumble on corrupt CDF5 data.
-Understanding the ramifications of this CDF5 bug is ongoing.
-The best case scenario now, after a month of investigation,
-is that Unidata will soon declare the bug solved and put the 
-appropriate patches in netCDF 4.5.0. We may make final
-adjustments to diagnose/handle CDF5 issues based on those
-patches, and release NCO 4.7.0 soon thereafter.
-
-Work on NCO 4.7.0 has commenced. Planned changes include
+Version 4.7.0 adds spit and polish through the toolkit.
+Nothing major stands out, except perhaps for easy access
+to compression algorithms in ncclimo and ncremap.
+
+Work on NCO 4.7.1 has commenced. Planned changes include
 better diagnosis and workarounds for the netCDF CDF5 bug,
-and more ncclimo and ncremap features, and CMake polishing. 
+and parallel weight generation by ncremap.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-A. CDF5: NCO warns when CDF5 files may be corrupted by the newly
-   discovered (!) netCDF CDF5 bug: http://nco.sf.net#bug_cdf5
-
-B. CDF5: All NCO operators now fully support CDF5.
-   Previously some operators would not output it.
-   Now, all output CDF5 with the -5 switch:
-   ncra -5 in*.nc out.nc
-   This includes auto-conversion.
-   ncks converts among netCDF's five-different binary formats:
-   ncks [-3 -4 -5 -6 -7] in.nc out.nc
+A. ncclimo and ncremap accept fl_fmt options for output file format.  
+   The option behaves the same as it does for other operators:
+   ncclimo [-3 -4 -5 -6 -7] ...
+   ncremap [-3 -4 -5 -6 -7] ...
+   ncclimo --fl_fmt=netcdf4 ...
+   ncremap --fl_fmt=cdf5 ...
+   http://nco.sf.net/nco.html#fl_fmt
    http://nco.sf.net/nco.html#autoconversion
 
-C. CDF5: In support of detecting the CDF5 bug, and also for more
-   general use, are new ncks features to print, in CDL comments,
-   the uncompressed RAM size of every variable (when dbg_lvl >= 1).
-   When dbg_lvl >= 2, the RAM size of all the data in a file,
-   and the variable ID of each variable, are also printed.
-   ncks -D 1 -v one ~/nco/data/in.nc
-   ncks -D 2 -v one ~/nco/data/in.nc
-   ncks -M -D 2 -v one ~/nco/data/in.nc
-   http://nco.sf.net#cdl
-
-D. Pedro Vicente has generously contributed a CMake build-engine. 
-   CMake can build NCO on any architecture, including MS Windows,
-   and makes available nearly all important features, including ncap2, 
-   GSL, DAP, and UDUnits2. A few esoteric NCO features (intrinsic math
-   functions like erf(),erff(),gamm()...) remain to be implemented. 
+B. ncclimo and ncremap accept the dfl_lvl option for compression.
+   The value of dfl_lvl is an integer fro 0..9 that specifies the
+   DEFLATE (= Lempel-Ziv + Huffman) compression level for netCDF4.
+   The option behaves the same as it does for other operators:
+   ncclimo --dfl_lvl=3 ...
+   ncremap --dfl_lvl=3 ...
+   ncclimo -L 3 ...
+   ncremap -L 3 ...
+   http://nco.sf.net/nco.html#deflate
+
+C. ncclimo accepts the ppc option for Precision-Preserving Compression. 
+   Other operators allow multiple, per-variable PPC specification.
+   ncclimo allows only one PPC option, equivalent to specifying
+   --ppc default=<val> with the compiled operators.  
+   NB: regridding does not yet accept PPC.
+   ncclimo --ppc=3 ...
+   http://nco.sf.net/nco.html#ppc
+   http://nco.sf.net/nco.html#bitgrooming
+
+D. ncrename is now quiet by default, like all other operators.
+   The old summary line that tallied the numbers of things renamed
+   can still be seen by invoking ncrename with -D 1.
+   http://nco.sf.net#ncrename
+
+E. CMake: Pedro Vicente contributed a CMake build-engine in 4.6.9. 
+   The CMake engine now correctly links ncap2 to intrinsic math
+   functions like erf(), gamma(), ... 
    Please give us feedback on any wrinkles in the CMake build. 
    To build with CMake and install in /usr/local: 
    cd nco/cmake
@@ -66,26 +64,25 @@ D. Pedro Vicente has generously contributed a CMake build-engine.
    Additional examples in cmake/build.bat
    http://nco.sf.net#bld
 
-E. ncks now prints CDL by default.
-   Advance notice of this change was first given in May.
-   Use the --trd switch to print with "traditional" syntax:
-   ncks in.nc
-   ncks --trd in.nc
-   http://nco.sf.net/nco.html#trd
-   http://nco.sf.net/nco.html#cdl
-
-F. ncclimo and ncremap have changes "under-the-hood".
-   E3SM/ACME users may notice cosmetic differences.
-   Hard-coded paths on DOE machines can now be avoided by
-   export NCO_PATH_OVERRIDE='No'
-   in the shell where ncclimo/ncremap are invoked.
-   http://nco.sf.net/nco.html#ncclimo
+F. The automatic CDF5 bug checker in 4.6.9 has been turned-off.
+   It produced too much distracting output in workflows affected
+   by the CDF5 bug. To activate this check, build NCO with, e.g.,
+   CPPFLAGS='-DNCO_CDF5_BUG_CHK' ./configure ...
+   The checker itself has been improved so that, when turned on,
+   operators are now quiet when sniffing CDF5 files for corruption,
+   until they detect a "large" (> 4 GB) variable.
+   In 4.6.9 the sniffing algorithm was noisier, and printed an INFO
+   upon closing any CDF5 file.
+   http://nco.sf.net#bug_cdf5
 
 BUG FIXES:
 
-A. ncclimo false-positive messages about 'ANN' eliminated
-
-B. ncclimo/ncremap updated udunits2 module for edison
+A. Fix bug where ncra and ncrcat treated negative record hyperslab
+   indices with old (pre-2014) convention, and were off-by-one
+   relative to the 2014+ Python-based convention. Previously
+   "ncrcat -d time,-1" extracted the penultimate record, now it
+   extracts the last. This bug only affected the record dimension
+   of the multi-file operators ncra and ncrcat.
 
 Full release statement at http://nco.sf.net/ANNOUNCE
 
@@ -93,9 +90,9 @@ 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.9 built/tested under
+   These problems occur with NCO 4.7.0 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.
+   Linux with netCDF 4.5.1-development (201701101) on HDF5 1.8.19.
 
 A. NOT YET FIXED (NCO problem)
    Correctly read arrays of NC_STRING with embedded delimiters in ncatted arguments
@@ -151,6 +148,7 @@ B. NOT YET FIXED (netCDF4 library bug)
    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
+   20171102: Verified problem still exists with netCDF 4.5.1-development
 
    Bug tracking: https://www.unidata.ucar.edu/jira/browse/fxm
    More details: http://nco.sf.net/nco.html#ncrename_crd
@@ -163,6 +161,7 @@ C. NOT YET FIXED (netCDF4 library bug)
 
    20170323: Confirmed problem reported by Paolo Oliveri, reported to Unidata
    20170323: https://github.com/Unidata/netcdf-c/issues/381
+   20171102: Verified problem still exists with netCDF 4.5.1-development
 
    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 43d9be0..a212131 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,123 @@
+2017-11-08  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.0 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0: Ta Nehisi';git push
+	git tag -a 4.7.0 -m 'ncremap/ncclimo dfl_lvl, fl_fmt;ncclimo ppc;nco_map/msh_mk();ncra/ncrcat neg hyp;quiet CDF5, ncrename';git push --tags
+
+	* Protect CDF5 bug check by #ifdef NCO_CDF5_BUG_CHK to quiet Luke Van Roekel's hi-res MPAS-O Analysis output
+
+2017-11-07  Charlie Zender  <zender at uci.edu>
+
+	* Add pre-emptive numeric codes for netCDF library versions 4.5.2--4.5.3
+
+	* NCO 4.7.0-beta01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0-beta01: Hairy Yoda';git push
+	git tag -a 4.7.0-beta01 -m 'Verified CMake on Windows';git push --tags
+
+2017-11-01  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.0-alpha04 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0-alpha04: Mag-unsafe';git push
+	git tag -a 4.7.0-alpha04 -m 'ncrename quiet, ncremap dfl_lvl, ncclimo ppc';git push --tags
+
+	* Fix ncrename regressions caused by 20171029 change
+
+	* Update documentation and homepage and nco_netcdf.c regarding CDF5 bug and netCDF 4.5.0
+
+	* Implement but do not document ppc in ncremap, option currently does nothing
+	Would not be too hard to finish, but unclear that PPC is appropriate for ncremap
+
+	* Test and document ncclimo --ppc
+
+2017-10-31  Charlie Zender  <zender at uci.edu>
+
+	* Add ppc option to ncclimo
+
+2017-10-29  Charlie Zender  <zender at uci.edu>
+
+	* Quiet ncrename: As per PJCS request, summary renaming only prints with dbg_lvl > 0
+
+2017-10-25  Charlie Zender  <zender at uci.edu>
+
+	* Add, document, and test -L dfl_lvl option to ncremap
+
+2017-10-22  Charlie Zender  <zender at uci.edu>
+
+	* Add att_var_jsn to in.cdl in_grp.cdl to demonstrate JSON formats
+
+2017-10-20  Charlie Zender  <zender at uci.edu>
+
+	* Add CF2 Out-of-Group search algorithm figure alg_cf2_oog.pptx
+
+2017-10-15  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.0-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0-alpha03: Ultrasonic Curtains';git push
+	git tag -a 4.7.0-alpha03 -m 'nco_map/msh_mk() routines;ncclimo deflate';git push --tags
+
+2017-10-13  Charlie Zender  <zender at uci.edu>
+
+	* Create nco_msh_mk() to compute overlap mesh
+
+	* Ensure input and output coordinates all in degrees
+
+	* Milestone: Supplied grid information is read-in, and mapfile information is written-out
+
+2017-10-12  Charlie Zender  <zender at uci.edu>
+
+	* Read coordinates from source grid in nco_map_mk()
+
+	* Modify in.cdl to include three_dmn_rec_var_pck to test masking weighted averages of packed variables for Antonio Rodrigues
+
+2017-10-11  Charlie Zender  <zender at uci.edu>
+
+	* Correct NC_NOERR checks
+
+	* Read, error-correct, and write src/dst grid rank and dimensions in nco_map_mk()
+
+	* Fix/change --weight et al. to option_type=required_argument in ncwa.c, ncflint.c
+
+2017-10-09  Charlie Zender  <zender at uci.edu>
+
+	* Add nco_map.[ch] to build engines
+
+2017-10-07  Charlie Zender  <zender at uci.edu>
+
+	* Re-arrange/rename weight-application logic to make room for nco_map_mk() stub in nco_map.c
+
+2017-10-01  Charlie Zender  <zender at uci.edu>
+
+	* Add, document, and test -L dfl_lvl option to ncclimo
+
+2017-09-25  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.0-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0-alpha02 final changes';git push
+	git tag -a 4.7.0-alpha02 -m 'ncra/ncrcat negative record hyp fix,';git push --tags
+
+2017-09-21  Charlie Zender  <zender at uci.edu>
+
+	* Fix bug where ncra, ncrcat treated negative record hyperslab indices
+	with old (pre-2014) convention, and off-by-one relative to non-record hyperslabs
+
+	* Add var_nm to diagnostic when all put/get functions fail
+
+2017-09-20  Charlie Zender  <zender at uci.edu>
+
+	* Add doc/conda.txt for Conda notes
+
+2017-09-19  Charlie Zender  <zender at uci.edu>
+
+	* Correct --trd and --cdl usage in manual
+
+	* NCO 4.7.0-alpha01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.0-alpha01 final changes';git push
+	git tag -a 4.7.0-alpha01 -m 'ncclimo fl_fmt,quiet CDF5 sniffing';git push --tags
+
+	* Only print CDF5 sniffing message when large variable found
+
+	* Add [-3, -4, -5, -6, -7] options to ncclimo
+
 2017-09-18  Charlie Zender  <zender at uci.edu>
 
 	* NCO 4.6.9 release procedure:
diff --git a/doc/MANIFEST b/doc/MANIFEST
index d99081f..7a923b8 100644
--- a/doc/MANIFEST
+++ b/doc/MANIFEST
@@ -267,6 +267,8 @@ nco/src/nco/nco_lmt.c
 nco/src/nco/nco_lmt.h
 nco/src/nco/nco_lst_utl.c
 nco/src/nco/nco_lst_utl.h
+nco/src/nco/nco_map.c
+nco/src/nco/nco_map.h
 nco/src/nco/nco_md5.h
 nco/src/nco/nco_md5.c
 nco/src/nco/nco_mmr.c
diff --git a/doc/README_msvc.txt b/doc/README_msvc.txt
deleted file mode 100644
index 11a4a38..0000000
--- a/doc/README_msvc.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-Microsoft Windows Visual Studio 2015 (MSVC) build instructions:
-
-Building the NCO source code from within Visual Studio is an easy process, consisting of 2 steps:
-
-1) Define environment variables.
-2) Build the solution.
-
-1) Define environment variables
-
-The Visual Studio NCO solution file (located at /qt/nco.sln) uses 2 types of environment variables: 
-
-a)	C source file header paths.
-b)	NCO dependency libraries.
-
-The minimal requirement to build NCO is the netCDF library. These 2 symbols are defined in the MSVC solution
-and must be defined as enviroment variables
-
-HEADER_NETCDF
-LIB_NETCDF  
-
-HEADER_NETCDF defines the location (path) where the netCDF header file is located on your local hard drive. 
-This file is called netcdf.h. Note that only the path (without the file name) is defined.
-
-Example
-
-HEADER_NETCDF 
-J:\netcdf-c-4.3.1.1\include
-
-LIB_NETCDF defines the absolute name (with path) of the netCDF library (the file is called netcdf.lib), located on your local hard drive.
-Note that here, the file name is included 
-	
-Example
-	
-LIB_NETCDF  
-J:\netcdf-c-4.3.1.1\build\liblib\Debug\netcdf.lib	
-
-Note:
-
-To define an enviroment variable in Microsoft Windows, do:
-
-1) Go to menu �Start�
-2) Go to menu �Computer�
-3) Right click menu "Properties"
-4) Choose option �Advanced System Settings�
-5) Choose option �Environment Variables�
-6) Choose "New" button on the section "System Variables"
-7) Enter a pair name, value
-
-From the previous example, a name would be 
-HEADER_NETCDF
-with value
-J:\netcdf-c-4.3.1.1\include
-
-Note: You�ll have to exit Visual Studio and open the project again so that these values are detected by MSVC.
-
-Building ncap2
-
-ncpa2 requires 2 additional libraries, Antlr, and gsl.
-
-Define these environment variables (examples follow)
-
-HEADER_ANTLR
-J:\antlr-2.7.7\lib\cpp
-
-LIB_ANTLR
-J:\antlr-2.7.7\lib\cpp\debug\antlr.lib
-
-HEADER_GSL
-J:\gsl-1.8\src\gsl\1.8\gsl-1.8
-
-LIB_GSL
-J:\gsl-1.8\src\gsl\1.8\gsl-1.8\VC8\libgsl\Debug-StaticLib\libgsl_d.lib
-
-
-
-
-
-
-
diff --git a/doc/VERSION b/doc/VERSION
index ded82a9..f6cdf40 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.6.9
+4.7.0
diff --git a/doc/alg_cf2_oog.png b/doc/alg_cf2_oog.png
new file mode 100644
index 0000000..ecf6c46
Binary files /dev/null and b/doc/alg_cf2_oog.png differ
diff --git a/doc/alg_cf2_oog.pptx b/doc/alg_cf2_oog.pptx
new file mode 100644
index 0000000..60074f7
Binary files /dev/null and b/doc/alg_cf2_oog.pptx differ
diff --git a/doc/build_hints.shtml b/doc/build_hints.shtml
index 10a0e68..8861619 100644
--- a/doc/build_hints.shtml
+++ b/doc/build_hints.shtml
@@ -302,10 +302,7 @@ See the <a href="http://nco.sf.net/nco.html#wnd">User's Guide</a>
 for more details.
 </li>
 
-<!--Qt/MSVC -->
-<li><i>Windows build with Qt/MSVC:</i>
-As of NCO 4.2.0, you may build NCO from source using MSVC and Qt, please see the <a href="nco_qt_msvc.shtml">NCO Qt/MSVC build</a> page.
-</li>
+
 </ul>
 <hr></p>
 
diff --git a/doc/conda.txt b/doc/conda.txt
new file mode 100644
index 0000000..9a2c36c
--- /dev/null
+++ b/doc/conda.txt
@@ -0,0 +1,38 @@
+# $Header$ -*-text-*-
+
+# Purpose: Conda information for NCO netCDF Operators project
+# Notes describe procedure to manipulate Debian-specific distribution
+
+# Install Miniconda in direcetory $HOME/anaconda
+# Anaconda itself is ~10x bigger than Miniconda and contains too much extraneous stuff
+scp Miniconda2-latest-Linux-x86_64.sh skyglow.ess.uci.edu:
+bash Miniconda2-latest-Linux-x86_64.sh
+
+20170920:
+> @doutriaux1 reports that OSX conda package is not available despite
+> Linux package having been available for a day. 
+
+Travis-CI, which builds our OS X packages, is having trouble. See
+https://www.traviscistatus.com/incidents/h6gwvyq9zky0 
+
+Follow the build check at
+https://travis-ci.org/conda-forge/nco-feedstock/builds/277263541
+
+> The build-status indicator for both is green on the nco-feedstock
+  homepage. Is that a false-negative for OSX? 
+
+Not really, it is probably reflecting the last build.
+
+Build logs are in the Travis CI logs at
+https://travis-ci.org/conda-forge/nco-feedstock
+
+> FWIW I have received build failures with clang since ~Sep 4 when
+> Travis updated to new Ubuntu Trusty. 
+
+conda-forge uses a CentOS 6 docker image to build Linux using
+CircleCI. We only use Travis-CI for OS X, so we are not affected.
+But thanks for letting us know! 
+
+In conda-forge we do build OS X pkgs with clang by default but not
+with OpenMP though, we should look into that. 
+
diff --git a/doc/debian.txt b/doc/debian.txt
index 1cd051a..b6db67d 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.9
-   First we create a clean source distribution of nco and place it in nco-4.6.9
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.7.0
+   First we create a clean source distribution of nco and place it in nco-4.7.0
    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.9
-/bin/rm nco.tar.gz;tar cvzf nco-4.6.9.tar.gz ./nco-4.6.9/*
-cd ~/nco/nco-4.6.9
-dh_make -e zender at uci.edu -f ../nco-4.6.9.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.7.0
+/bin/rm nco.tar.gz;tar cvzf nco-4.7.0.tar.gz ./nco-4.7.0/*
+cd ~/nco/nco-4.7.0
+dh_make -e zender at uci.edu -f ../nco-4.7.0.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.9.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.6.9
+   cd ~/nco/nco-4.7.0
    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.9 with X.Y.Z+1
+# tags-query replace 4.7.0 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.9-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.7.0-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.9
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.7.0
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.6.9.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.7.0.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.6.9-2~ppa1_source.changes
+dput NCO nco_4.7.0-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.9-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_4.6.9-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_4.6.9-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_4.6.9-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_4.6.9.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_4.7.0-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.7.0-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.7.0-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.7.0-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.7.0.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.9 ${DATA}/nco_4.6.9* ${DATA}/debian # Cleanup last build. sudo necessary for removal because dpkg-buildpackage uses sudo?
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.9-1 -d nco-4.6.9 nco # Export based on tag
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -d nco-4.6.9 nco # Export most recent
-tar cvzf ./nco_4.6.9.orig.tar.gz --exclude='nco-4.6.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.9 
-/bin/rm -rf ${DATA}/nco-4.6.9 # Remove cvs-exported directory
-tar xvzf ./nco_4.6.9.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-4.6.9/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.6.9/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.6.9/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-4.7.0 ${DATA}/nco_4.7.0* ${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.7.0-1 -d nco-4.7.0 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.7.0 nco # Export most recent
+tar cvzf ./nco_4.7.0.orig.tar.gz --exclude='nco-4.7.0/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.0 
+/bin/rm -rf ${DATA}/nco-4.7.0 # Remove cvs-exported directory
+tar xvzf ./nco_4.7.0.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.7.0/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.7.0/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.7.0/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.9;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-4.6.9;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
-cd ${DATA}/nco-4.6.9;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-4.7.0;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.7.0;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.7.0;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.6.9-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.7.0-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.9-1_*.deb
-ls -l ${DATA}/nco_4.6.9*
+lintian ${DATA}/nco_4.7.0-1_*.deb
+ls -l ${DATA}/nco_4.7.0*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_4.6.9* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_4.6.9* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_4.7.0* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.7.0* 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.9-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.7.0-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.9* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.7.0* # 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.9-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.6.9-1_*.changes
-lintian /var/cache/pbuilder/result/nco_4.6.9-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.7.0-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.7.0-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.7.0-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.6.9-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.7.0-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.9-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.7.0-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.9 ${DATA}/nco-4.6.9* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.7.0 ${DATA}/nco-4.7.0* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-4.6.9 \
-${rpm_root}/RPMS/i386/nco-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.9-?.i386.rpm \
-${rpm_root}/SOURCES/nco-4.6.9.tar.gz \
-${rpm_root}/SPECS/nco-4.6.9.spec \
-${rpm_root}/SRPMS/nco-4.6.9-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.9-1 -d nco-4.6.9 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.6.9.spec
-tar cvzf ./nco-4.6.9.tar.gz --exclude='nco-4.6.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.9 
-${sudo_sng} /bin/cp ${DATA}/nco-4.6.9.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-4.7.0 \
+${rpm_root}/RPMS/i386/nco-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.0-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.7.0.tar.gz \
+${rpm_root}/SPECS/nco-4.7.0.spec \
+${rpm_root}/SRPMS/nco-4.7.0-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.7.0-1 -d nco-4.7.0 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.7.0.spec
+tar cvzf ./nco-4.7.0.tar.gz --exclude='nco-4.7.0/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.0 
+${sudo_sng} /bin/cp ${DATA}/nco-4.7.0.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.6.9.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.7.0.spec > ~/foo.nco 2>&1
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.9-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.9-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.0-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.7.0-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.9-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.9-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.9-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.0-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.0-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.7.0-?.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.9 ${DATA}/nco-4.6.9* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.7.0 ${DATA}/nco-4.7.0* # Cleanup last build
 /bin/rm -r -f \
-${rpm_root}/nco-4.6.9-?.src.rpm \
-${rpm_root}/nco-4.6.9.spec \
-${rpm_root}/nco-4.6.9.tar.gz \
-${rpm_root}/*/nco-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.9-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.9-1 -d nco-4.6.9 nco # Export based on tag
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -dnco-4.6.9 nco # Export most recent and build as 4.6.9-1
-tar cvzf ./nco-4.6.9.tar.gz --exclude='nco-4.6.9/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.9 
-/bin/cp ${DATA}/nco-4.6.9.tar.gz ${rpm_root}
+${rpm_root}/nco-4.7.0-?.src.rpm \
+${rpm_root}/nco-4.7.0.spec \
+${rpm_root}/nco-4.7.0.tar.gz \
+${rpm_root}/*/nco-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.0-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.7.0-1 -d nco-4.7.0 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.7.0 nco # Export most recent and build as 4.7.0-1
+tar cvzf ./nco-4.7.0.tar.gz --exclude='nco-4.7.0/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.0 
+/bin/cp ${DATA}/nco-4.7.0.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.9-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.7.0-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.6.9-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.7.0-?.*.rpm
 scp \
-${rpm_root}/*/nco-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.9-?.*.rpm \
-${rpm_root}/nco-4.6.9-?.*.src.rpm \
+${rpm_root}/*/nco-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.0-?.*.rpm \
+${rpm_root}/nco-4.7.0-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/*/nco-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.9-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.9-?.*.rpm \
-${rpm_root}/nco-4.6.9-?.*.src.rpm \
+${rpm_root}/*/nco-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.0-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.0-?.*.rpm \
+${rpm_root}/nco-4.7.0-?.*.src.rpm \
 zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
diff --git a/doc/highlights_old.shtml b/doc/highlights_old.shtml
index 074ffd5..8372912 100644
--- a/doc/highlights_old.shtml
+++ b/doc/highlights_old.shtml
@@ -23,8 +23,72 @@ scp -p ~/nco/doc/highlights_old.shtml dust.ess.uci.edu:Sites/nco
 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#008080" alink="#FF0000">
 
 <dt><a name="News"></a></dt>
-<h2>Release Highlights from 200001–201406 (versions 1.1.47–4.4.4)</h2>
+<h2>Release Highlights from 200001–201512 (versions 1.1.47–4.5.3)</h2>
 
+<li><b>NCO 4.5.3</b>: 
+<tt>ncatted</tt> fix deletion of all attributes;
+<tt>ncecat</tt> fix <tt>gag</tt> mode;
+<tt>ncks</tt> infers rectangular and curvilinear grids;
+<tt>ncks --xtn</tt> specifies extensive variables;
+<tt>ncks</tt> regridder fix multi-level field normalization;</li>
+<li><b>NCO 4.5.2</b>: 
+All operators support <tt>--glb_att_add</tt>;
+<tt>ncks</tt> better support for <tt>fracarea</tt>, <tt>mask</tt>, and displaced-pole grids;
+<tt>ncks</tt> diagnoses <tt>area</tt> for bilinear remapping and when area_b equals 0.0;
+<tt>ncks</tt> <i>generates</i> exact Gaussian and equi-angular, rectangular, and regional gridfiles;
+<tt>ncks</tt> regrid with old, new, and regional TempestRemap mapfiles;
+<tt>ncra -n NINTAP</tt> option understands calendar month counting;
+<tt>ncra -N</tt> avoids normalizing by weights;
+<tt>ncra -w</tt> bugfix with missing value normalization;
+<tt>ncwa</tt> bugfix when weights were not found;</li>
+<li><b>NCO 4.5.1</b>: 
+<tt>cell_method</tt> improvments;
+<tt>ncap2</tt> gets </tt>mibs()/mabs()/mebs()</tt> methods;
+<tt>ncatted</tt> regular expressions in </tt>att_nm</tt>;
+<tt>ncks</tt> regrid using TempestRemap mapfiles;
+<tt>ncra</tt> weights with </tt>--wgt wgt_nm</tt>;</li>
+<li><b>NCO 4.5.0</b>:
+Regridding with <tt>ncks --map</tt>;
+<tt>date/time_written</tt> updates;
+<tt>history</tt> provenance with <tt>-A</tt> (append-mode);
+<tt>ncdismember</tt> uploads to NERC;</li>
+<li><b>NCO 4.4.9</b>: 
+Output chunking map/policy nco/nco = rew/all is default for netCDF3 input;
+Turn-off MM3 workaround for MM3->MM4 copying to speed-up compression-induced chunking;
+LFP chunking uses “reasonable defaults” when variable smaller than default chunksize;
+Shuffle by default when manually deflating;
+Support CF <tt>climatology</tt> attribute;
+Output chunking defaults to <tt>rew/all</tt> on netCDF3 input;
+Unchunking plays nicely with <tt>shuffle</tt>;
+<tt>ncra</tt> weights with </tt>--wgt 1,2,3</tt>;
+<tt>ncks</tt> suggests <tt>-C</tt> with <tt>-x -v crd</tt>;
+<tt>ncwa</tt> modifies <tt>coordinates</tt> attribute;</li>
+<li><b>NCO 4.4.8</b>:
+Precision-Preserving Compression with <tt>--ppc</tt>;
+Arithmetic operators <tt>-y mabs/mebs/mibs</tt></li>
+<li><b>NCO 4.4.7</b>:
+<tt>cnk_min</tt> minimum chunksize;
+Chunking <tt>cnk_map=rew</tt>;
+Smarter chunking defaults;</li>
+<li><b>NCO 4.4.6</b>: 
+<tt>-0</tt> hyperslabs;
+<tt>configure</tt> DAP correctly;
+HDF4 chunking and deflation;
+netCDF4 stride (NC4_SRD) <a href="#bug_nc4_srd">bugfix</a>;
+<tt>ncap2</tt> command line args with scripts;
+<tt>ncra --dbl</tt> averaging packed variables with missing values <a href="#bug_ncra_dbl_pck_mss">bugfix</a>;
+<tt>ncwa --dbl</tt> minimization/maximization of packed variables <a href="#bug_ncwa_pck_min_max">bugfix</a>;
+<tt>ncks _SOURCE_FORMAT</tt> and <tt>-V</tt>;
+<tt>ncrename</tt> re-write</li>
+<li><b>NCO 4.4.5</b>:
+DAP on <a href="http://nco.sf.net/nco.html#dap">HTTPS</a>;
+<tt>ancillary_variables</tt> for <a href="http://nco.sf.net/nco.html#ncl">CF</a>;
+<tt>ncks --grp_xtr_var_xcl</tt> <a href="http://nco.sf.net/nco.html#gxvx">subsetting</a>
+Chunking <tt>cnk_plc=r1d</tt>;
+Default chunking policy/map is <tt>xst/xst</tt>;
+Fix <tt>ncpdq</tt> dimension-reversal parsing;
+Chunking while hyperslabbing <a href="#bug_cnk_hyp">bugfix</a>;
+Correctly parse MS Windows volume names like <tt>C:\foo</tt></li>
 <li><b>NCO 4.4.4</b>:
 netCDF'ize non-compliant element names;
 <tt>-x var</tt> tolerates non-existence;
diff --git a/doc/index.shtml b/doc/index.shtml
index d613ed7..0877603 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.9 released <!--#flastmod file="src/nco-4.6.9.tar.gz"-->
+Current stable NCO version is 4.7.0 released <!--#flastmod file="src/nco-4.7.0.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,7 +149,8 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2017 Oct ??: 4.7.0 <i>In Progress...</i>
+<li>2017 Dec ??: 4.7.1 <i>In Progress...</i>
+<li>2017 Nov 08: 4.7.0 Sundry features/fixes
 <li>2017 Sep 18: 4.6.9 CDF5, CMake
 <li>2017 Aug 16: 4.6.8 Sundry features/fixes
 <li>2017 May 26: 4.6.7 Sub-gridscale regridding
@@ -161,28 +162,14 @@ and
 <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 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 Jul 06: Submitted compression-error trade-off <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 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>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 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>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 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="./milestones_old.shtml">Milestones from 200301–201512 (versions 2.8.4–4.5.3)</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>
 </ul>
 <hr></p>
@@ -629,17 +616,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.9 http://github.com/nco/nco.git nco-4.6.9</tt></a>.
+<tt>git clone -b 4.7.0 http://github.com/nco/nco.git nco-4.7.0</tt></a>.
 <ul>
-<li><b>NCO 4.7.1</b>:  (<i>Future</i>)
+<li><b>NCO 4.7.2</b>: (<i>Future</i>)
 Chunking bytes not elements;
 extensive hashing?;
 netCDF4 compound types?;</li>
-<li><b>NCO 4.7.0</b>: (<i>In Progress, features in-progress or complete include</i>) 
+<li><b>NCO 4.7.1</b>: (<i>In Progress, features in-progress or complete include</i>) 
 CMake build-engine intrinsic math, networking support on MS Windows;
 <tt>ncclimo -v</tt> splitter support for regular expressions;
-<tt>ncks --xtn</tt> better extensive variable treatment;</li>
-<li><b>NCO 4.6.9</b>: (<i>Current Stable Release</i>)
+<tt>ncks --xtn</tt> better extensive variable treatment;
+<tt>ncremap</tt> generate weights;</li>
+<li><b>NCO 4.7.0</b>: (<i>Current Stable Release</i>)
+<tt>ncclimo/ncremap --dfl_lvl</tt> compression;
+<tt>ncclimo --ppc</tt> compression;
+<tt>ncra/ncrcat</tt> fix negative hyperslab off-by-one error;</li>
+<li><b>NCO 4.6.9</b>: 
 CDF5 autoconversion, features to help detect <a href="#bug_cdf5">corruption</a>;
 CMake build-engine is mature;
 <tt>ncks</tt> estimates correct filesizes;
@@ -685,8 +677,8 @@ CMake build option;
 <tt>ncclimo, ncremap</tt> support long-options;
 <tt>ncks --cdl</tt> attribute types as comments;
 <tt>ncks --json</tt> strided brackets for multi-dimensional arrays;</li>
-<li><b>NCO 4.6.2</b>: (<i>Current Stable Release</i>)
-Improved <tt>ncclimo, ncremap</tt> behavior in <tt>module</tt> environments;
+<li><b>NCO 4.6.2</b>: 
+Improve <tt>ncclimo, ncremap</tt> behavior in <tt>module</tt> environments;
 <tt>ncks --json</tt> for JSON output;
 Multi-argument support for <tt>--gaa</tt>, <tt>--rgr</tt>, <tt>--ppc</tt>, <tt>--trr</tt> options;</li>
 <li><b>NCO 4.6.1</b>:
@@ -715,71 +707,7 @@ Initial CDF5 support;
 <tt>ncks</tt> XML <tt>_Unsigned</tt> attribute;
 <tt>ncremap</tt> debuts;
 <tt>ncwa</tt> fix whitespace in <tt>coordinates</tt> attribute;</li>
-<li><b>NCO 4.5.3</b>: 
-<tt>ncatted</tt> fix deletion of all attributes;
-<tt>ncecat</tt> fix <tt>gag</tt> mode;
-<tt>ncks</tt> infers rectangular and curvilinear grids;
-<tt>ncks --xtn</tt> specifies extensive variables;
-<tt>ncks</tt> regridder fix multi-level field normalization;</li>
-<li><b>NCO 4.5.2</b>: 
-All operators support <tt>--glb_att_add</tt>;
-<tt>ncks</tt> better support for <tt>fracarea</tt>, <tt>mask</tt>, and displaced-pole grids;
-<tt>ncks</tt> diagnoses <tt>area</tt> for bilinear remapping and when area_b equals 0.0;
-<tt>ncks</tt> <i>generates</i> exact Gaussian and equi-angular, rectangular, and regional gridfiles;
-<tt>ncks</tt> regrid with old, new, and regional TempestRemap mapfiles;
-<tt>ncra -n NINTAP</tt> option understands calendar month counting;
-<tt>ncra -N</tt> avoids normalizing by weights;
-<tt>ncra -w</tt> bugfix with missing value normalization;
-<tt>ncwa</tt> bugfix when weights were not found;</li>
-<li><b>NCO 4.5.1</b>: 
-<tt>cell_method</tt> improvments;
-<tt>ncap2</tt> gets </tt>mibs()/mabs()/mebs()</tt> methods;
-<tt>ncatted</tt> regular expressions in </tt>att_nm</tt>;
-<tt>ncks</tt> regrid using TempestRemap mapfiles;
-<tt>ncra</tt> weights with </tt>--wgt wgt_nm</tt>;</li>
-<li><b>NCO 4.5.0</b>:
-Regridding with <tt>ncks --map</tt>;
-<tt>date/time_written</tt> updates;
-<tt>history</tt> provenance with <tt>-A</tt> (append-mode);
-<tt>ncdismember</tt> uploads to NERC;</li>
-<li><b>NCO 4.4.9</b>: 
-Output chunking map/policy nco/nco = rew/all is default for netCDF3 input;
-Turn-off MM3 workaround for MM3->MM4 copying to speed-up compression-induced chunking;
-LFP chunking uses “reasonable defaults” when variable smaller than default chunksize;
-Shuffle by default when manually deflating;
-Support CF <tt>climatology</tt> attribute;
-Output chunking defaults to <tt>rew/all</tt> on netCDF3 input;
-Unchunking plays nicely with <tt>shuffle</tt>;
-<tt>ncra</tt> weights with </tt>--wgt 1,2,3</tt>;
-<tt>ncks</tt> suggests <tt>-C</tt> with <tt>-x -v crd</tt>;
-<tt>ncwa</tt> modifies <tt>coordinates</tt> attribute;</li>
-<li><b>NCO 4.4.8</b>:
-Precision-Preserving Compression with <tt>--ppc</tt>;
-Arithmetic operators <tt>-y mabs/mebs/mibs</tt></li>
-<li><b>NCO 4.4.7</b>:
-<tt>cnk_min</tt> minimum chunksize;
-Chunking <tt>cnk_map=rew</tt>;
-Smarter chunking defaults;</li>
-<li><b>NCO 4.4.6</b>: 
-<tt>-0</tt> hyperslabs;
-<tt>configure</tt> DAP correctly;
-HDF4 chunking and deflation;
-netCDF4 stride (NC4_SRD) <a href="#bug_nc4_srd">bugfix</a>;
-<tt>ncap2</tt> command line args with scripts;
-<tt>ncra --dbl</tt> averaging packed variables with missing values <a href="#bug_ncra_dbl_pck_mss">bugfix</a>;
-<tt>ncwa --dbl</tt> minimization/maximization of packed variables <a href="#bug_ncwa_pck_min_max">bugfix</a>;
-<tt>ncks _SOURCE_FORMAT</tt> and <tt>-V</tt>;
-<tt>ncrename</tt> re-write</li>
-<li><b>NCO 4.4.5</b>:
-DAP on <a href="http://nco.sf.net/nco.html#dap">HTTPS</a>;
-<tt>ancillary_variables</tt> for <a href="http://nco.sf.net/nco.html#ncl">CF</a>;
-<tt>ncks --grp_xtr_var_xcl</tt> <a href="http://nco.sf.net/nco.html#gxvx">subsetting</a>
-Chunking <tt>cnk_plc=r1d</tt>;
-Default chunking policy/map is <tt>xst/xst</tt>;
-Fix <tt>ncpdq</tt> dimension-reversal parsing;
-Chunking while hyperslabbing <a href="#bug_cnk_hyp">bugfix</a>;
-Correctly parse MS Windows volume names like <tt>C:\foo</tt></li>
-<li><a href="./highlights_old.shtml">Release Highlights from 200001–201406 (versions 1.1.47–4.4.4)</a></li>
+<li><a href="./highlights_old.shtml">Release Highlights from 200001–201512 (versions 1.1.47–4.5.3)</a></li>
 </ul>
 <hr></p>
 <!-- End http://nco.sf.net#hgh -->
@@ -820,14 +748,17 @@ Thanks to NSF for supporting AIX machines at NCAR over the years.
 <ul>
 <a href="https://www.continuum.io/why-anaconda">Anaconda</a> is a coordinated,
 cross-platform Python environment that utilizes the <tt>conda</tt> package manager.
-Up-to-date versions of NCO for Linux and MacOS are maintained at <a href="https://github.com/conda-forge/nco-feedstock">conda-forge</a>.
+Anaconda can be easily installed into a user-owned directory.
+This bypasses the normal headache of relying on system-administrators to install the latest NCO on shared systems like supercomputers.
+Miniconda (rather than the full Anaconda install) suffices for most purposes.
+Up-to-date Anaconda-compatible versions of NCO for Linux and MacOS (and soon Windows!) are maintained at <a href="https://github.com/conda-forge/nco-feedstock">conda-forge</a>.
 Install NCO in your Anaconda framework with one command ‘<tt>conda install -c conda-forge nco</tt>’.
 Or, alternatively, permanently add conda-forge (which teems with
 goodies besides NCO) to your automatically-searched channels with
-‘<tt>conda config --add channels --conda-forge</tt>’, then
+‘<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.9</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-4.7.0</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>
 
@@ -836,7 +767,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.9</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.7.0</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.
@@ -844,8 +775,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.9-1_i386.deb</tt>’):</dt>
-<li><a href="https://launchpad.net/ubuntu/+source/nco/4.6.9-1">nco_4.6.9-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.7.0-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/4.7.0-1">nco_4.7.0-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. 
@@ -856,7 +787,7 @@ NCO for Debian over the years.
 <a name="centos"></a><a name="cnt"></a><a name="rhel"></a> <!-- http://nco.sf.net#centos --> <!-- http://nco.sf.net#cnt --> <!-- http://nco.sf.net#rhel -->
 <h3><a href="http://fedora.redhat.com">Fedora</a>, RedHat Enterprise Linux (<a href="http://www.redhat.com/rhel">RHEL</a>), and Community ENTerprise Operating System (<a href="http://www.centos.org">CentOS</a>) GNU/Linux</h3>
 <ul>
-<dt>The <a href="https://admin.fedoraproject.org/pkgdb/package/nco">Fedora NCO</a> RPMs are usually up-to-date so that ‘<tt>dnf install nco</tt>’ will install a recent version. 
+<dt>The <a href="https://admin.fedoraproject.org/pkgdb/package/nco">Fedora NCO</a> RPMs are usually up-to-date so that ‘<tt>sudo dnf install nco</tt>’ installs a recent version. 
 RHEL NCO RPMs are documented at the Fedora site.
 OpenSUSE keeps NCO RPMs <a href="http://software.opensuse.org/package/nco">here</a>.
 A comprehensive list of pre-built RPMs for many OS's is <a href="http://rpmfind.net/linux/rpm2html/search.php?query=nco">here</a>.
@@ -889,17 +820,17 @@ 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.9.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.6.9.macosx.10.12.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-4.7.0.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.7.0.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.9.macosx.10.12.tar.gz">nco-4.6.9.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.6.9.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.6.9.macosx.10.12.tar.gz"-->). 
+<li><a href="src/nco-4.7.0.macosx.10.12.tar.gz">nco-4.7.0.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.7.0.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.7.0.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>
 <li><a href="src/nco-4.0.7_x86_10.6.dmg">nco-4.0.7_x86_10.6.dmg</a> (<!--#fsize file="src/nco-4.0.7_x86_10.6.dmg"-->): For Mac OS 10.6 (last updated <!--#flastmod file="src/nco-4.0.7_x86_10.6.dmg"-->). Maintained by Chad Cantwell.</li>
 <li><a href="http://fink.sf.net">Fink</a> packages for <a href="http://fink.sf.net/pdb/package.php/nco">NCO</a>: Currently NCO 3.9.5. Maintained by Alexander Hansen.</li> 
-<li><a href="http://brew.sh">Homebrew</a> packages for <a href="https://github.com/Homebrew/homebrew-science/nco.rb">NCO</a>: Currently NCO 4.4.2. Maintained by Ian Lancaster (Alejandro Soto's instructions <a href="http://alejandrosoto.net/blog/2014/01/22/setting-up-my-mac-for-scientific-research">here</a>).</li> 
-<li><a href="http://trac.macosforge.org/projects/macports/wiki">MacPorts</a> infrastructure for <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">NCO</a>: <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">Portfile</a> for NCO 4.6.0. Maintained by Takeshi Enomoto.</li>
+<li><a href="http://brew.sh">Homebrew</a> packages for <a href="https://github.com/Homebrew/homebrew-science/nco.rb">NCO</a>: Currently NCO 4.6.X. Install with ‘<tt>sudo brew install nco</tt>’. Maintained by Ian Lancaster (Alejandro Soto's instructions <a href="http://alejandrosoto.net/blog/2014/01/22/setting-up-my-mac-for-scientific-research">here</a>).</li> 
+<li><a href="http://trac.macosforge.org/projects/macports/wiki">MacPorts</a> infrastructure for <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">NCO</a>: <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">Portfile</a>: Currently NCO 4.6.6. Install with ‘<tt>sudo port install nco</tt>’. Maintained by Takeshi Enomoto.</li>
 </ul>
 
 <a name="visual"></a> <!-- http://nco.sf.net#visual -->
@@ -914,9 +845,9 @@ To build NCO from source yourself using MSVC with CMake, please see nco/cmake/bu
 <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.9.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
+/usr/bin/scp /home/pvicente/windows_setup/nco-4.7.0.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
 -->
-<li><a href="src/nco-4.6.9.windows.mvs.exe">nco-4.6.9.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.6.9.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.6.9.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
+<li><a href="src/nco-4.7.0.windows.mvs.exe">nco-4.7.0.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.7.0.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.7.0.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
 </ul>
 
 <a name="cygwin"></a> <!-- http://nco.sf.net#cygwin -->
@@ -1087,12 +1018,12 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- scp ${DATA}/nco-4.6.9.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="https://github.com/nco/nco/archive/4.6.9.tar.gz">nco-4.6.9.tar.gz</a> 
-(<!--#fsize file="src/nco-4.6.9.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-4.6.9.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-4.6.9.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha256 src/nco-4.6.9.tar.gz"--> 
+<!-- scp ${DATA}/nco-4.7.0.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/4.7.0.tar.gz">nco-4.7.0.tar.gz</a> 
+(<!--#fsize file="src/nco-4.7.0.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-4.7.0.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-4.7.0.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha256 src/nco-4.7.0.tar.gz"--> 
 </li>
 </ul>
 
@@ -1111,8 +1042,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.9</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.6.9</tt></p>
+then checks out NCO version <tt>4.7.0</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.7.0</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
@@ -1120,9 +1051,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.9</tt>) and the development version is that the
+(e.g., <tt>4.7.0</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.6.9</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.7.0</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.
@@ -1206,7 +1137,7 @@ Remember, to compile NCO from source, you need not only the library
 dependencies the "devel" versions 
 (which include the header files) of the 
 
-For Debian-based systems (like Ubuntu) (<tt>aptitude</tt> is similar to and interchangeable, I think, with <tt>apt-get</tt>):
+For Debian-based systems (like Ubuntu) (<tt>aptitude</tt> is similar to and interchangeable with <tt>apt-get</tt>):
 <tt>
 <dt>sudo aptitude install antlr libantlr-dev # ANTLR</dt>
 <dt>sudo aptitude install libcurl4-gnutls-dev libexpat1-dev libxml2-dev # DAP-prereqs (curl, expat XML parser) </dt>
@@ -1264,14 +1195,13 @@ For Windows with Cygwin, select and install the following packages with Cygwin S
 <dt>udunits2 # UDUnits</dt>
 </tt>
 As of 20131101 there is no Cygwin package for ANTLR, and the netCDF package does not yet support DAP. 
-Users should instead first download and install the ANTLR found <a href="http://nco.sourceforge.net/nco_qt_msvc.shtml">here</a>.
 </li>
 
 <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.9.tar.gz</dt>
-<dt>tar xvzf 4.6.9.tar.gz</dt>
-<dt>cd nco-4.6.9</dt>
+<dt>wget https://github.com/nco/nco/archive/4.7.0.tar.gz</dt>
+<dt>tar xvzf 4.7.0.tar.gz</dt>
+<dt>cd nco-4.7.0</dt>
 <dt>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1298,7 +1228,15 @@ Override these manually with, e.g.,
 -DHDF5_HL_LIBRARY=/my/hdf5 high level/library/file 
 -DSZIP_LIBRARY=/my/szip/library/file 
 -DZLIB_LIBRARY=/my/zlib/library/file 
--DCURL_LIBRARY=/my/curl/library/file</dt>
+-DCURL_LIBRARY=/my/curl/library/file 
+-DANTLR_INCLUDE:PATH=/my/antlr/include/path 
+-DANTLR_LIBRARY:FILE=/my/antlr/library/file 
+-DUDUNITS2_INCLUDE:PATH=/my/udunits2/include/path 
+-DUDUNITS2_LIBRARY:FILE=/my/udunits2/library/file 
+-DEXPAT_LIBRARY:FILE=/my/expat/library/file 
+-DGSL_INCLUDE:PATH=/my/gsl/include/path 
+-DGSL_LIBRARY:FILE=/my/gsl/library/file 
+-DGSL_CBLAS_LIBRARY:FILE=/my/cblas/library/file</dt>
 </tt>
 </p>
 <dt><a name="bonobo"></a></dt> <!-- http://nco.sf.net#bonobo -->
@@ -1403,35 +1341,42 @@ LAM installs easily with our own testing environment (latest Ubuntu).
 <!-- http://nco.sf.net#bug_cdf5 -->
 <a name="bug_cdf5"></a>
 <li><i>netCDF CDF5 corruption:</i>
-  netCDF library 4.4.x supports the CDF5 binary format.
+  netCDF libraries 4.4.0+ supports the CDF5 binary format.
   Unfortunately the CDF5 implementation is buggy for large (> 4 GiB)
-  variables. 
-  Writing CDF5 files with large variables is buggy in netCDF library
-  versions 4.4.0–4.4.1 unless there is only one such
-  “large” variable and it is the last to be defined.
+  variables in library versions 4.4.0–4.5.0. 
+  Writing CDF5 files with large variables is buggy unless there is
+  only one such “large” variable and it is the last to be defined.
   If the file is an input dataset (i.e., NCO <i>reads</i> it) written
   by PnetCDF then the input data are fine (because PnetCDF writes CDF5
   through a different mechanism than serial programs like NCO's
   writer).
   And if the CDF5 dataset was originally written by any netCDF version
-  4.5.0 or greater, then it is fine. 
-  However, an input file with large variables written by any serial
-  netCDF writer (like NCO) employing netCDF library 4.4.x, is likely
+  4.5.1 or greater, then it may be fine (It depends whether/when
+  Unidata patches the bug, see below, that we identified on 20170906.) 
+  However, a CDF5 input file with large variables written by any serial
+  netCDF writer (like NCO) employing netCDF library 4.4.0–4.5.0, is likely
   corrupt and variables were silently truncated when writing it.
   Output files (that NCO wrote) with large variables will definitely
-  be corrupt if NCO was linked to netCDF library version 4.4.x (so
-  upgrade to netCDF 4.5.x ASAP).
+  be corrupt if NCO was linked to netCDF library version 4.4.0–4.5.0 (so
+  upgrade to netCDF 4.5.1+ ASAP).
   Here are two potential workarounds for data affected by this bug:
   1. Re-write (using any netCDF version) original input files in
   netCDF4 format instead of CDF5, then process these as normal and
   write netCDF4 output (instead of CDF5); 
-  2. Re-compile NCO with netCDF library 4.5.0 or later and use it to
+  2. Re-compile NCO with netCDF library 4.5.1+ or later and use it to
   convert non-corrupt datasets to netCDF4 format, then process the
   data.
   For more information on this nasty bug, see
   <a href="https://github.com/Unidata/netcdf-c/issues/463">here</a>.
   Our understanding of this bug is still evolving and salient updates
   will be posted here.
+  <b>UPDATE</b>: Unidata released netCDF 4.5.0 on 20171020.
+  Unfortunately a patch to fix the CDF5 bug was not included.
+  Hence the earliest a general-purpose CDF5 fix will appear is 4.5.1.
+  Those bonking their heads against walls and willing to try what
+  Unidata chose not to include in 4.5.0 can use this experimental 
+  <a href="https://github.com/Unidata/netcdf-c/pull/478">patch</a>.
+  YMMV. Unsupported.
 </li>
   
   <!-- http://nco.sf.net#bug_nc4_srd -->
diff --git a/doc/logo_qt.png b/doc/logo_qt.png
deleted file mode 100644
index 3287559..0000000
Binary files a/doc/logo_qt.png and /dev/null differ
diff --git a/doc/logo_vs2010.png b/doc/logo_vs2010.png
deleted file mode 100644
index b3ad7fb..0000000
Binary files a/doc/logo_vs2010.png and /dev/null differ
diff --git a/doc/milestones_old.shtml b/doc/milestones_old.shtml
index 33aa1c3..823e087 100644
--- a/doc/milestones_old.shtml
+++ b/doc/milestones_old.shtml
@@ -23,9 +23,23 @@ scp -p ~/nco/doc/milestones_old.shtml dust.ess.uci.edu:Sites/nco
 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#008080" alink="#FF0000">
 
 <dt><a name="News"></a></dt>
-<h2>Releases & Milestones from 2003–2013 (versions 2.8.4–4.4.4)</h2>
+<h2>Releases & Milestones from 2003–2015 (versions 2.8.4–4.5.3)</h2>
 
 <ul>
+<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 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>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 Jul 01: NASA ACCESS 2013 <a href="#prp_axs">project</a> commences</li>
 <li>2014 May 29: 4.4.4 (Stability)
 <li>2014 Apr 02: 4.4.3 (Stability)
 <li>2014 Mar 27: <a href="http://dust.ess.uci.edu/smn/smn_nco_gsfc_201403.pdf">Talk</a> at NASA GSFC, Greenbelt</li>
diff --git a/doc/nco.texi b/doc/nco.texi
index cefe944..6c73a85 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.9
- at set doc-edition 4.6.9
+ at set nco-edition 4.7.0
+ at set doc-edition 4.7.0
 @set copyright-years 1995--2017
 @set update-year 2017
- at set update-date 18 September 2017
- at set update-month September 2017
+ at set update-date 7 November 2017
+ at set update-month November 2017
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -986,20 +986,30 @@ platform, and the change in the wallclock time for execution.}.
 @cindex Microsoft Visual Studio
 
 @acronym{NCO} has been successfully ported and tested on most Microsoft  
-Windows operating systems including: @acronym{XP} SP2/Vista/7.
+Windows operating systems including: @acronym{XP} SP2/Vista/7/10.
 Support is provided for compiling either native Windows executables,
-using the Microsoft Visual Studio 2010 Compiler, or with Cygwin, the
- at acronym{UNIX}-emulating compatibility layer with the @acronym{GNU} toolchain.
+using the Microsoft Visual Studio Compiler (@acronym{MVSC}), or with
+Cygwin, the @acronym{UNIX}-emulating compatibility layer with the
+ at acronym{GNU} toolchain. 
 The switches necessary to accomplish both are included in the standard
 distribution of @acronym{NCO}.
 
- at cindex Qt
 @cindex C99
-Using Microsoft Visual Studio (@acronym{MVS}), one must build
- at acronym{NCO} with the C++ compiler since @acronym{MVS} does not support C99.
-Qt, a convenient integrated development environment, was used to convert
-the project files to @acronym{MVS} format.
-The Qt files themselves are distributed in the @file{nco/qt} directory.
+ at cindex CMake
+With Microsoft Visual Studio compiler, one must build @acronym{NCO}
+with C++ since @acronym{MVSC} does not support C99.
+Support for Qt, a convenient integrated development environment, was
+deprecated in 2017.
+As of @acronym{NCO} version 4.6.9 (September, 2017) please build native
+Windows executables with CMake:
+ at example
+ at verbatim
+cd ~/nco/cmake
+cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}
+ at end verbatim
+ at end example
+The file @file{nco/cmake/build.bat} shows how deal with various path
+issues. 
 
 Using the freely available Cygwin (formerly gnu-win32) development
 environment  
@@ -2725,9 +2735,7 @@ library (@pxref{File Formats and Conversion}).
 @cindex @code{--omp_num_threads @var{thr_nbr}}
 @cindex @code{-t @var{thr_nbr}}
 @cartouche
-Availability: @command{ncap2}, @command{ncbo}, @command{nces}, @command{ncecat},
- at command{ncflint}, @command{ncpdq}, @command{ncra}, @command{ncrcat},
- at command{ncwa}@*
+Availability: @command{ncclimo}, @command{ncks}, @command{ncremap}@*
 Short options: @samp{-t}@*
 Long options: @samp{--thr_nbr}, @samp{--threads},
 @samp{--omp_num_threads}@* 
@@ -2749,9 +2757,14 @@ wallclock time) because nearly all @acronym{NCO} operations are
 I/O-bound. 
 This means that @acronym{NCO} spends negligible time doing anything
 compared to reading and writing. 
-We have seen some and can imagine other use cases where
- at command{ncwa}, @command{ncpdq}, and @command{ncap2} (with long scripts) 
-will complete faster due to threading. 
+The only exception is regridding with @command{ncremap} which uses
+ at command{ncks} under-the-hood.
+As of 2017, threading works only for regridding, thus this section is
+relevant only to @command{ncclimo}, @command{ncks}, and
+ at command{ncremap}. 
+We have seen some and can imagine other use cases where @command{ncwa},
+ at command{ncpdq}, and @command{ncap2} (with long scripts) will complete
+faster due to threading.  
 The main benefits of threading so far have been to isolate the serial
 from parallel portions of code. 
 This parallelism is now exploited by OpenMP but then runs into the I/O
@@ -2760,7 +2773,7 @@ The bottleneck will be ameliorated for large files by the use of
 MPI-enabled calls in the netCDF4 library when the underlying filesystem
 is parallel (e.g., @acronym{PVFS} or @acronym{JFS}).
 Implementation of the parallel output calls in @acronym{NCO} is not a
-goal of our current funding and would require new volunteers or funding.  
+goal of our current funding and would require new volunteers or funding.   
 @end cartouche
 
 @cindex @var{thr_nbr}
@@ -2785,8 +2798,8 @@ In the future (perhaps with netCDF4), we hope to demonstrate significant
 threading improvements with operators like @code{ncrcat} by performing
 multiple simultaneous writes. 
 
-Compute-intensive operators (@code{ncap2}, @code{ncwa} and @code{ncpdq}) 
-benefit most from threading.
+Compute-intensive operators (@code{ncremap}) benefit most from
+threading. 
 The greatest increases in throughput due to threading occur on
 large datasets where each thread performs millions, at least,
 of floating-point operations.
@@ -5015,7 +5028,7 @@ if [ ${cf_chk} != '0' ] && [ ${cf_chk} != 'nerc' ]; then
     hash cfchecker 2>/dev/null || { echo >&2 "Local cfchecker command not found, will smallify and upload to NERC checker instead"; chk_nrc='y'; chk_dck='n'; }
 fi # !cf_chk
 # Obtain group list
-grp_lst=`ncks --cdl -m ${fl_in} | grep '// group' | awk '{$1=$2=$3="";sub(/^  */,"",$0);print}'`
+grp_lst=`ncks -m ${fl_in} | grep '// group' | awk '{$1=$2=$3="";sub(/^  */,"",$0);print}'`
 IFS=$'\n' # Change Internal-Field-Separator from <Space><Tab><Newline> to <Newline>
 for grp_in in ${grp_lst} ; do
     # Replace slashes by dots for output group filenames
@@ -5328,10 +5341,10 @@ Printing variable @var{three_dmn_var} in file @file{in.nc} first with
 the @w{C indexing} convention, then with Fortran indexing convention
 results in the following output formats: 
 @example
-% ncks -v three_dmn_var in.nc
+% ncks --trd -v three_dmn_var in.nc
 lat[0]=-90 lev[0]=1000 lon[0]=-180 three_dmn_var[0]=0 
 ...
-% ncks -F -v three_dmn_var in.nc
+% ncks --trd -F -v three_dmn_var in.nc
 lon(1)=0 lev(1)=100 lat(1)=-90 three_dmn_var(1)=0 
 ...
 @end example
@@ -6590,7 +6603,7 @@ The @acronym{SCRIP} gridfile and @acronym{UGRID} meshfile metadata
 produced for the equiangular @w{1-by-1 degree} global grid are:
 @example
 @verbatim
-zender at aerosol:~$ ncks --cdl -m ~/grd_scrip.nc 
+zender at aerosol:~$ ncks -m ~/grd_scrip.nc 
 netcdf grd_scrip {
   dimensions:
     grid_corners = 4 ;
@@ -6618,7 +6631,7 @@ netcdf grd_scrip {
     int grid_imask(grid_size) ;
 } // group /
 
-zender at aerosol:~$ ncks --cdl -m ~/grd_ugrid.nc 
+zender at aerosol:~$ ncks -m ~/grd_ugrid.nc 
 netcdf grd_ugrid {
   dimensions:
     maxNodesPerFace = 4 ;
@@ -8354,6 +8367,8 @@ variables.
 
 @html
 <a name="bg"></a> <!-- http://nco.sf.net/nco.html#bg -->
+<a name="bitgrooming"></a> <!-- http://nco.sf.net/nco.html#bitgrooming -->
+<a name="Bit-Grooming"></a> <!-- http://nco.sf.net/nco.html#Bit-Grooming -->
 <a name="BG"></a> <!-- http://nco.sf.net/nco.html#BG -->
 <a name="ppc"></a> <!-- http://nco.sf.net/nco.html#ppc -->
 <a name="PPC"></a> <!-- http://nco.sf.net/nco.html#PPC -->
@@ -8457,6 +8472,7 @@ value is less than one-half of one one-hundredth, i.e.,
 
 @cindex Number of Significant Digits
 @cindex @acronym{NSD}
+ at cindex Bit-Grooming
 One @acronym{PPC} algorithm preserves the specified total 
 @dfn{Number of Signifcant Digits} (@acronym{NSD}) of the value.
 For example there is only one significant digit in the weight of
@@ -9265,9 +9281,9 @@ ncar_cam.nc ~/foo.nc
 @cindex compression
 @cindex deflation
 @cartouche
-Availability: @command{ncap2}, @command{ncbo}, @command{nces},
+Availability: @command{ncap2}, @command{ncbo}, @command{ncclimo}, @command{nces},
 @command{ncecat}, @command{ncflint}, @command{ncks}, @command{ncpdq},
- at command{ncra}, @command{ncrcat}, @command{ncwa}@*
+ at command{ncra}, @command{ncrcat}, @command{ncremap}, @command{ncwa}@*
 Short options: @samp{-L}@*
 Long options: @samp{--dfl_lvl}, @samp{--deflate}@*  
 @end cartouche
@@ -9366,13 +9382,13 @@ argument form for sub-setting.
 The @acronym{MD5} digests are shown as a 32-character hexadecimal string 
 in which each two characters represent one byte of the 16-byte digest:
 @example
-> ncks -O -D 2 -C --md5 -v md5_a,md5_abc ~/nco/data/in.nc
+> ncks --trd -D 2 -C --md5 -v md5_a,md5_abc ~/nco/data/in.nc
 ...
 ncks: INFO MD5(md5_a) = 0cc175b9c0f1b6a831c399e269772661
 md5_a = 'a' 
 ncks: INFO MD5(md5_abc) = 900150983cd24fb0d6963f7d28e17f72
 lev[0]=100 md5_abc[0--2]='abc' 
-> ncks -O -D 2 -C -d lev,0 --md5 -v md5_a,md5_abc ~/nco/data/in.nc
+> ncks --trd -D 2 -C -d lev,0 --md5 -v md5_a,md5_abc ~/nco/data/in.nc
 ...
 ncks: INFO MD5(md5_a) = 0cc175b9c0f1b6a831c399e269772661
 md5_a = 'a' 
@@ -9620,12 +9636,13 @@ See @ref{ncks netCDF Kitchen Sink} for a description of deflation, a
 lossless compression technique available with netCDF4 only.
 Packed data may be deflated to save additional space.
 
- at unnumberedsubsec Packing Algorithm
+ at unnumberedsubsec Standard Packing Algorithm
 @dfn{Packing}
 The standard netCDF linear packing algorithm (described
 @uref{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/Attribute-Conventions.html, here})
 produces packed data with the same dynamic range as the original but
 which requires no more than half the space to store.
+ at acronym{NCO} will always use this algorithm for packing.
 Like all packing algorithms, linear packing is @emph{lossy}.
 Just how lossy depends on the values themselves, especially their range.
 The packed variable is stored (usually) as type @code{NC_SHORT}
@@ -9675,7 +9692,7 @@ additional, loss-less packing algorithms perform well on top of it.
 <a name="upk"></a> <!-- http://nco.sf.net/nco.html#upk -->
 <a name="unpack"></a> <!-- http://nco.sf.net/nco.html#unpack -->
 @end html
- at unnumberedsubsec Unpacking Algorithm
+ at unnumberedsubsec Standard (Default) Unpacking Algorithm
 @dfn{Unpacking}
 The unpacking algorithm depends on the presence of two attributes,
 @code{scale_factor} and @code{add_offset}.
@@ -9698,6 +9715,8 @@ $$
 @var{upk} = @var{scale_factor}*@var{pck} + @var{add_offset} = (@var{max}- at var{min})*@var{pck}/@var{ndrv} + 0.5*(@var{min}+ at var{max})@*
 @sp 1
 @end ifnottex
+ at acronym{NCO} will use this algorithm for unpacking unless told
+otherwise as described below.
 When @code{scale_factor} and @code{add_offset} are used for packing, the
 associated variable (containing the packed data) is typically of type
 @code{byte} or @code{short}, whereas the unpacked values are intended to
@@ -9706,7 +9725,7 @@ An attribute's @code{scale_factor} and @code{add_offset} and
 @code{_FillValue}, if any, should all be of the type intended for the
 unpacked data, i.e., @code{int}, @code{float} or @code{double}. 
 
- at unnumberedsubsec Default Handling of Packed Data
+ at unnumberedsubsec Non-Standard Packing and Unpacking Algorithms
 @html
 <a name="hdf_upk"></a> <!-- http://nco.sf.net/nco.html#hdf_upk -->
 <a name="hdf_unpack"></a> <!-- http://nco.sf.net/nco.html#hdf_unpack -->
@@ -9819,7 +9838,7 @@ See @ref{ncpdq netCDF Permute Dimensions Quickly} for an easy technique
 to unpack data packed with the @acronym{HDF} convention, and then
 re-pack it with the netCDF convention.
 
- at unnumberedsubsec Default Handling of Packed Data
+ at unnumberedsubsec Handling of Packed Data by Other Operators
 All @acronym{NCO} arithmetic operators understand packed data.
 The operators automatically unpack any packed variable in the input 
 file which will be arithmetically processed.
@@ -10635,7 +10654,7 @@ In @w{Method 2} we obtain 15-year ensemble January average in a single
 step, by averaging all 15 Januaries at one time:
 @example
 # tpt_flt and tpt_dbl are identical except for precision
-ncks --cdl -C -v tpt_flt,tpt_dbl ~/nco/data/in.nc
+ncks -C -v tpt_flt,tpt_dbl ~/nco/data/in.nc
 # tpt_dbl = 273.1, 273.2, 273.3, 273.4, 273.5, 273.6, 273.7, 273.8, 273.9, 274
 # tpt_flt = 273.1, 273.2, 273.3, 273.4, 273.5, 273.6, 273.7, 273.8, 273.9, 274
 # Create file with five "ten-month years" (i.e., 50 timesteps) of temperature data
@@ -10653,7 +10672,7 @@ ncra --flt -O ~/foo_avg1.nc ~/foo_avg2.nc ~/foo_avg3.nc ~/foo_avg_mth1.nc
 ncra --flt -O -F -d time,1,,10,3 ~/foo.nc ~/foo_avg_mth2.nc
 # Difference the two methods
 ncbo -O ~/foo_avg_mth1.nc ~/foo_avg_mth2.nc ~/foo_avg_dff.nc
-ncks --cdl ~/foo_avg_dff.nc
+ncks ~/foo_avg_dff.nc
 # tpt_dbl = 5.6843418860808e-14 ;
 # tpt_flt = -3.051758e-05 ;
 @end example
@@ -10696,7 +10715,7 @@ ncra --dbl -O -F -d time,1,,10,3 ~/foo.nc ~/foo_avg_mth2.nc
 # Difference the two methods
 ncbo -O ~/foo_avg_mth1.nc ~/foo_avg_mth2.nc ~/foo_avg_dff.nc
 # Show differences
-ncks --cdl ~/foo_avg_dff.nc
+ncks ~/foo_avg_dff.nc
 # tpt_dbl = 5.6843418860808e-14 ;
 # tpt_flt = 0 ;
 @end example
@@ -11258,34 +11277,36 @@ metadata.
 Skip this section if you never work with @acronym{CF} metadata.
 
 The latest @acronym{CF} netCDF conventions are described 
- at uref{http://cfconventions.org/1.6.html, here}. 
+ at uref{http://cfconventions.org/1.7.html, here}. 
 Most @acronym{CF} netCDF conventions are transparent to @acronym{NCO}.
 There are no known pitfalls associated with using any @acronym{NCO}
 operator on files adhering to these conventions.
-To increase user friendliness, @acronym{NCO} applies special rules to
-certain variables in @acronym{CF} files. 
-Rules not required by @acronym{CF} are because experience shows that
-they simplify data analysis.   
+ at acronym{NCO} applies some rules that are not in @acronym{CF}, or
+anywhere else, because experience shows that they simplify
+data analysis, and stay true to the @acronym{NCO} mantra to do what 
+users want.
 
 Here is a general sense of @acronym{NCO}'s @acronym{CF}-support: 
-Understanding and implementing @acronym{NUG} recommendations such
+ at itemize @bullet
+ at item Understand and implement @acronym{NUG} recommendations such
 as the history attribute, packing conventions, and attention to units. 
-Special handling of variables designated as coordinates, bounds, or
-ancillary variables, so that users subsetting a certain variable
+ at item Special handling of variables designated as coordinates, bounds,
+or ancillary variables, so that users subsetting a certain variable
 automatically obtain all related variables.
-Special handling and prevention of meaningless operations 
+ at item Special handling and prevention of meaningless operations 
 (e.g., the root-mean-square of latitude) so that coordinates and bounds
-preserve meaningful information even as normal fields are statistically
-transformed.
-Understanding units and certain calendars so that hyperslabs
+preserve meaningful information even as normal (non-coordinate) fields
+are statistically transformed.
+ at item Understand units and certain calendars so that hyperslabs
 may be specified in physical units, and so that user needs not manually
 decode per-file time specifications.
-Understanding auxiliary coordinates so that irregular hyperslabs may be
-specified on complex geometric grids.
-Checking for CF-compliance on netCDF3 and netCDF4 and @acronym{HDF}
+ at item Understand auxiliary coordinates so that irregular hyperslabs may
+be specified on complex geometric grids.
+ at item Check for CF-compliance on netCDF3 and netCDF4 and @acronym{HDF}
 files. 
-Converting netCDF4 and @acronym{HDF} files to netCDF3 for strict  
- at acronym{CF}-compliance.
+ at item Convert netCDF4 and @acronym{HDF} files to netCDF3 for strict
+ at acronym{CF}-compliance. 
+ at end itemize
 Finally, a main use of @acronym{NCO} is to ``produce @acronym{CF}'', 
 i.e., to improve @acronym{CF}-compliance by annotating metadata,
 renaming objects (attributes, variables, and dimensions), permuting and
@@ -12357,7 +12378,7 @@ is simple with the @code{array()} function.
 @example
 (A) var_out=array(val_srt, val_inc, $dmn_nm);           // One-dimensional output
 (B) var_out=array(val_srt, val_inc, var_tpl);           // Multi-dimensional output
-(C) var_out=array(val_srt, val_inc, /dmn1,dmn2..dmnN/); // Multi-dimensional output
+(C) var_out=array(val_srt, val_inc, /$dmn1,$dmn2...,$dmnN/); // Multi-dimensional output
 @end example
 @noindent
 
@@ -14048,6 +14069,51 @@ print(tNew);
 @end verbatim
 @end example
 
+ at noindent strftime()
+
+The @code{var_str=strtime(var_time, fmt_sng )} method take time based variable and a format string and returns a NC_STRING variable ( of the same shape as var_time) of time-stamps in the form specified by 'fmt_sng'. In order to run this command output type must be NetCDF-4  
+
+ at example 
+ at verbatim
+ncap2 -4  -v -O -s 'time_str=strftime(time,"%Y-%m-%d");' in.nc foo.nc
+
+time_str="1964-03-13", "1964-03-14", "1964-03-15", "1964-03-16", 
+         "1964-03-17", "1964-03-18", "1964-03-19", "1964-03-20", 
+         "1964-03-21", "1964-03-22" ;
+
+ at end verbatim
+ at end example
+
+Under the hood there are  a few steps invoved. @*
+First the method reads 'var_time@@units' and 'var_time@@calendar' (if present)  then  converts  var-time  to 'seconds since 1970-01-01'. @*
+It then converts these possibly UTC seconds to the standard struture @code{struct *tm}.@* 
+Finally strftime is called with fmt_sng and the *tm struct. @*
+The c-standard @code{strftime} is used as defined in 'time.h' @*
+If the method is called without fmt_sng then the following default is used: @code{"%Y-%m-%d %H:%M:%S"} @*
+     
+ at example 
+ at verbatim
+ncap2 -4  -v -O -s 'time_str=strftime(time);' in.nc foo.nc
+
+time_str = "1964-03-13 21:09:00", "1964-03-14 21:09:00", "1964-03-15 21:09:00", 
+           "1964-03-16 21:09:00", "1964-03-17 21:09:00", "1964-03-18 21:09:00", 
+           "1964-03-19 21:09:00", "1964-03-20 21:09:00", "1964-03-21 21:09:00", 
+           "1964-03-22 21:09:00" ;
+
+ at end verbatim
+ at end example
+
+ at noindent Another  working example
+ at example
+ at verbatim
+ncap2 -v -O -s 'ts=strftime(frametime(0),"%Y-%m-%d/envlog_netcdf_L1_ua-mac_%Y-%m-%d.nc");' in.nc out.nc
+ts="2017-08-11/envlog_netcdf_L1_ua-mac_2017-08-11.nc" 
+ at end verbatim
+ at end example
+
+
+
+
 @node Vpointer, Irregular grids, UDUnits script, ncap2 netCDF Arithmetic Processor
 @subsection Vpointer
 @cindex vpointer
@@ -15021,6 +15087,36 @@ yout=gsl_fit_linear_est(xout, c0,c1, cov00,cov01, cov11, sumsq);
 print(yout);  // 3.18545454545 ,9.15636363636, ,12.1418181818 ,33.04
 @end verbatim
 @end example
+
+@*@*
+ at noindent The following code does linear regression of sst(time,lat,lon) for each time-step@* @*
+
+ at example
+ at verbatim
+// Declare variables
+c0[$lat, $lon]=0.; // Intercept
+c1[$lat, $lon]=0.; // Slope
+sdv[$lat, $lon]=0.; // Standard deviation
+covxy[$lat, $lon]=0.; // Covariance
+for (i=0;i<$lat.size;i++) // Loop over lat
+{
+  for (j=0;j<$lon.size;j++) // Loop over lon
+  {
+      // Linear regression function
+      gsl_fit_linear(time,1,sst(:, i, j),1, $time.size, &tc0, &tc1, &cov00, &cov01,&cov11,&sumsq); 
+      c0(i,j) = tc0; // Output results
+      c1(i,j) = tc1; // Output results
+      // Covariance function
+      covxy(i,j) = gsl_stats_covariance(time,1,$time.size,double(sst(:,i,j)),1,$time.size); 
+      // Standard deviation function
+      sdv(i,j) = gsl_stats_sd(sst(:,i,j), 1, $time.size); 
+  }
+ }
+
+// slope (c1) missing values are set to '0', change to -999. (variable c0 intercept value)
+where( c0 == -999 ) c1 = -999;
+ at end verbatim
+ at end example
 @* @*
 
 
@@ -16213,8 +16309,8 @@ The description of these arguments follows in their order of
 appearance. 
 
 The value of @var{att_nm} is the name of the attribute to edit. 
-This meaning of this should be clear to all @command{ncatted} users.
-Both @var{att_nm}) and @var{var_nm} may be specified as regular
+The meaning of this should be clear to all @command{ncatted} users.
+Both @var{att_nm} and @var{var_nm} may be specified as regular
 expressions.
 If @var{att_nm} is omitted (i.e., left blank) and @dfn{Delete} mode is 
 selected, then all attributes associated with the specified variable
@@ -17132,11 +17228,13 @@ ncrcat t_anm_8589_??.nc t_anm_8589_0112.nc
 @noindent
 SYNTAX
 @example
-ncclimo [-a @var{dec_md}] [-C @var{clm_md}] [-c @var{caseid}] [-d @var{dbg_lvl}]
-[-E @var{yr_prv}] [-e @var{yr_end}] [-f @var{fml_nm}] [-h @var{hst_nm}] [-i @var{drc_in}]
-[-j @var{job_nbr}] [-l @var{lnk_flg}] [-m @var{mdl_nm}] [-n @var{nco_opt}] 
+ncclimo [-3] [-4] [-5] [-6] [-7] 
+[-a @var{dec_md}] [-C @var{clm_md}] [-c @var{caseid}] [-d @var{dbg_lvl}]
+[-E @var{yr_prv}] [-e @var{yr_end}] [-f @var{fml_nm}] [--fl_fmt=@var{fl_fmt}] [-h @var{hst_nm}] [-i @var{drc_in}]
+[-j @var{job_nbr}] [-L @var{dfl_lvl}] [-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}]
+[-O @var{drc_rgr}] [-o @var{drc_out}] [-p @var{par_typ}] [--ppc=@var{ppc_prc}]
+[-R @var{rgr_opt}] [-r @var{rgr_map}]
 [-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}] 
@@ -17378,6 +17476,18 @@ allows for some throughput gains with increasing @var{job_nbr}.
 In general, though, increasing @var{job_nbr} is expected to improve
 throughput much more in @command{ncremap} than in @command{ncclimo}. 
 
+ at cindex @code{-L}
+ at cindex @code{--dfl_lvl}
+ at cindex @code{--dfl}
+ at cindex @code{--deflate}
+ at item -L (@code{--dfl_lvl}, @code{--dfl}, @code{--deflate})
+Activate deflation (i.e., lossless compress, see @ref{Deflation}) with
+the @code{-L @var{dfl_lvl}} short option (or with the same argument to 
+the @samp{--dfl_lvl} or @samp{--deflate} long options). 
+Specify deflation level @var{dfl_lvl} on a scale from no deflation
+(@var{dfl_lvl = 0}, the default) to maximum deflation
+(@var{dfl_lvl = 9}).
+
 @cindex @code{-l}
 @cindex @code{--lnk_flg}
 @cindex @code{--link_flag}
@@ -17514,6 +17624,34 @@ The default @var{par_typ} is @samp{bck}, which means @command{ncclimo}
 runs spawns up to twelve (one for each month) parallel processes at a time.
 See discussion below under Memory Considerations.
 
+ at html
+<a name="ppc_prc"></a> <!-- http://nco.sf.net/nco.html#ppc_prc -->
+ at end html
+ at cindex @code{--ppc=@var{ppc_prc}}
+ at cindex @var{ppc_prc}
+ at cindex @code{--ppc}
+ at cindex @code{--ppc_prc}
+ at cindex @code{--precision}
+ at cindex @code{--quantize}
+ at item --ppc=@var{ppc_prc} (@code{--ppc}, @code{--ppc_prc}, @code{--precision}, @code{--quantize})
+ at cindex Decimal Significant Digits
+ at cindex Number of Significant Digits
+ at cindex Bit-Grooming
+Specifies the precision of the Precision-Preserving Compression
+algorithm (@pxref{Precision-Preserving Compression}).
+A positive integer is interpreted as the Number of Significant Digits
+for the Bit-Grooming algorithm, and is equivalent to specifying
+ at samp{--ppc default=@var{ppc_prc}} to a binary operator.
+A positive or negative integer preceded by a period, e.g., @samp{.-2} is 
+interpreted as the number of Decimal Significant Digits for the
+rounding algorithm and is equivalent to specifying
+ at samp{--ppc default=. at var{ppc_prc}} to a binary operator.
+This option applies one precision algorithm and a uniform precision
+for the entire file. 
+To specify variable-by-variable precision options, pass the desired
+options as a quoted string directly with @samp{-n @var{nco_opt}},
+e.g., @samp{-n '--ppc FSNT,TREFHT=4 --ppc CLOUD=2'}.
+
 @cindex @code{-R @var{rgr_opt}}
 @cindex @var{rgr_opt}
 @cindex @code{--rgr_opt}
@@ -17555,12 +17693,12 @@ 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 @code{--seasons=@var{csn_lst}}
 @cindex @var{csn_lst}
 @cindex @code{--seasons}
 @cindex @code{--csn}
 @cindex @code{--csn_lst}
- at item --seasons @var{csn_lst} (@code{--seasons}, @code{--csn_lst}, @code{--csn})
+ 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,
@@ -17631,11 +17769,11 @@ with climatology generation in parallel climatology mode (i.e., when
 @math{@var{par_typ}} = @code{mpi} or @code{bck}). 
 Hence @command{ncclimo} defaults to @var{thr_nbr}=2.
 
- at cindex @code{--tpd_out @var{tpd_out}}
+ at cindex @code{--tpd_out=@var{tpd_out}}
 @cindex @var{tpd_out}
 @cindex @code{--tpd_out}
 @cindex @code{--tpd}
- at item --tpd_out @var{tpd_out} (@code{--tpd_out}, @code{--tpd}, @code{--timesteps_per_day})
+ at item --tpd_out=@var{tpd_out} (@code{--tpd_out}, @code{--tpd}, @code{--timesteps_per_day})
 The number of timesteps-per-day in output created by @command{ncclimo}'s
 climatology generator in daily average mode.
 The climatology output from input files at daily or sub-daily resolution
@@ -19385,16 +19523,17 @@ optionally prints it to screen.
 @command{ncks} prints netCDF input data in @acronym{ASCII},
 @acronym{CDL}, @acronym{JSON}, or @acronym{NcML/XML} text formats to
 @code{stdout}, like (an extended version of) @command{ncdump}.
-By default @command{ncks} prints data in a tabular format intended to be
-easy to search for the data you want, one datum per screen line, with
-all dimension subscripts and coordinate values (if any) preceding the
-datum. 
+By default @command{ncks} prints @acronym{CDL} format.
 Option @samp{-s} (or long options @samp{--sng_fmt} and @samp{--string}) 
 permits the user to format data using C-style format strings, while
 option @samp{--cdl} outputs @acronym{CDL},
 option @samp{--jsn} (or @samp{json}) outputs @acronym{JSON},
 option @samp{--trd} (or @samp{traditional}) outputs ``traditional'' format,
 and option @samp{--xml} (or @samp{ncml}) outputs @acronym{NcML}. 
+The ``traditional'' tabular format is intended to be
+easy to search for the data you want, one datum per screen line, with
+all dimension subscripts and coordinate values (if any) preceding the
+datum. 
 @command{ncks} exposes many flexible controls over printed output,
 including @acronym{CDL}, @acronym{JSON}, and @acronym{NcML}.
 
@@ -19568,7 +19707,7 @@ Invoking this option when @math{@var{dbg_lvl} >= 1} in @acronym{CDL}
 mode prints both the value and the calendar string (one in comments):
 @example
 @verbatim
-zender at aerosol:~$ ncks -D 1 --cdl --cal -v tm_365 ~/nco/data/in.nc
+zender at aerosol:~$ ncks -D 1 --cal -v tm_365 ~/nco/data/in.nc
 ...
   variables:
     double tm_365 ;
@@ -19578,7 +19717,7 @@ zender at aerosol:~$ ncks -D 1 --cdl --cal -v tm_365 ~/nco/data/in.nc
   data:
     tm_365 = "2013-03-01"; // double value: 59
 ...
-zender at aerosol:~$ ncks -D 1 --cdl -v tm_365 ~/nco/data/in.nc
+zender at aerosol:~$ ncks -D 1 -v tm_365 ~/nco/data/in.nc
 ...
     tm_365 = 59; // calendar format: "2013-03-01"
 ...
@@ -19603,8 +19742,8 @@ ncks -H -m -v time_bnds -C --dt_fmt=value ~/nco/data/in.nc
 # 3         1964-03-13T09:08:16.000000 # ISO8601 'T' format
 @end verbatim
 @end example
-Note that @samp{--dt_fmt} automatically implies @samp{--cal} and
- at samp{--cdl} and makes those option superfluous.
+Note that @samp{--dt_fmt} automatically implies @samp{--cal}
+makes that options superfluous.
 
 @html
 <a name="dmn_fix_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_fix_mk -->
@@ -19707,10 +19846,13 @@ print extracted data and metadata to screen (i.e., @code{stdout}) as
 valid @acronym{CDL} (network Common data form Description Language). 
 @acronym{CDL} is the human-readable ``lingua franca'' of netCDF ingested by
 @command{ncgen} and excreted by @command{ncdump}.
+As of @acronym{NCO} version 4.6.9 (September, 2017), @command{ncks} 
+prints @acronym{CDL} by default, and the ``traditional'' mode must
+be explicitly selected with @samp{--trd}.
 Compare @command{ncks} ``traditional'' with @acronym{CDL} printing:
 @example
 @verbatim
-zender at roulee:~$ ncks -v one ~/nco/data/in.nc
+zender at roulee:~$ ncks --trd -v one ~/nco/data/in.nc
 one: type NC_FLOAT, 0 dimensions, 1 attribute, chunked? no, compressed? no, packed? no
 one size (RAM) = 1*sizeof(NC_FLOAT) = 1*4 = 4 bytes
 one attribute 0: long_name, size = 3 NC_CHAR, value = one
@@ -19732,7 +19874,7 @@ netcdf in {
 @end example
 @command{ncgen} converts @acronym{CDL}-mode output into a netCDF file:
 @example
-ncks --cdl -v one ~/nco/data/in.nc > ~/in.cdl
+ncks -v one ~/nco/data/in.nc > ~/in.cdl
 ncgen -k netCDF-4 -b -o ~/in.nc ~/in.cdl
 ncks -v one ~/in.nc
 @end example
@@ -19971,9 +20113,8 @@ This least pedantic mode produces the most easily read results, and
 suffices for many (most?) purposes.  
 Any downstream parser is expected to assign an appropriate type as
 indicated by @acronym{JSON} syntax rules.
-Because the original attribute's @code{NC_TYPE} is not output, it is
-not guaranteed that a downstream parser can exactly reproduce the input  
-file datatypes. 
+Because the original attributes' @code{NC_TYPE} are not output, 
+a downstream parser may not exactly reproduce the input file datatypes. 
 For example, whether the original attribute string was stored as
 @code{NC_CHAR} or @code{NC_STRING} will be unknown to a downstream
 parser.
@@ -20004,11 +20145,14 @@ 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
-types (@code{NC_FLOAT}, @code{NC_CHAR}/@code{NC_STRING}, @code{NC_INT}).   
-double, string, and int attributes are printed as @acronym{JSON} arrays, 
-as in the @math{@var{lvl} = 0} above:
+attributes as objects (with explicit types) unless the attribute type
+match the simplest default @acronym{JSON} value types.
+In other words, attributes of type @code{NC_FLOAT}, @code{NC_CHAR},
+ at code{NC_SHORT}, and @code{NC_BYTE} are printed as objects with an
+explicit type so that parsers do not use the default type. 
+Attributes of type @code{NC_DOUBLE}, @code{NC_STRING}, and @code{NC_INT}
+are printed as @acronym{JSON} arrays, as in the @math{@var{lvl} = 0}
+above: 
 @example
 @verbatim
 % ncks --jsn_fmt=1 -v att_var ~/nco/data/in.nc
@@ -20211,7 +20355,7 @@ Variable (not dimension) indices are printed.
 Variable names appear flush left in the output:
 @example
 @verbatim
-zender at roulee:~$ ncks -Q -v three_dmn_rec_var -C -H ~/nco/data/in.nc              
+zender at roulee:~$ ncks --trd -Q -v three_dmn_rec_var -C -H ~/nco/data/in.nc              
 three_dmn_rec_var[0]=1 
 ...
 @end verbatim
@@ -20339,7 +20483,7 @@ Do not print variable and dimension names, indices, and coordinate
 values when printing arrays. 
 @example
 @verbatim
-zender at roulee:~$ ncks -V -v three_dmn_rec_var -C -H ~/nco/data/in.nc
+zender at roulee:~$ ncks --trd -V -v three_dmn_rec_var -C -H ~/nco/data/in.nc
 1
 ...
 @end verbatim
@@ -20370,7 +20514,7 @@ into @acronym{NcML}, including metadata and data, using all
 Compare @command{ncks} ``traditional'' with @acronym{XML} printing:
 @example
 @verbatim
-zender at roulee:~$ ncks -v one ~/nco/data/in.nc
+zender at roulee:~$ ncks --trd -v one ~/nco/data/in.nc
 one: type NC_FLOAT, 0 dimensions, 1 attribute, chunked? no, compressed? no, packed? no
 one size (RAM) = 1*sizeof(NC_FLOAT) = 1*4 = 4 bytes
 one attribute 0: long_name, size = 3 NC_CHAR, value = one
@@ -20587,11 +20731,11 @@ function ncavg { ncwa -y avg -O -C -v ${1} ${2} ~/foo.nc ; ncks --trd -H -C -v $
 # ncavg $var_nm $fl_nm : What is mean of variable?
 function ncavg { ncap2 -O -C -v -s "foo=${1}.avg();print(foo)" ${2} ~/foo.nc | cut -f 3- -d ' ' ; }
 # ncdmnlist $fl_nm : What dimensions are in file?
-function ncdmnlist { ncks --cdl -m ${1} | cut -d ':' -f 1 | cut -d '=' -s -f 1 ; }
+function ncdmnlist { ncks -m ${1} | cut -d ':' -f 1 | cut -d '=' -s -f 1 ; }
 # ncdmnsz $dmn_nm $fl_nm : What is dimension size?
 function ncdmnsz { ncks --trd -m -M ${2} | grep -E -i ": ${1}, size =" | cut -f 7 -d ' ' | uniq ; }
 # ncgrplist $fl_nm : What groups are in file?
-function ncgrplist { ncks --cdl -m ${1} | grep 'group:' | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort ; }
+function ncgrplist { ncks -m ${1} | grep 'group:' | cut -d ':' -f 2 | cut -d ' ' -f 2 | sort ; }
 # nclist $fl_nm : What variables are in file?
 function nclist { ncks --trd -m ${1} | grep -E ': type' | cut -f 1 -d ' ' | sed 's/://' | sort ; }
 # ncmax $var_nm $fl_nm : What is maximum of variable?
@@ -21897,12 +22041,13 @@ ncrcat -d time,6.,54. ??.nc 8506_8906.nc
 @noindent
 SYNTAX
 @example
-ncremap [-3] [-4] [-5] [-6] [-7] [-a @var{alg_typ}] [-D @var{dbg_lvl}] [-d @var{dst_fl}] [--fl_fmt=@var{fl_fmt}] 
+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}]
+[-L @var{dfl_lvl}] [-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]
-[-O @var{drc_out}] [-o @var{output-file}]
-[-P @var{prc_typ}] [-p @var{par_typ}] [-R @var{rgr_opt}] [--rgn_dst] [--rgn_src]
+[-O @var{drc_out}] [-o @var{output-file}] [-P @var{prc_typ}] [-p @var{par_typ}]
+[-R @var{rgr_opt}] [--rgn_dst] [--rgn_src]
 [-s @var{grd_src}] [--sgs_frc=@var{sgs_frc}] [--sgs_msk=@var{sgs_msk}] [--sgs_nrm=@var{sgs_nrm}]
 [--stdin] [-T @var{drc_tmp}] [-t @var{thr_nbr}] [-U] [-u @var{unq_sfx}] [--ugrid=@var{ugrid-file}]
 [-V @var{rgr_var}] [-v @var{var_lst}[, at dots{}]] [--version] [--vrb=@var{vrb_lvl}] 
@@ -22558,9 +22703,9 @@ renormalization.
 @cindex @var{sgs_frc}
 @cindex @var{sgs_msk}
 @cindex @var{sgs_nrm}
- at cindex @code{--sgs_frc @var{sgs_frc}}
- at cindex @code{--sgs_msk @var{sgs_msk}}
- at cindex @code{--sgs_nrm @var{sgs_nrm}}
+ at cindex @code{--sgs_frc=@var{sgs_frc}}
+ at cindex @code{--sgs_msk=@var{sgs_msk}}
+ at cindex @code{--sgs_nrm=@var{sgs_nrm}}
 In sub-grid mode, @command{ncremap} performs substantial pre- and
 post-processing to conserve fields that represent fractional parts
 of a gridcell.
@@ -23398,12 +23543,12 @@ whose attributes are to be renamed.
 <a name="bug_nc4_rename"></a> <!-- http://nco.sf.net/nco.html#bug_nc4_rename -->
 @end html
 @cartouche
-Caveat lector: Unforunately from 2007--present (July, 2016) the
-netCDF library (versions 4.0.0--4.4.1) contains bugs or limitations
+Caveat lector: Unforunately from 2007--present (November, 2017) the
+netCDF library (versions 4.0.0--4.5.0) contains bugs or limitations
 that sometimes prevent @acronym{NCO} from correctly renaming coordinate
 variables, dimensions, and groups in netCDF4 files. 
 (To our knowledge the netCDF library calls for renaming always work
-well on netCDF3 files so one workaround to some netCDF4 issues is
+well on netCDF3 files so one workaround to many netCDF4 issues is
 convert to netCDF3, rename, then convert back). 
 To understand the renaming limitations associated with particular
 netCDF versions, read the @command{ncrename} documentation below in 
@@ -23580,7 +23725,7 @@ This bug caused renaming @emph{either} a dimension @emph{or} its
 associated coordinate variable (not both, which would fail as above) in
 a netCDF4 file to inadvertently rename both:
 @example
-# Demonstate bug in netCDF4/HDF5 library prior to netCDF-4.3.1-rc5
+# Demonstrate bug in netCDF4/HDF5 library prior to netCDF-4.3.1-rc5
 ncks -O -h -m -M -4 -v lat_T42 ~/nco/data/in.nc ~/foo.nc
 ncrename -O -v lat_T42,lat ~/foo.nc ~/foo2.nc # Also renames dimension
 ncrename -O -d lat_T42,lat ~/foo.nc ~/foo2.nc # Also renames variable
@@ -23605,12 +23750,12 @@ variables.
 This bug corrupts affected variables by replacing their values with the
 default @code{_FillValue} for that variable's type: 
 @example
-# Demonstate bug in netCDF4/HDF5 library prior to netCDF-4.3.3
+# Demonstrate bug in netCDF4 libraries prior to version 4.3.3
 ncks -O -4 -C -M -v lat ~/nco/data/in.nc ~/bug.nc
 ncrename -O -v lat,tal ~/bug.nc ~/foo.nc # Broken until netCDF-4.3.3
 ncrename -O -d lat,tal ~/bug.nc ~/foo.nc # Broken until netCDF-4.3.3
 ncrename -O -d lat,tal -v lat,tal ~/bug.nc ~/foo.nc # Broken too
-ncks --cdl ~/foo.nc
+ncks ~/foo.nc
 @end example
 To avoid this faulty behavior, either build @acronym{NCO} with netCDF 
 version 4.3.3 or later, or convert the file to netCDF3 first, then
@@ -23626,7 +23771,7 @@ This bug causes renamed attributes of coordinate variables in netCDF4
 to files to disappear: 
 @example
 @verbatim
-# Demonstate bug in netCDF4/HDF5 library netCDF-4.3.3
+# Demonstrate bug in netCDF4 library version 4.3.3
 ncrename -O -h -a /g1/lon at units,new_units ~/nco/data/in_grp.nc ~/foo.nc 
 ncks -v /g1/lon ~/foo.nc # Shows units and new_units are both gone
 @end verbatim
@@ -23636,33 +23781,61 @@ Clearly, renaming dimensions in netCDF4 files is non-trivial.
 The penultimate chapter in this saga is a netCDF4 bug discovered in
 September, 2015, and present in versions 4.3.3.1 (and possibly earlier 
 versions too) and later.
-As of this writing (March, 2017), this bug is still present in netCDF4
-version 4.4.2-development. 
+As of this writing (November, 2017), this bug is still present in netCDF4
+version 4.5.1-development. 
 This bug causes @command{ncrename} to create corrupted output files
 when attempting to rename two or more dimensions simultaneously.
 The workaround is to rename the dimensions sequentially, in two separate  
 @command{ncrename} calls.
 @example
 @verbatim
-# Demonstate bug in netCDF4/HDF5 library netCDF-4.3.3.1
+# Demonstrate bug in netCDF4 library versions 4.3.3.1--4.5.0+
 ncrename -O -d lev,z -d lat,y -d lon,x ~/nco/data/in_grp.nc ~/foo.nc # Completes but file is unreadable
-ncks -v one ~/foo.nc # File is unreadable
+ncks -v one ~/foo.nc # File is unreadable (multiple dimensions with same ID?)
 @end verbatim
 @end example
 
-Last but not least is a netCDF4 bug discovered in March, 2017, and
-present in version 4.4.1 (and possibly earlier versions too) and later.
+A new netCDF4 renaming bug was discovered in March, 2017.
+It is present in version 4.4.1 (and possibly earlier versions too) and later.
+As of this writing (November, 2017), this bug is still present in netCDF4
+version 4.5.1-development. 
 This bug causes @command{ncrename} to fail to rename a variable when the
 result would become a coordinate.
 The workaround is to convert to netCDF3, then rename, then convert back
 to netCDF4.
 @example
 @verbatim
-# Demonstate bug in netCDF4/HDF5 library netCDF-4.4.1
+# Demonstrate bug in netCDF4 library versions 4.4.1--4.5.0+
 ncrename -O -v non_coord,coord ~/nco/data/in_grp.nc ~/foo.nc # Fails (HDF error)
 @end verbatim
 @end example
 
+Last but not least is a potentially new netCDF4 bug discovered in November, 2017.
+It is present in versions 4.4.1.1--4.5.0 (and possibly earlier versions too).
+As of this writing (November, 2017), this bug is still present in netCDF4
+version 4.5.1-development. 
+This bug causes @command{ncrename} to fail to rename a variable when the
+result would become a coordinate.
+Oddly fxm
+The workaround is to convert to netCDF3, then rename, then convert back
+to netCDF4.
+ at example
+ at verbatim
+# Demonstrate bug in netCDF4 library versions 4.4.1--4.5.0+
+# Create test dataset
+ncks -O -C -v lon ~/nco/data/in_grp.nc ~/in_grp.nc
+ncks -O -x -g g1,g2 ~/in_grp.nc ~/in_grp.nc
+# Rename dimension then variable
+ncrename -d lon,longitude ~/in_grp.nc # works
+ncrename -v lon,longitude ~/in_grp.nc # borken "HDF error"
+# Rename variable then dimension
+ncrename -v lon,longitude ~/in_grp.nc # works
+ncrename -d lon,longitude ~/in_grp.nc # borken "nc4_reform_coord_var: Assertion `dim_datasetid > 0' failed."
+# Oddly renaming both simultaneously works:
+ncrename -d lon,longitude -v lon,longitude ~/in_grp.nc # works
+ at end verbatim
+ at end example
+
 @cindex global attributes
 @cindex group attributes
 @cindex attributes, global
diff --git a/doc/nco_qt_msvc.shtml b/doc/nco_qt_msvc.shtml
deleted file mode 100644
index f735e45..0000000
--- a/doc/nco_qt_msvc.shtml
+++ /dev/null
@@ -1,97 +0,0 @@
-<!--
-Usage:
-/usr/bin/scp ~/nco/doc/index.shtml ~/nco/doc/nco_qt_msvc.shtml ~/nco/doc/logo_vs2010.png ~/nco/doc/logo_qt.png pvicente,nco at web.sf.net:/home/project-web/nco/htdocs
-scp -p ~/nco/doc/index.shtml ~/nco/doc/nco_qt_msvc.shtml ~/nco/doc/logo_vs2010.png ~/nco/doc/logo_qt.png  dust.ess.uci.edu:/var/www/html/nco
--->
-
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=unicode">
-<meta http-equiv="cache-control" content="no-cache" />
-<title>NCO Qt/MSVC build</title>
-</head>
-
-<body>
-
-<h2>NCO Qt/MSVC build</h2>
-This page contains instructions regarding building NCO with the Qt system and with Microsoft Windows Visual Studio 2015 (MSVC). 
-This page is mostly important for developers that want to build NCO from source using Qt or MSVC.
-<br>
-<br>
-
-<table border="0" width="100%">
-  <tr>
-    <td width="100%" bgcolor="#C0C0C0"></td>
-  </tr>
-</table>
-
-<table border="0" width="25%">
-<tr>
-<td><h2>Build NCO with Qt</h2></td><td><img src="logo_qt.png" align=left></td>
-</tr>
-<tr>
-</table>
-
-<a target="_top" href="https://www.qt.io">Qt</a> is a cross platform build system. As of NCO 4.2.1, it is possible to build NCO with Qt, in a Linux, Mac OSX or 
-Windows enviroment. NCO can be built either from the Qt IDE, QtCreator, or from the command line. To build NCO with QtCreator, just open the file /qt/nco.pro. 
-To build NCO from the command line, do:
-<br>
-<p><tt>$ cd qt</tt>
-<br><tt>$ qmake</tt>
-<br><tt>$ make</tt></p>
-
-<table border="0" width="100%">
-  <tr>
-    <td width="100%" bgcolor="#C0C0C0"></td>
-  </tr>
-</table>
-
-<table border="0" width="35%">
-<tr>
-<td><h2>Build NCO with MSVC</h2></td><td><img src="logo_vs2010.png" align=left></td>
-</tr>
-<tr>
-</table>
-
-As of NCO 4.2.0, it is possible to build NCO with <a target="_top" href="https://www.visualstudio.com/en-us">Visual Studio 2013</a>. 
-To build NCO with MSVC, open the file /qt/nco.sln with Visual Studio.
-
-NCO depends on several pre-installed libraries, namely: HDF5 (including HDF5 High-Level), netCDF, zlib, szip, Antlr, GSL, Curl, UDUnits, Expat.
-The NCO supplied Visual Studio projects assume static builds of these libraries. 
-These are specified by means of the following Windows environment variables in the projects:
-<br> 
-<br> 
-<tt>LIB_NETCDF</tt>
-<br><tt>LIB_HDF5</tt>
-<br><tt>LIB_HDF5_HL</tt>
-<br><tt>LIB_ZLIB</tt>
-<br><tt>LIB_SZIP</tt>
-<br><tt>LIB_ANTLR</tt>
-<br><tt>LIB_GSL</tt>
-<br><tt>LIB_CURL</tt>
-<br><tt>LIB_UDUNITS</tt>
-<br><tt>LIB_EXPAT</tt>
-<br>
-<br>
-Additionnaly, the following environment variable must also be defined for the location of the netCDF, UDUnits, GSL and Antlr header files:
-<br><tt>HEADER_NETCDF</tt>
-<br><tt>HEADER_UDUNITS</tt>
-<br><tt>HEADER_GSL</tt>
-<br><tt>HEADER_ANTLR</tt>
-<br>
-<br>
-
-<table border="0" width="100%">
-  <tr>
-    <td width="100%" bgcolor="#C0C0C0"></td>
-  </tr>
-</table>
-
-<table width="100%"><tr><td align="left" valign="top">
-<a href="http://nco.sf.net">Homepage</a> 
-</td>
-</table>
-
-</body>
-</html>
diff --git a/man/ncclimo.1 b/man/ncclimo.1
index f16ad0e..404548e 100644
--- a/man/ncclimo.1
+++ b/man/ncclimo.1
@@ -7,7 +7,7 @@
 ncclimo \- netCDF Climatology Generator
 .SH SYNTAX
 ncclimo
-[\-a
+[\-3] [\-4] [\-5] [\-6] [\-7] [\-a
 .IR dec_md ]
 [\-C
 .IR clm_md ]
@@ -20,13 +20,15 @@ ncclimo
 [\-e
 .IR yr_end ] 
 [\-f
-.IR fml_nm ] 
-[\-h
+.IR fml_nm ]
+[\-\-fl_fmt=fmt] [\-h
 .IR hst_nm ] 
 [\-i
 .IR drc_in ] 
 [\-j
 .IR job_nbr ] 
+[\-L
+.IR dfl_lvl ] 
 [\-l
 .IR lnk_flg ] 
 [\-m
@@ -39,18 +41,19 @@ ncclimo
 [\-o
 .IR drc_out ] 
 [\-p
-.IR par_typ ] 
+.IR par_typ ] [\-\-ppc=
+.IR ppc_prc ]
 [\-R
 .IR rgr_opt ] 
 [\-r
-.IR rgr_map ] [\--rm_ntv
+.IR rgr_map ] [\--rm_ntv=
 .IR rm_ntv ] [\-S
 .IR yr_prv ] 
 [\-s
 .IR yr_srt ] 
-[\--std_flg ] [\--seasons
+[\--std_flg ] [\--seasons=
 .IR csn_lst ] [\-t
-.IR thr_nbr ] [\--tpd_out
+.IR thr_nbr ] [\--tpd_out=
 .IR tpd_out ] [\-v
 .IR var_lst ] 
 [\--version ] [\-X
diff --git a/man/ncremap.1 b/man/ncremap.1
index 23c1856..0dcf8cf 100644
--- a/man/ncremap.1
+++ b/man/ncremap.1
@@ -22,6 +22,8 @@ ncremap
 .IR in_fl ] 
 [\-j
 .IR job_nbr ] 
+[\-L
+.IR dfl_lvl ] 
 [\-M] [\-m
 .IR map_fl ] [\--msk_dst =
 .IR msk_dst ] [\--msk_out =
@@ -36,8 +38,7 @@ ncremap
 [\-P
 .IR pdq_typ ] 
 [\-p
-.IR par_typ ] 
-[\-R
+.IR par_typ ] [\-R
 .IR rgr_opt ] 
 [\-s
 .IR grd_src ] [\--stdin ]
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index 08ad7d4..7d02c2a 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -1587,7 +1587,7 @@ var_sct * bsc_cls::getdims_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_
 	 20050610: C99 mandates support for erf(), erfc(), tgamma()
 	 Eventually users without C99 will forego ncap */
       
-#if defined(LINUX) || defined(LINUXAMD64) || defined(MACOSX)
+#if defined(LINUX) || defined(LINUXAMD64) || defined(MACOSX) || defined(_MSC_VER)
       sym_vtr.push_back(sym_cls("erf",erf,erff));
       sym_vtr.push_back(sym_cls("erfc",erfc,erfcf));
       sym_vtr.push_back(sym_cls("gamma",tgamma,tgammaf));
diff --git a/src/nco/Makefile.am b/src/nco/Makefile.am
index b38a7e9..7f85af3 100644
--- a/src/nco/Makefile.am
+++ b/src/nco/Makefile.am
@@ -102,6 +102,7 @@ nco_grp_utl.h \
 nco_grp_trv.h \
 nco_lmt.h \
 nco_lst_utl.h \
+nco_map.h \
 nco_md5.h \
 nco_mmr.h \
 nco_mpi.h \
@@ -164,6 +165,7 @@ nco_grp_utl.c \
 nco_grp_trv.c \
 nco_lmt.c \
 nco_lst_utl.c \
+nco_map.c \
 nco_md5.c \
 nco_mmr.c \
 nco_msa.c \
diff --git a/src/nco/Makefile.in b/src/nco/Makefile.in
index 99c2017..c3b882c 100644
--- a/src/nco/Makefile.in
+++ b/src/nco/Makefile.in
@@ -153,9 +153,9 @@ am__libnco_la_SOURCES_DIST = libnco.h nco_getopt.h ncap.h ncap_yacc.h \
 	nco.h nco_att_utl.h nco_aux.h nco_bnr.h nco_cln_utl.h \
 	nco_cnf_dmn.h nco_cnf_typ.h nco_cnk.h nco_cnv_arm.h \
 	nco_cnv_csm.h nco_ctl.h nco_dbg.h nco_dmn_utl.h nco_fl_utl.h \
-	nco_grp_utl.h nco_grp_trv.h nco_lmt.h nco_lst_utl.h nco_md5.h \
-	nco_mmr.h nco_mpi.h nco_msa.h nco_mss_val.h nco_mta.h \
-	nco_netcdf.h nco_omp.h nco_pck.h nco_ppc.h nco_prn.h \
+	nco_grp_utl.h nco_grp_trv.h nco_lmt.h nco_lst_utl.h nco_map.h \
+	nco_md5.h nco_mmr.h nco_mpi.h nco_msa.h nco_mss_val.h \
+	nco_mta.h nco_netcdf.h nco_omp.h nco_pck.h nco_ppc.h nco_prn.h \
 	nco_rec_var.h nco_rgr.h nco_rth_flt.h nco_rth_utl.h \
 	nco_scl_utl.h nco_scm.h nco_sld.h nco_sng_utl.h nco_srm.h \
 	nco_typ.h nco_uthash.h nco_var_avg.h nco_var_lst.h \
@@ -163,11 +163,11 @@ am__libnco_la_SOURCES_DIST = libnco.h nco_getopt.h ncap.h ncap_yacc.h \
 	nco_att_utl.c nco_aux.c nco_bnr.c nco_cln_utl.c nco_cnf_dmn.c \
 	nco_cnf_typ.c nco_cnk.c nco_cnv_arm.c nco_cnv_csm.c nco_ctl.c \
 	nco_dbg.c nco_dmn_utl.c nco_fl_utl.c nco_grp_utl.c \
-	nco_grp_trv.c nco_lmt.c nco_lst_utl.c nco_md5.c nco_mmr.c \
-	nco_msa.c nco_mss_val.c nco_mta.c nco_netcdf.c nco_omp.c \
-	nco_pck.c nco_ppc.c nco_prn.c nco_rec_var.c nco_rgr.c \
-	nco_rth_flt.c nco_rth_utl.c nco_scl_utl.c nco_scm.c nco_sld.c \
-	nco_sng_utl.c nco_srm.c nco_var_avg.c nco_var_lst.c \
+	nco_grp_trv.c nco_lmt.c nco_lst_utl.c nco_map.c nco_md5.c \
+	nco_mmr.c nco_msa.c nco_mss_val.c nco_mta.c nco_netcdf.c \
+	nco_omp.c nco_pck.c nco_ppc.c nco_prn.c nco_rec_var.c \
+	nco_rgr.c nco_rth_flt.c nco_rth_utl.c nco_scl_utl.c nco_scm.c \
+	nco_sld.c nco_sng_utl.c nco_srm.c nco_var_avg.c nco_var_lst.c \
 	nco_var_rth.c nco_var_scv.c nco_var_utl.c
 am__objects_1 =
 am__objects_2 = $(am__objects_1)
@@ -177,9 +177,9 @@ am_libnco_la_OBJECTS = $(am__objects_2) $(am__objects_3) \
 	nco_cnf_dmn.lo nco_cnf_typ.lo nco_cnk.lo nco_cnv_arm.lo \
 	nco_cnv_csm.lo nco_ctl.lo nco_dbg.lo nco_dmn_utl.lo \
 	nco_fl_utl.lo nco_grp_utl.lo nco_grp_trv.lo nco_lmt.lo \
-	nco_lst_utl.lo nco_md5.lo nco_mmr.lo nco_msa.lo nco_mss_val.lo \
-	nco_mta.lo nco_netcdf.lo nco_omp.lo nco_pck.lo nco_ppc.lo \
-	nco_prn.lo nco_rec_var.lo nco_rgr.lo nco_rth_flt.lo \
+	nco_lst_utl.lo nco_map.lo nco_md5.lo nco_mmr.lo nco_msa.lo \
+	nco_mss_val.lo nco_mta.lo nco_netcdf.lo nco_omp.lo nco_pck.lo \
+	nco_ppc.lo nco_prn.lo nco_rec_var.lo nco_rgr.lo nco_rth_flt.lo \
 	nco_rth_utl.lo nco_scl_utl.lo nco_scm.lo nco_sld.lo \
 	nco_sng_utl.lo nco_srm.lo nco_var_avg.lo nco_var_lst.lo \
 	nco_var_rth.lo nco_var_scv.lo nco_var_utl.lo
@@ -728,6 +728,7 @@ nco_grp_utl.h \
 nco_grp_trv.h \
 nco_lmt.h \
 nco_lst_utl.h \
+nco_map.h \
 nco_md5.h \
 nco_mmr.h \
 nco_mpi.h \
@@ -789,6 +790,7 @@ nco_grp_utl.c \
 nco_grp_trv.c \
 nco_lmt.c \
 nco_lst_utl.c \
+nco_map.c \
 nco_md5.c \
 nco_mmr.c \
 nco_msa.c \
@@ -1045,6 +1047,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_grp_utl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_lmt.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_lst_utl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_map.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_md5.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_mmr.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nco_msa.Plo at am__quote@
diff --git a/src/nco/libnco.h b/src/nco/libnco.h
index 951ebdc..ae825ef 100644
--- a/src/nco/libnco.h
+++ b/src/nco/libnco.h
@@ -37,6 +37,7 @@
 #include "nco_grp_utl.h" /* Group utilities */
 #include "nco_lmt.h" /* Hyperslab limits */
 #include "nco_lst_utl.h" /* List utilities */
+#include "nco_map.h" /* Map generation */
 #include "nco_md5.h" /* MD5 digests */
 #include "nco_mmr.h" /* Memory management */
 #include "nco_msa.h" /* Multi-slabbing algorithm */
diff --git a/src/nco/ncatted.c b/src/nco/ncatted.c
index 551d64a..6906dc1 100644
--- a/src/nco/ncatted.c
+++ b/src/nco/ncatted.c
@@ -446,7 +446,7 @@ main(int argc,char **argv)
       /* Variable name of "global" means edit global attributes */
       (void)nco_aed_prc_glb(nc_id,aed_lst[idx_aed],trv_tbl);
     }else{ 
-      /* Regular ole' variable name means edits attributes that match absolute and relative names */
+      /* Regular ole' variable name means edit attributes that match absolute and relative names */
       (void)nco_aed_prc_var_nm(nc_id,aed_lst[idx_aed],trv_tbl);
     } /* end var_nm */
   } /* end loop over aed structures */
diff --git a/src/nco/ncflint.c b/src/nco/ncflint.c
index 344c568..669e84a 100644
--- a/src/nco/ncflint.c
+++ b/src/nco/ncflint.c
@@ -344,7 +344,7 @@ main(int argc,char **argv)
     {"omp_num_threads",required_argument,0,'t'},
     {"variable",required_argument,0,'v'},
     {"weight",required_argument,0,'w'},
-    {"wgt_var",no_argument,0,'w'},
+    {"wgt_var",required_argument,0,'w'},
     {"auxiliary",required_argument,0,'X'},
     {"exclude",no_argument,0,'x'},
     {"xcl",no_argument,0,'x'},
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index d396417..200d2e7 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -419,7 +419,11 @@ main(int argc,char **argv)
     {"regridding",required_argument,0,0}, /* [sng] Regridding */
     {"rgr_in",required_argument,0,0}, /* [sng] File containing fields to be regridded */
     {"rgr_grd_src",required_argument,0,0}, /* [sng] File containing input grid */
+    {"grd_src",required_argument,0,0}, /* [sng] File containing input grid */
+    {"src_grd",required_argument,0,0}, /* [sng] File containing input grid */
     {"rgr_grd_dst",required_argument,0,0}, /* [sng] File containing destination grid */
+    {"dst_grd",required_argument,0,0}, /* [sng] File containing destination grid */
+    {"grd_dst",required_argument,0,0}, /* [sng] File containing destination grid */
     {"rgr_map",required_argument,0,0}, /* [sng] File containing mapping weights from source to destination grid */
     {"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 */
@@ -682,8 +686,8 @@ main(int argc,char **argv)
         rgr_arg[rgr_nbr++]=(char *)strdup(optarg);
       } /* endif "rgr" */
       if(!strcmp(opt_crr,"rgr_in")) rgr_in=(char *)strdup(optarg);
-      if(!strcmp(opt_crr,"rgr_grd_src")) rgr_grd_src=(char *)strdup(optarg);
-      if(!strcmp(opt_crr,"rgr_grd_dst")) rgr_grd_dst=(char *)strdup(optarg);
+      if(!strcmp(opt_crr,"rgr_grd_src") || !strcmp(opt_crr,"grd_src") || !strcmp(opt_crr,"src_grd")) rgr_grd_src=(char *)strdup(optarg);
+      if(!strcmp(opt_crr,"rgr_grd_dst") || !strcmp(opt_crr,"grd_dst") || !strcmp(opt_crr,"dst_grd")) rgr_grd_dst=(char *)strdup(optarg);
       if(!strcmp(opt_crr,"rgr_map") || !strcmp(opt_crr,"map_file")){
         flg_rgr=True;
 	rgr_map=(char *)strdup(optarg);
diff --git a/src/nco/nco.h b/src/nco/nco.h
index 1d85ca9..cb084ca 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -341,10 +341,10 @@ extern "C" {
 # define NCO_VERSION_MAJOR 4
 #endif /* !NCO_VERSION_MAJOR */
 #ifndef NCO_VERSION_MINOR
-# define NCO_VERSION_MINOR 6
+# define NCO_VERSION_MINOR 7
 #endif /* !NCO_VERSION_MINOR */
 #ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 9
+# define NCO_VERSION_PATCH 0
 #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 */
@@ -354,7 +354,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.9"
+# define NCO_VERSION "4.7.0"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -1172,7 +1172,7 @@ extern "C" {
     nco_bool flg_grd; /* [flg] Create SCRIP-format grid file */
     nco_bool flg_grd_dst; /* [flg] User-specified destination grid */
     nco_bool flg_grd_src; /* [flg] User-specified input grid */
-    nco_bool flg_map; /* [flg] User-specified mapping weights */
+    nco_bool flg_wgt; /* [flg] User-specified mapping weights */
     nco_bool flg_msk_out; /* [flg] Add mask to output */
     nco_bool flg_nfr; /* [flg] Infer SCRIP-format grid file */
     nco_bool flg_rnr; /* [flg] Renormalize destination values by valid area */
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index d5d6e1c..589ee2d 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -555,6 +555,8 @@ nco_exit_lbr_rcd(void) /* [fnc] Exit with netCDF library version as return code
   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;}
+  else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '5' && lbr_sng[3] == '.' && lbr_sng[4] == '2' ){rcd=452;}
+  else if(lbr_sng[0] == '4' && lbr_sng[1] == '.' && lbr_sng[2] == '5' && lbr_sng[3] == '.' && lbr_sng[4] == '3' ){rcd=453;}
 #endif /* HAVE_NETCDF4_H */
   /* exit() with custom rcd for use by Perl regression tester nco_bm.pl/NCO_rgr.pm */
   rcd-=300;
@@ -848,7 +850,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 "Mnemonic: Catastrophe\n";
+  return "Mnemonic: Ta Nehisi\n";
 } /* end nco_nmn_get() */
 
 char * /* O [sng] nm_in stripped of any path (i.e., program name stub) */ 
diff --git a/src/nco/nco_fl_utl.c b/src/nco/nco_fl_utl.c
index 15a2e05..4916dc0 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -850,15 +850,15 @@ nco_fl_mk_lcl /* [fnc] Retrieve input file and return local filename */
             rmt_cmd=&ftp;
 
             /* Get UID to get password structure which contains home directory, login name
-            Home directory needed to search for .netrc
-            Login name used to construct e-mail address for anonymous FTP */
+	       Home directory needed to search for .netrc
+	       Login name used to construct e-mail address for anonymous FTP */
             usr_uid=getuid();
             usr_pwd=getpwuid(usr_uid);
             usr_nm=usr_pwd->pw_name;
 
             /* Construct remote hostname and filename now since:
-            1. .netrc, if any, will soon be searched for remote hostname
-            2. Remote hostname and filename always needed for remote retrieval */
+	       1. .netrc, if any, will soon be searched for remote hostname
+	       2. Remote hostname and filename always needed for remote retrieval */
 
             /* Remote hostname begins directly after "[s]ftp://" */
             host_nm_rmt=fl_nm_rmt+url_sng_lng;
@@ -1593,6 +1593,11 @@ nco_fl_out_open /* [fnc] Open output file subject to availability and user input
   } /* netCDF4 */
 #endif /* ENABLE_NETCDF4 */
 
+  if(!fl_out){
+    (void)fprintf(stdout,"%s: ERROR %s received empty filename to open\n",nco_prg_nm_get(),fnc_nm);
+    nco_exit(EXIT_FAILURE);
+  } /* fl_out */
+
   /* Set default clobber mode then modify for specified file format */
   md_create=NC_CLOBBER; /* [enm] Mode flag for nco_create() call */
   /* [fnc] Merge clobber mode with user-specified file format */
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 1bf54d4..187f8c0 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -7060,7 +7060,6 @@ 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 */
diff --git a/src/nco/nco_lmt.c b/src/nco/nco_lmt.c
index 28fe960..b77adc1 100644
--- a/src/nco/nco_lmt.c
+++ b/src/nco/nco_lmt.c
@@ -1078,9 +1078,20 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
       if(lmt.max_idx > 0L) lmt.max_idx--;
     } /* end if */
 
-    /* 20120709 Negative integer as min or max element of hyperslab specification indicates offset from end */
-    if(lmt.min_idx < 0L) lmt.min_idx+=dmn_sz-1L;
-    if(lmt.max_idx < 0L) lmt.max_idx+=dmn_sz-1L;
+    /* Negative integer as min or max element of hyperslab specification indicates offset from end
+       pharoahs--20120708 Negative integers produce domain error
+       20120709--20141001 Negative integer is elements away from last element, e.g., -1 is penultimate element
+       20141002--forever  -1 is last element, e.g., -2 is penultimate element, -N is first element (Python convention) */
+    nco_bool flg_old_usg=False;
+    if(lmt.min_idx == 0L && lmt.min_sng)
+      if(lmt.min_sng[0] == '-') 
+	flg_old_usg=True;
+    if(lmt.max_idx == 0L && lmt.max_sng)
+      if(lmt.max_sng[0] == '-')
+	flg_old_usg=True;
+    if(flg_old_usg) (void)fprintf(stdout,"%s: WARNING Only NCO 4.4.6 treats negative zero as the last element of a dimension. Beginning 20141002, NCO uses the Python convention where negative one is the last element of a dimension, and negative zero is the same as zero and so selects the first element of a dimension. Negative zero also causes this warning to be printed in case the 4.4.6 behavior was intended.\n",nco_prg_nm_get());
+    if(lmt.min_idx < 0L) lmt.min_idx+=dmn_sz;
+    if(lmt.max_idx < 0L) lmt.max_idx+=dmn_sz;
 
     /* Exit if requested indices are always invalid for all operators... */
     if(lmt.min_idx < 0L){
@@ -1858,7 +1869,7 @@ nco_lmt_evl_dmn_crd            /* [fnc] Parse user-specified limits into hypersl
 
     /* Negative integer as min or max element of hyperslab specification indicates offset from end
        pharoahs--20120708 Negative integers produce domain error
-       20120709--20151001 Negative integer is elements away from last element, e.g., -1 is penultimate element
+       20120709--20141001 Negative integer is elements away from last element, e.g., -1 is penultimate element
        20141002--forever  -1 is last element, e.g., -2 is penultimate element, -N is first element (Python convention) */
     nco_bool flg_old_usg=False;
     if(lmt.min_idx == 0L && lmt.min_sng)
diff --git a/src/nco/nco_map.c b/src/nco/nco_map.c
new file mode 100644
index 0000000..537966d
--- /dev/null
+++ b/src/nco/nco_map.c
@@ -0,0 +1,818 @@
+/* $Header$ */
+
+/* Purpose: NCO map-generation utilities */
+
+/* Copyright (C) 2017--2017 Charlie Zender
+   This file is part of NCO, the netCDF Operators. NCO is free software.
+   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_map.h" /* Map generation */
+
+int /* O [enm] Return code */
+nco_map_mk /* [fnc] Create ESMF-format map file */
+(rgr_sct * const rgr) /* I/O [sct] Regridding structure */
+{
+  /* Purpose: Use information from two grids to create map-file
+     ncks -D 1 -O --grd_src=${DATA}/grids/ne30np4_pentagons.091226.nc --grd_dst=${DATA}/grids/129x256_SCRIP.20150901.nc --map=${HOME}/map_foo.nc ~/nco/data/in.nc ~/foo.nc */
+
+  const char fnc_nm[]="nco_map_mk()"; /* [sng] Function name */
+
+  char *fl_in_dst;
+  char *fl_in_src;
+  char *fl_pth_lcl=NULL;
+
+  const double rdn2dgr=180.0/M_PI;
+  const double dgr2rdn=M_PI/180.0;
+  const double eps_rlt=1.0e-14; /* [frc] Round-off error tolerance */
+
+  double *area_in=NULL; /* [sr] Area of source grid */
+  double *frc_in=NULL; /* [frc] Fraction of source grid */
+  double *lat_crn_in=NULL; /* [dgr] Latitude  corners of source grid */
+  double *lat_ctr_in=NULL_CEWI; /* [dgr] Latitude  centers of source grid */
+  double *lon_crn_in=NULL; /* [dgr] Longitude corners of source grid */
+  double *lon_ctr_in=NULL_CEWI; /* [dgr] Longitude centers of source grid */
+
+  double *area_out=NULL; /* [sr] Area of destination grid */
+  double *frc_out=NULL; /* [frc] Fraction of destination grid */
+  double *lat_crn_out=NULL; /* [dgr] Latitude  corners of destination grid */
+  double *lat_ctr_out=NULL_CEWI; /* [dgr] Latitude  centers of destination grid */
+  double *lon_crn_out=NULL; /* [dgr] Longitude corners of destination grid */
+  double *lon_ctr_out=NULL_CEWI; /* [dgr] Longitude centers of destination grid */
+  
+  int *msk_in=NULL; /* [flg] Mask on source grid */
+  int *msk_out=NULL; /* [flg] Mask on destination grid */
+
+  const int dmn_nbr_1D=1; /* [nbr] Rank of 1-D grid variables */
+  const int dmn_nbr_2D=2; /* [nbr] Rank of 2-D grid variables */
+  const int dmn_nbr_3D=3; /* [nbr] Rank of 3-D grid variables */
+  const int dmn_nbr_grd_max=dmn_nbr_3D; /* [nbr] Maximum rank of grid variables */
+
+  int dmn_ids[dmn_nbr_grd_max]; /* [id] Dimension IDs array for output variable */
+
+  int dfl_lvl=NCO_DFL_LVL_UNDEFINED; /* [enm] Deflate level */
+  int fll_md_old; /* [enm] Old fill mode */
+  int in_id_dst; /* I [id] Input netCDF file ID */
+  int in_id_src; /* I [id] Input netCDF file ID */
+  int md_open; /* [enm] Mode flag for nc_open() call */
+  int rcd=NC_NOERR;
+
+  int dst_grid_corners_id; /* [id] Destination grid corners dimension ID */
+  int dst_grid_rank_id; /* [id] Destination grid rank dimension ID */
+  int dst_grid_size_id; /* [id] Destination grid size dimension ID */
+  int src_grid_corners_id; /* [id] Source grid corners dimension ID */
+  int src_grid_rank_id; /* [id] Source grid rank dimension ID */
+  int src_grid_size_id; /* [id] Source grid size dimension ID */
+
+  int *dmn_sz_in_int; /* [nbr] Array of dimension sizes of source grid */
+  int *dmn_sz_out_int; /* [nbr] Array of dimension sizes of destination grid */
+
+  int dmn_sz_in_int_id; /* [id] Source grid dimension sizes variable ID */
+  int dmn_sz_out_int_id; /* [id] Destination grid dimension sizes variable ID */
+
+  int area_in_id; /* [id] Area variable ID */
+  int frc_in_id; /* [id] Fraction variable ID */
+  int msk_in_id=NC_MIN_INT; /* [id] Mask variable ID */
+  int src_grd_crn_lat_id; /* [id] Source grid corner latitudes  variable ID */
+  int src_grd_crn_lon_id; /* [id] Source grid corner longitudes variable ID */
+  int src_grd_ctr_lat_id; /* [id] Source grid center latitudes  variable ID */
+  int src_grd_ctr_lon_id; /* [id] Source grid center longitudes variable ID */
+
+  int area_out_id; /* [id] Area variable ID */
+  int frc_out_id; /* [id] Fraction variable ID */
+  int msk_out_id=NC_MIN_INT; /* [id] Mask variable ID */
+  int dst_grd_crn_lat_id; /* [id] Destination grid corner latitudes  variable ID */
+  int dst_grd_crn_lon_id; /* [id] Destination grid corner longitudes variable ID */
+  int dst_grd_ctr_lat_id; /* [id] Destination grid center latitudes  variable ID */
+  int dst_grd_ctr_lon_id; /* [id] Destination grid center longitudes variable ID */
+  
+  long *dmn_cnt=NULL;
+  long *dmn_srt=NULL;
+
+  long idx; /* [idx] Counting index for unrolled grids */
+
+  nco_bool FL_RTR_RMT_LCN_DST;
+  nco_bool FL_RTR_RMT_LCN_SRC;
+  nco_bool RAM_OPEN=False; /* [flg] Open (netCDF3-only) file(s) in RAM */
+  nco_bool RM_RMT_FL_PST_PRC=True; /* Option R */
+
+  nco_mpf_sct mpf;
+
+  size_t bfr_sz_hnt=NC_SIZEHINT_DEFAULT; /* [B] Buffer size hint */
+  
+  if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stderr,"%s: INFO %s obtaining source grid from %s\n",nco_prg_nm_get(),fnc_nm,rgr->fl_grd_src);
+  if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stderr,"%s: INFO %s obtaining destination grid from %s\n",nco_prg_nm_get(),fnc_nm,rgr->fl_grd_dst);
+
+  /* Duplicate (because nco_fl_mk_lcl() free()'s fl_in) */
+  fl_in_dst=(char *)strdup(rgr->fl_grd_dst);
+  fl_in_src=(char *)strdup(rgr->fl_grd_src);
+  /* Make sure file is on local system and is readable or die trying */
+  fl_in_dst=nco_fl_mk_lcl(fl_in_dst,fl_pth_lcl,&FL_RTR_RMT_LCN_DST);
+  fl_in_src=nco_fl_mk_lcl(fl_in_src,fl_pth_lcl,&FL_RTR_RMT_LCN_SRC);
+  /* Open file using appropriate buffer size hints and verbosity */
+  if(RAM_OPEN) md_open=NC_NOWRITE|NC_DISKLESS; else md_open=NC_NOWRITE;
+
+  rcd+=nco_fl_open(fl_in_dst,md_open,&bfr_sz_hnt,&in_id_dst);
+  rcd+=nco_fl_open(fl_in_src,md_open,&bfr_sz_hnt,&in_id_src);
+  
+  rcd+=nco_inq_dimid(in_id_dst,"grid_corners",&dst_grid_corners_id);
+  rcd+=nco_inq_dimid(in_id_dst,"grid_rank",&dst_grid_rank_id);
+  rcd+=nco_inq_dimid(in_id_dst,"grid_size",&dst_grid_size_id);
+
+  rcd+=nco_inq_dimid(in_id_src,"grid_corners",&src_grid_corners_id);
+  rcd+=nco_inq_dimid(in_id_src,"grid_rank",&src_grid_rank_id);
+  rcd+=nco_inq_dimid(in_id_src,"grid_size",&src_grid_size_id);
+
+  /* Use dimension IDs to get dimension sizes */
+  rcd+=nco_inq_dimlen(in_id_src,src_grid_size_id,&mpf.src_grid_size);
+  rcd+=nco_inq_dimlen(in_id_dst,dst_grid_size_id,&mpf.dst_grid_size);
+  rcd+=nco_inq_dimlen(in_id_src,src_grid_corners_id,&mpf.src_grid_corners);
+  rcd+=nco_inq_dimlen(in_id_dst,dst_grid_corners_id,&mpf.dst_grid_corners);
+  rcd+=nco_inq_dimlen(in_id_src,src_grid_rank_id,&mpf.src_grid_rank);
+  rcd+=nco_inq_dimlen(in_id_dst,dst_grid_rank_id,&mpf.dst_grid_rank);
+  assert(mpf.src_grid_size < INT_MAX && mpf.dst_grid_size < INT_MAX);
+  
+  if(nco_dbg_lvl_get() >= nco_dbg_std){
+    (void)fprintf(stderr,"%s: INFO %s mapfile generation input metadata and grid sizes: ",nco_prg_nm_get(),fnc_nm);
+    (void)fprintf(stderr,"src_grid_size = n_a = %li, dst_grid_size = n_b = %li, src_grid_corners = nv_a = %li, dst_grid_corners = nv_b = %li, src_grid_rank = %li, dst_grid_rank = %li\n",mpf.src_grid_size,mpf.dst_grid_size,mpf.src_grid_corners,mpf.dst_grid_corners,mpf.src_grid_rank,mpf.dst_grid_rank);
+  } /* endif dbg */
+
+  /* Set type of grid conversion */
+  nco_rgr_typ_enm nco_rgr_typ=nco_rgr_grd_nil; /* [enm] Type of grid conversion */
+  if(mpf.src_grid_rank == 1 && mpf.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_1D_to_1D;
+  if(mpf.src_grid_rank == 1 && mpf.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_1D_to_2D;
+  if(mpf.src_grid_rank == 2 && mpf.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_2D_to_1D;
+  if(mpf.src_grid_rank == 2 && mpf.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_2D_to_2D;
+  assert(nco_rgr_typ != nco_rgr_grd_nil);
+
+  /* Save typing later */
+  nco_bool flg_grd_in_1D=False;
+  nco_bool flg_grd_in_2D=False;
+  nco_bool flg_grd_out_1D=False;
+  nco_bool flg_grd_out_2D=False;
+  if(nco_rgr_typ == nco_rgr_grd_1D_to_1D || nco_rgr_typ == nco_rgr_grd_1D_to_2D) flg_grd_in_1D=True;
+  if(nco_rgr_typ == nco_rgr_grd_2D_to_1D || nco_rgr_typ == nco_rgr_grd_2D_to_2D) flg_grd_in_2D=True;
+  if(nco_rgr_typ == nco_rgr_grd_1D_to_1D || nco_rgr_typ == nco_rgr_grd_2D_to_1D) flg_grd_out_1D=True;
+  if(nco_rgr_typ == nco_rgr_grd_1D_to_2D || nco_rgr_typ == nco_rgr_grd_2D_to_2D) flg_grd_out_2D=True;
+  
+  rcd+=nco_inq_varid(in_id_src,"grid_dims",&dmn_sz_in_int_id);
+  rcd+=nco_inq_varid(in_id_dst,"grid_dims",&dmn_sz_out_int_id);
+  assert(rcd == NC_NOERR);
+
+  dmn_srt=(long *)nco_malloc(dmn_nbr_grd_max*sizeof(long));
+  dmn_cnt=(long *)nco_malloc(dmn_nbr_grd_max*sizeof(long));
+
+  dmn_sz_in_int=(int *)nco_malloc(mpf.src_grid_rank*nco_typ_lng((nc_type)NC_INT));
+  dmn_sz_out_int=(int *)nco_malloc(mpf.dst_grid_rank*nco_typ_lng((nc_type)NC_INT));
+
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=mpf.src_grid_rank;
+  rcd=nco_get_vara(in_id_src,dmn_sz_in_int_id,dmn_srt,dmn_cnt,dmn_sz_in_int,(nc_type)NC_INT);
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=mpf.dst_grid_rank;
+  rcd=nco_get_vara(in_id_dst,dmn_sz_out_int_id,dmn_srt,dmn_cnt,dmn_sz_out_int,(nc_type)NC_INT);
+
+  /* Check-for and workaround faulty grid sizes, typically from bogus dual-grid generation algorithm */
+  if(flg_grd_in_1D && (mpf.src_grid_size != dmn_sz_in_int[0])){
+    (void)fprintf(stdout,"%s: INFO %s reports input grid dimension sizes disagree: mpf.src_grid_size = %ld != %d = dmn_sz_in[0]. Problem may be caused by incorrect grid_dims variable in source gridfile. This is a known issue with some gridfiles generated prior to ~20150901, particularly for spectral element dual-grids. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,mpf.src_grid_size,dmn_sz_in_int[0]);
+      dmn_sz_in_int[0]=mpf.src_grid_size;
+  } /* !bug */
+  if(flg_grd_out_1D && (mpf.dst_grid_size != dmn_sz_out_int[0])){
+    (void)fprintf(stdout,"%s: INFO %s reports output grid dimension sizes disagree: mpf.dst_grid_size = %ld != %d = dmn_sz_out[0]. Problem may be caused by incorrect grid_dims variable in destination gridfile. This is a known issue with gridfiles generated prior to ~20150901, particularly for spectral element dual-grids. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,mpf.dst_grid_size,dmn_sz_out_int[0]);
+    dmn_sz_out_int[0]=mpf.dst_grid_size;
+  } /* !bug */
+
+  /* SCRIP introduced [lon,lat] convention because more natural for Fortran */
+  const int lon_psn=0; /* [idx] Ordinal position of longitude in source grid dimension-size array */
+  const int lat_psn=1; /* [idx] Ordinal position of latitude  in source grid dimension-size array */
+
+  int bnd_nbr_in; /* [nbr] Number of vertices for source grid coordinates */
+  long col_nbr_in; /* [idx] Number of columns in source grid */
+  long lon_nbr_in; /* [idx] Number of longitudes in source grid */
+  long lat_nbr_in; /* [idx] Number of latitudes  in source grid */
+  const size_t grd_sz_in=mpf.src_grid_size; /* [nbr] Number of elements in single layer of input grid */
+  const size_t grd_sz_out=mpf.dst_grid_size; /* [nbr] Number of elements in single layer of output grid */
+  bnd_nbr_in=mpf.src_grid_corners;
+  if(flg_grd_in_1D){
+    col_nbr_in=dmn_sz_in_int[0];
+    lon_nbr_in=dmn_sz_in_int[0];
+    lat_nbr_in=dmn_sz_in_int[0];
+  }else if(flg_grd_in_2D){
+    col_nbr_in=0;
+    lon_nbr_in=dmn_sz_in_int[lon_psn];
+    lat_nbr_in=dmn_sz_in_int[lat_psn];
+    /* Sanity-check */
+    assert(lat_nbr_in*lon_nbr_in == (long)grd_sz_in);
+  } /* !src_grid_rank */
+
+  int bnd_nbr_out; /* [nbr] Number of vertices for destination grid coordinates */
+  long col_nbr_out; /* [nbr] Number of columns in destination grid */
+  long lon_nbr_out; /* [nbr] Number of longitudes in destination grid */
+  long lat_nbr_out; /* [nbr] Number of latitudes  in destination grid */
+  bnd_nbr_out=mpf.dst_grid_corners;
+  if(flg_grd_out_1D){
+    col_nbr_out=dmn_sz_out_int[0];
+    lat_nbr_out=dmn_sz_out_int[0];
+    lon_nbr_out=dmn_sz_out_int[0];
+    /* Sanity-check */
+    assert(col_nbr_out == (long)grd_sz_out);
+  }else if(flg_grd_out_2D){
+    col_nbr_out=lat_nbr_out*lon_nbr_out;
+    lat_nbr_out=dmn_sz_out_int[lat_psn];
+    lon_nbr_out=dmn_sz_out_int[lon_psn];
+    /* Sanity-check */
+    assert(lat_nbr_out*lon_nbr_out == (long)grd_sz_out);
+  } /* !dst_grid_rank */
+
+  /* Obtain grid values necessary to compute overlap mesh */
+  rcd+=nco_inq_varid(in_id_src,"grid_area",&area_in_id); /* ESMF: area_a */
+  rcd+=nco_inq_varid(in_id_src,"grid_center_lon",&src_grd_ctr_lon_id); /* ESMF: xc_a */
+  rcd+=nco_inq_varid(in_id_src,"grid_center_lat",&src_grd_ctr_lat_id); /* ESMF: yc_a */
+  rcd+=nco_inq_varid(in_id_src,"grid_corner_lon",&src_grd_crn_lon_id); /* ESMF: xv_a */
+  rcd+=nco_inq_varid(in_id_src,"grid_corner_lat",&src_grd_crn_lat_id); /* ESMF: yv_a */
+  rcd+=nco_inq_varid(in_id_src,"grid_imask",&msk_in_id); /* ESMF: msk_a */
+
+  rcd+=nco_inq_varid(in_id_dst,"grid_area",&area_out_id); /* ESMF: area_b */
+  rcd+=nco_inq_varid(in_id_dst,"grid_center_lon",&dst_grd_ctr_lon_id); /* ESMF: xc_b */
+  rcd+=nco_inq_varid(in_id_dst,"grid_center_lat",&dst_grd_ctr_lat_id); /* ESMF: yc_b */
+  rcd+=nco_inq_varid(in_id_dst,"grid_corner_lon",&dst_grd_crn_lon_id); /* ESMF: xv_b */
+  rcd+=nco_inq_varid(in_id_dst,"grid_corner_lat",&dst_grd_crn_lat_id); /* ESMF: yv_b */
+  rcd+=nco_inq_varid(in_id_dst,"grid_imask",&msk_out_id); /* ESMF: msk_b */
+
+  /* Ensure coordinates are in degrees not radians for simplicity and CF-compliance
+     NB: ${DATA}/scrip/rmp_T42_to_POP43_conserv.nc has [xy]?_a in degrees and [xy]?_b in radians! */
+  char *att_val;
+  char unt_sng[]="units"; /* [sng] netCDF-standard units attribute name */
+  long att_sz;
+  nc_type att_typ;
+  nco_bool flg_crd_rdn_src=False; /* [flg] Source coordinates are in radians not degrees */
+  rcd=nco_inq_att_flg(in_id_src,src_grd_ctr_lat_id,unt_sng,&att_typ,&att_sz);
+  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_src,src_grd_ctr_lat_id,unt_sng,att_val,att_typ);
+    /* NUL-terminate attribute before using strstr() */
+    att_val[att_sz]='\0';
+    /* Match "radian" and "radians" */
+    if(strstr(att_val,"radian")) flg_crd_rdn_src=True;
+    if(att_val) att_val=(char *)nco_free(att_val);
+  } /* end rcd && att_typ */
+  nco_bool flg_crd_rdn_dst=False; /* [flg] Destination coordinates are in radians not degrees */
+  rcd=nco_inq_att_flg(in_id_dst,dst_grd_ctr_lat_id,unt_sng,&att_typ,&att_sz);
+  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_dst,dst_grd_ctr_lat_id,unt_sng,att_val,att_typ);
+    /* NUL-terminate attribute before using strstr() */
+    att_val[att_sz]='\0';
+    /* Match "radian" and "radians" */
+    if(strstr(att_val,"radian")) flg_crd_rdn_dst=True;
+    if(att_val) att_val=(char *)nco_free(att_val);
+  } /* end rcd && att_typ */
+
+  nco_bool flg_grd_in_crv=False; /* [flg] Curvilinear coordinates */
+  nco_bool flg_grd_in_rct=False; /* [flg] Rectangular coordinates */
+  nco_bool flg_grd_out_crv=False; /* [flg] Curvilinear coordinates */
+  nco_bool flg_grd_out_rct=False; /* [flg] Rectangular coordinates */
+  const nc_type crd_typ=NC_DOUBLE;
+
+  area_in=(double *)nco_malloc(grd_sz_in*nco_typ_lng(crd_typ));
+  frc_in=(double *)nco_malloc(grd_sz_in*nco_typ_lng(crd_typ));
+  msk_in=(int *)nco_malloc(grd_sz_in*nco_typ_lng(crd_typ));
+  lon_ctr_in=(double *)nco_malloc(grd_sz_in*nco_typ_lng(crd_typ));
+  lat_ctr_in=(double *)nco_malloc(grd_sz_in*nco_typ_lng(crd_typ));
+  lon_crn_in=(double *)nco_malloc(mpf.src_grid_corners*grd_sz_in*nco_typ_lng(crd_typ));
+  lat_crn_in=(double *)nco_malloc(mpf.src_grid_corners*grd_sz_in*nco_typ_lng(crd_typ));
+  
+  area_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ));
+  frc_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ));
+  msk_out=(int *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ));
+  lon_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ));
+  lat_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ));
+  lon_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ));
+  lat_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ));
+  
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_in;
+  rcd=nco_get_vara(in_id_src,area_in_id,dmn_srt,dmn_cnt,area_in,crd_typ);
+  rcd=nco_get_vara(in_id_src,msk_in_id,dmn_srt,dmn_cnt,msk_in,(nc_type)NC_INT);
+  rcd=nco_get_vara(in_id_src,src_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_in,crd_typ);
+  rcd=nco_get_vara(in_id_src,src_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_in,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_in;
+  dmn_cnt[1]=mpf.src_grid_corners;
+  rcd=nco_get_vara(in_id_src,src_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_in,crd_typ);
+  rcd=nco_get_vara(in_id_src,src_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_in,crd_typ);
+
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_out;
+  rcd=nco_get_vara(in_id_dst,area_out_id,dmn_srt,dmn_cnt,area_out,crd_typ);
+  rcd=nco_get_vara(in_id_dst,msk_out_id,dmn_srt,dmn_cnt,msk_out,(nc_type)NC_INT);
+  rcd=nco_get_vara(in_id_dst,dst_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_out,crd_typ);
+  rcd=nco_get_vara(in_id_dst,dst_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_out,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_out;
+  dmn_cnt[1]=mpf.dst_grid_corners;
+  rcd=nco_get_vara(in_id_dst,dst_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_out,crd_typ);
+  rcd=nco_get_vara(in_id_dst,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_out,crd_typ);
+  
+  if(flg_crd_rdn_src){
+    for(idx=0;idx<grd_sz_in;idx++){
+      lon_ctr_in[idx]*=rdn2dgr;
+      lat_ctr_in[idx]*=rdn2dgr;
+    } /* !idx */
+    long grd_crn_sz_in;
+    grd_crn_sz_in=mpf.src_grid_corners*grd_sz_in;
+    for(idx=0;idx<grd_crn_sz_in;idx++){
+      lon_crn_in[idx]*=rdn2dgr;
+      lat_crn_in[idx]*=rdn2dgr;
+    } /* !idx */
+  } /* !rdn */
+  
+  if(flg_crd_rdn_dst){
+    for(idx=0;idx<grd_sz_out;idx++){
+      lon_ctr_out[idx]*=rdn2dgr;
+      lat_ctr_out[idx]*=rdn2dgr;
+    } /* !idx */
+    long grd_crn_sz_out;
+    grd_crn_sz_out=mpf.dst_grid_corners*grd_sz_out;
+    for(idx=0;idx<grd_crn_sz_out;idx++){
+      lon_crn_out[idx]*=rdn2dgr;
+      lat_crn_out[idx]*=rdn2dgr;
+    } /* !idx */
+  } /* !rdn */
+
+  /* User may specify curvilinear grid (with --rgr crv). Otherwise, manually test for curvilinear source grid. */
+  if(flg_grd_in_2D){
+    flg_grd_in_crv=rgr->flg_crv; /* [flg] Curvilinear coordinates */
+    if(flg_grd_in_crv){
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid specified to be %s\n",nco_prg_nm_get(),flg_grd_in_crv ? "Curvilinear" : "Rectangular");
+    }else{
+      long idx_tst=long_CEWI; /* [idx] Index of first latitude or longitude */
+      for(idx=0;idx<(long)grd_sz_in;idx++){
+	if(idx%lon_nbr_in == 0) idx_tst=idx;
+	if(lat_ctr_in[idx] != lat_ctr_in[idx_tst]) break;
+      } /* !rectangular */
+      if(idx != (long)grd_sz_in) flg_grd_in_crv=True; else flg_grd_in_rct=True;
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Source grid detected to be %s\n",nco_prg_nm_get(),flg_grd_in_crv ? "Curvilinear" : "Rectangular");
+    } /* !flg_grd_in_crv */
+  } /* flg_grd_in_2D */
+
+  /* User may specify curvilinear grid (with --rgr crv). Otherwise, manually test for curvilinear destination grid. */
+  if(flg_grd_out_2D){
+    flg_grd_out_crv=rgr->flg_crv; /* [flg] Curvilinear coordinates */
+    if(flg_grd_out_crv){
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid specified to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
+    }else{
+      long idx_tst=long_CEWI; /* [idx] Index of first latitude or longitude */
+      for(idx=0;idx<(long)grd_sz_out;idx++){
+	if(idx%lon_nbr_out == 0) idx_tst=idx;
+	if(lat_ctr_out[idx] != lat_ctr_out[idx_tst]) break;
+      } /* !rectangular */
+      if(idx != (long)grd_sz_out) flg_grd_out_crv=True; else flg_grd_out_rct=True;
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Destination grid detected to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
+    } /* !flg_grd_out_crv */
+  } /* flg_grd_out_2D */
+  
+  /* Close input netCDF files */
+  nco_close(in_id_dst);
+  nco_close(in_id_src);
+
+  /* Remove local copy of input files */
+  if(FL_RTR_RMT_LCN_DST && RM_RMT_FL_PST_PRC) (void)nco_fl_rm(fl_in_dst);
+  if(FL_RTR_RMT_LCN_SRC && RM_RMT_FL_PST_PRC) (void)nco_fl_rm(fl_in_src);
+
+  /* Copy arguments from mapfile structure to more easily recognized names */
+  long dst_grd_crn_nbr; /* [nbr] Number of corners in gridcell */
+  long dst_grd_rnk_nbr=int_CEWI; /* [nbr] Number of dimensions in grid */
+  long dst_grd_sz_nbr; /* [nbr] Number of gridcells in grid */
+  long src_grd_crn_nbr; /* [nbr] Number of corners in gridcell */
+  long src_grd_rnk_nbr=int_CEWI; /* [nbr] Number of dimensions in grid */
+  long src_grd_sz_nbr; /* [nbr] Number of gridcells in grid */
+  dst_grd_rnk_nbr=mpf.dst_grid_rank;
+  src_grd_rnk_nbr=mpf.src_grid_rank;
+  dst_grd_crn_nbr=mpf.dst_grid_corners;
+  src_grd_crn_nbr=mpf.src_grid_corners;
+  dst_grd_sz_nbr=mpf.dst_grid_size;
+  src_grd_sz_nbr=mpf.src_grid_size;
+
+  /* Set-up output file */
+  char *fl_out_tmp=NULL_CEWI;
+  char *fl_out;
+
+  int deflate; /* [flg] Turn-on deflate filter */
+  int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
+  int out_id; /* I [id] Output netCDF file ID */
+  int shuffle; /* [flg] Turn-on shuffle filter */
+
+  int num_links_id; /* [id] Number of links dimension ID */
+  int num_wgts_id; /* [id] Number of weights dimension ID */
+
+  int col_src_adr_id; /* [id] Source address (col) variable ID */
+  int row_dst_adr_id; /* [id] Destination address (row) variable ID */
+  int wgt_raw_id; /* [id] Remap matrix variable ID */
+
+  double *wgt_raw=NULL; /* [frc] Remapping weights */
+  int *col_src_adr=NULL; /* [idx] Source address (col) */
+  int *row_dst_adr=NULL; /* [idx] Destination address (row) */
+
+  nco_bool FORCE_APPEND=False; /* Option A */
+  nco_bool FORCE_OVERWRITE=True; /* Option O */
+  nco_bool RAM_CREATE=False; /* [flg] Create file in RAM */
+  nco_bool WRT_TMP_FL=False; /* [flg] Write output to temporary file */
+
+  size_t wgt_nbr=1L; /* [nbr] Number of weights */
+  size_t lnk_nbr; /* [nbr] Number of links */
+  size_t lnk_idx; /* [idx] Link index */
+
+  deflate=(int)True;
+  shuffle=NC_SHUFFLE;
+  dfl_lvl=rgr->dfl_lvl;
+  fl_out_fmt=rgr->fl_out_fmt;
+  fl_out=rgr->fl_map;
+
+  /* Define overlap mesh vertices, count links, compute overlap weights
+     This includes Mohammed Abouali code to create triangle list and Zender code to compute triangle areas */
+  (void)nco_msh_mk
+    (rgr,
+     area_in,msk_in,lat_ctr_in,lon_ctr_in,lat_crn_in,lon_crn_in,grd_sz_in,mpf.src_grid_corners,
+     area_out,msk_out,lat_ctr_out,lon_ctr_out,lat_crn_out,lon_crn_out,grd_sz_out,mpf.dst_grid_corners,
+     frc_in,frc_out,&col_src_adr,&row_dst_adr,&wgt_raw,&lnk_nbr);
+
+  if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Defining mapfile based on %li links\n",nco_prg_nm_get(),lnk_nbr);
+
+  /* Open mapfile */
+  fl_out_tmp=nco_fl_out_open(fl_out,&FORCE_APPEND,FORCE_OVERWRITE,fl_out_fmt,&bfr_sz_hnt,RAM_CREATE,RAM_OPEN,WRT_TMP_FL,&out_id);
+
+  rcd+=nco_def_dim(out_id,"dst_grid_rank",dst_grd_rnk_nbr,&dst_grid_rank_id);
+  rcd+=nco_def_dim(out_id,"n_a",src_grd_sz_nbr,&src_grid_size_id);
+  rcd+=nco_def_dim(out_id,"n_b",dst_grd_sz_nbr,&dst_grid_size_id);
+  rcd+=nco_def_dim(out_id,"n_s",lnk_nbr,&num_links_id);
+  rcd+=nco_def_dim(out_id,"num_wgts",wgt_nbr,&num_wgts_id);
+  rcd+=nco_def_dim(out_id,"nv_a",src_grd_crn_nbr,&src_grid_corners_id);
+  rcd+=nco_def_dim(out_id,"nv_b",dst_grd_crn_nbr,&dst_grid_corners_id);
+  rcd+=nco_def_dim(out_id,"src_grid_rank",src_grd_rnk_nbr,&src_grid_rank_id);
+
+  rcd+=nco_def_var(out_id,"src_grid_dims",NC_INT,dmn_nbr_1D,&src_grid_rank_id,&dmn_sz_in_int_id);
+  rcd+=nco_def_var(out_id,"dst_grid_dims",NC_INT,dmn_nbr_1D,&dst_grid_rank_id,&dmn_sz_out_int_id);
+
+  rcd+=nco_def_var(out_id,"S",crd_typ,dmn_nbr_1D,&num_links_id,&wgt_raw_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,wgt_raw_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"col",(nc_type)NC_INT,dmn_nbr_1D,&num_links_id,&col_src_adr_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,col_src_adr_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"row",(nc_type)NC_INT,dmn_nbr_1D,&num_links_id,&row_dst_adr_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,row_dst_adr_id,shuffle,deflate,dfl_lvl);
+
+  rcd+=nco_def_var(out_id,"area_a",crd_typ,dmn_nbr_1D,&src_grid_size_id,&area_in_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,area_in_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"frac_a",crd_typ,dmn_nbr_1D,&src_grid_size_id,&frc_in_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,frc_in_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"mask_a",(nc_type)NC_INT,dmn_nbr_1D,&src_grid_size_id,&msk_in_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,msk_in_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"xc_a",crd_typ,dmn_nbr_1D,&src_grid_size_id,&src_grd_ctr_lon_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,src_grd_ctr_lon_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"yc_a",crd_typ,dmn_nbr_1D,&src_grid_size_id,&src_grd_ctr_lat_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,src_grd_ctr_lat_id,shuffle,deflate,dfl_lvl);
+  dmn_ids[0]=src_grid_size_id;
+  dmn_ids[1]=src_grid_corners_id;
+  rcd+=nco_def_var(out_id,"xv_a",crd_typ,dmn_nbr_2D,dmn_ids,&src_grd_crn_lon_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,src_grd_crn_lon_id,shuffle,deflate,dfl_lvl);
+  dmn_ids[0]=src_grid_size_id;
+  dmn_ids[1]=src_grid_corners_id;
+  rcd+=nco_def_var(out_id,"yv_a",crd_typ,dmn_nbr_2D,dmn_ids,&src_grd_crn_lat_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,src_grd_crn_lat_id,shuffle,deflate,dfl_lvl);
+
+  rcd+=nco_def_var(out_id,"area_b",crd_typ,dmn_nbr_1D,&dst_grid_size_id,&area_out_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,area_out_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"frac_b",crd_typ,dmn_nbr_1D,&dst_grid_size_id,&frc_out_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,frc_out_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"mask_b",(nc_type)NC_INT,dmn_nbr_1D,&dst_grid_size_id,&msk_out_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,msk_out_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"xc_b",crd_typ,dmn_nbr_1D,&dst_grid_size_id,&dst_grd_ctr_lon_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dst_grd_ctr_lon_id,shuffle,deflate,dfl_lvl);
+  rcd+=nco_def_var(out_id,"yc_b",crd_typ,dmn_nbr_1D,&dst_grid_size_id,&dst_grd_ctr_lat_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dst_grd_ctr_lat_id,shuffle,deflate,dfl_lvl);
+  dmn_ids[0]=dst_grid_size_id;
+  dmn_ids[1]=dst_grid_corners_id;
+  rcd+=nco_def_var(out_id,"xv_b",crd_typ,dmn_nbr_2D,dmn_ids,&dst_grd_crn_lon_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dst_grd_crn_lon_id,shuffle,deflate,dfl_lvl);
+  dmn_ids[0]=dst_grid_size_id;
+  dmn_ids[1]=dst_grid_corners_id;
+  rcd+=nco_def_var(out_id,"yv_b",crd_typ,dmn_nbr_2D,dmn_ids,&dst_grd_crn_lat_id);
+  if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,dst_grd_crn_lat_id,shuffle,deflate,dfl_lvl);
+  
+  /* Define global and "units" attributes */
+  aed_sct aed_mtd;
+  char *att_nm;
+
+  att_nm=strdup("title");
+  att_val=strdup(rgr->grd_ttl);
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  att_nm=strdup("Conventions");
+  att_val=strdup("netCDF Operators (NCO) Offline Regridding Weight Generator");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  const char usr_cpp[]=TKN2SNG(USER); /* [sng] Hostname from C pre-processor */
+  att_nm=strdup("created_by");
+  att_val=strdup(usr_cpp);
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  (void)nco_hst_att_cat(out_id,rgr->cmd_ln);
+  (void)nco_vrs_att_cat(out_id);
+
+  /* Variables with units="degrees_north" */
+  att_nm=strdup("units");
+  att_val=strdup("degrees_north");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+
+  aed_mtd.var_nm="yc_a";
+  aed_mtd.id=src_grd_ctr_lat_id;
+  (void)nco_aed_prc(out_id,src_grd_ctr_lat_id,aed_mtd);
+  aed_mtd.var_nm="yv_a";
+  aed_mtd.id=src_grd_crn_lat_id;
+  (void)nco_aed_prc(out_id,src_grd_crn_lat_id,aed_mtd);
+  aed_mtd.var_nm="yc_b";
+  aed_mtd.id=dst_grd_ctr_lat_id;
+  (void)nco_aed_prc(out_id,dst_grd_ctr_lat_id,aed_mtd);
+  aed_mtd.var_nm="yv_b";
+  aed_mtd.id=dst_grd_crn_lat_id;
+  (void)nco_aed_prc(out_id,dst_grd_crn_lat_id,aed_mtd);
+
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+
+  /* Variables with units="degrees_east" */
+  att_nm=strdup("units");
+  att_val=strdup("degrees_east");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+
+  aed_mtd.var_nm="xc_a";
+  aed_mtd.id=src_grd_ctr_lon_id;
+  (void)nco_aed_prc(out_id,src_grd_ctr_lon_id,aed_mtd);
+  aed_mtd.var_nm="xv_a";
+  aed_mtd.id=src_grd_crn_lon_id;
+  (void)nco_aed_prc(out_id,src_grd_crn_lon_id,aed_mtd);
+  aed_mtd.var_nm="xc_b";
+  aed_mtd.id=dst_grd_ctr_lon_id;
+  (void)nco_aed_prc(out_id,dst_grd_ctr_lon_id,aed_mtd);
+  aed_mtd.var_nm="xv_b";
+  aed_mtd.id=dst_grd_crn_lon_id;
+  (void)nco_aed_prc(out_id,dst_grd_crn_lon_id,aed_mtd);
+
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  /* Variables with units="none" */
+  att_nm=strdup("units");
+  att_val=strdup("none");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+
+  aed_mtd.var_nm="frac_a";
+  aed_mtd.id=frc_in_id;
+  (void)nco_aed_prc(out_id,frc_in_id,aed_mtd);
+  aed_mtd.var_nm="mask_a";
+  aed_mtd.id=msk_in_id;
+  (void)nco_aed_prc(out_id,msk_in_id,aed_mtd);
+  aed_mtd.var_nm="frac_b";
+  aed_mtd.id=frc_out_id;
+  (void)nco_aed_prc(out_id,frc_out_id,aed_mtd);
+  aed_mtd.var_nm="mask_b";
+  aed_mtd.id=msk_out_id;
+  (void)nco_aed_prc(out_id,msk_out_id,aed_mtd);
+
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+
+  att_nm=strdup("units");
+  att_val=strdup("steradian");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm="area_a";
+  aed_mtd.id=area_in_id;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,area_in_id,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+
+  att_nm=strdup("units");
+  att_val=strdup("steradian");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm="area_b";
+  aed_mtd.id=area_out_id;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,area_out_id,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+
+  /* Turn-off default filling behavior to enhance efficiency */
+  nco_set_fill(out_id,NC_NOFILL,&fll_md_old);
+      
+  /* Begin data mode */
+  (void)nco_enddef(out_id);
+
+  /* Write values to mapfile */
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=mpf.src_grid_rank;
+  rcd=nco_put_vara(out_id,dmn_sz_in_int_id,dmn_srt,dmn_cnt,dmn_sz_in_int,(nc_type)NC_INT);
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=mpf.dst_grid_rank;
+  rcd=nco_put_vara(out_id,dmn_sz_out_int_id,dmn_srt,dmn_cnt,dmn_sz_out_int,(nc_type)NC_INT);
+
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=lnk_nbr;
+  rcd=nco_put_vara(out_id,wgt_raw_id,dmn_srt,dmn_cnt,wgt_raw,crd_typ);
+  rcd=nco_put_vara(out_id,col_src_adr_id,dmn_srt,dmn_cnt,col_src_adr,(nc_type)NC_INT);
+  rcd=nco_put_vara(out_id,row_dst_adr_id,dmn_srt,dmn_cnt,row_dst_adr,(nc_type)NC_INT);
+
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_in;
+  rcd=nco_put_vara(out_id,area_in_id,dmn_srt,dmn_cnt,area_in,crd_typ);
+  rcd=nco_put_vara(out_id,frc_in_id,dmn_srt,dmn_cnt,frc_in,crd_typ);
+  rcd=nco_put_vara(out_id,msk_in_id,dmn_srt,dmn_cnt,msk_in,(nc_type)NC_INT);
+  rcd=nco_put_vara(out_id,src_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_in,crd_typ);
+  rcd=nco_put_vara(out_id,src_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_in,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_in;
+  dmn_cnt[1]=mpf.src_grid_corners;
+  rcd=nco_put_vara(out_id,src_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_in,crd_typ);
+  rcd=nco_put_vara(out_id,src_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_in,crd_typ);
+  
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_out;
+  rcd=nco_put_vara(out_id,area_out_id,dmn_srt,dmn_cnt,area_out,crd_typ);
+  rcd=nco_put_vara(out_id,frc_out_id,dmn_srt,dmn_cnt,frc_out,crd_typ);
+  rcd=nco_put_vara(out_id,msk_out_id,dmn_srt,dmn_cnt,msk_out,(nc_type)NC_INT);
+  rcd=nco_put_vara(out_id,dst_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_out,crd_typ);
+  rcd=nco_put_vara(out_id,dst_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_out,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_out;
+  dmn_cnt[1]=mpf.dst_grid_corners;
+  rcd=nco_put_vara(out_id,dst_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_out,crd_typ);
+  rcd=nco_put_vara(out_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_out,crd_typ);
+  
+  /* Close input netCDF file */
+  nco_close(out_id);
+  
+  assert(rcd == NC_NOERR);
+
+  /* Clean-up dynamic memory */
+  if(dmn_cnt) dmn_cnt=(long *)nco_free(dmn_cnt);
+  if(dmn_srt) dmn_srt=(long *)nco_free(dmn_srt);
+  if(dmn_sz_in_int) dmn_sz_in_int=(int *)nco_free(dmn_sz_in_int);
+  if(dmn_sz_out_int) dmn_sz_out_int=(int *)nco_free(dmn_sz_out_int);
+
+  if(area_in) area_in=(double *)nco_free(area_in);
+  if(frc_in) frc_in=(double *)nco_free(frc_in);
+  if(msk_in) msk_in=(int *)nco_free(msk_in);
+
+  if(area_out) area_out=(double *)nco_free(area_out);
+  if(frc_out) frc_out=(double *)nco_free(frc_out);
+  if(msk_out) msk_out=(int *)nco_free(msk_out);
+
+  if(lat_ctr_in) lat_ctr_in=(double *)nco_free(lat_ctr_in);
+  if(lon_ctr_in) lon_ctr_in=(double *)nco_free(lon_ctr_in);
+  if(lat_crn_in) lat_crn_in=(double *)nco_free(lat_crn_in);
+  if(lon_crn_in) lon_crn_in=(double *)nco_free(lon_crn_in);
+  if(lat_ctr_out) lat_ctr_out=(double *)nco_free(lat_ctr_out);
+  if(lon_ctr_out) lon_ctr_out=(double *)nco_free(lon_ctr_out);
+  if(lat_crn_out) lat_crn_out=(double *)nco_free(lat_crn_out);
+  if(lon_crn_out) lon_crn_out=(double *)nco_free(lon_crn_out);
+
+  if(wgt_raw) wgt_raw=(double *)nco_free(wgt_raw);
+  if(col_src_adr) col_src_adr=(int *)nco_free(col_src_adr);
+  if(row_dst_adr) row_dst_adr=(int *)nco_free(row_dst_adr);
+
+  if(fl_in_dst) fl_in_dst=(char *)nco_free(fl_in_dst);
+  if(fl_in_src) fl_in_src=(char *)nco_free(fl_in_src);
+
+  return rcd;
+} /* !nco_map_mk() */
+
+int /* O [enm] Return code */
+nco_msh_mk /* [fnc] Compute overlap mesh and weights */
+(rgr_sct * const rgr, /* I [sct] Regridding structure */
+
+ double *area_in, /* I [sr] Area of source grid */
+ int *msk_in, /* I [flg] Mask on source grid */
+ double *lat_ctr_in, /* I [dgr] Latitude  centers of source grid */
+ double *lon_ctr_in, /* I [dgr] Longitude centers of source grid */
+ double *lat_crn_in, /* I [dgr] Latitude  corners of source grid */
+ double *lon_crn_in, /* I [dgr] Longitude corners of source grid */
+ size_t grd_sz_in, /* I [nbr] Number of elements in single layer of source grid */
+ long grd_crn_nbr_in, /* I [nbr] Maximum number of corners in source gridcell */
+
+ double *area_out, /* I [sr] Area of destination grid */
+ int *msk_out, /* I [flg] Mask on destination grid */
+ double *lat_ctr_out, /* I [dgr] Latitude  centers of destination grid */
+ double *lon_ctr_out, /* I [dgr] Longitude centers of destination grid */
+ double *lat_crn_out, /* I [dgr] Latitude  corners of destination grid */
+ double *lon_crn_out, /* I [dgr] Longitude corners of destination grid */
+ size_t grd_sz_out, /* I [nbr] Number of elements in single layer of destination grid */
+ long grd_crn_nbr_out, /* I [nbr] Maximum number of corners in destination gridcell */
+
+ double *frc_in, /* O [frc] Fraction of source grid */
+ double *frc_out, /* O [frc] Fraction of destination grid */
+ int **col_src_adr_ptr, /* O [idx] Source address (col) */
+ int **row_dst_adr_ptr, /* O [idx] Destination address (row) */
+ double **wgt_raw_ptr, /* O [frc] Remapping weights */ 
+ size_t *lnk_nbr_ptr) /* O [nbr] Number of links */
+{
+  /* Purpose: Compute overlap mesh and weights */
+  const char fnc_nm[]="nco_msh_mk()";
+
+  double *wgt_raw; /* [frc] Remapping weights */ 
+
+  double *lat_crn_vrl=NULL; /* [dgr] Latitude  corners of overlap grid */
+  double *lat_ctr_vrl=NULL_CEWI; /* [dgr] Latitude  centers of overlap grid */
+  double *lon_crn_vrl=NULL; /* [dgr] Longitude corners of overlap grid */
+  double *lon_ctr_vrl=NULL_CEWI; /* [dgr] Longitude centers of overlap grid */
+
+  int *col_src_adr; /* [idx] Source address (col) */
+  int *row_dst_adr; /* [idx] Destination address (row) */
+
+  int rcd=NCO_NOERR;
+
+  long idx; /* [idx] Counting index for unrolled grids */
+  long grd_crn_nbr_vrl; /* [nbr] Maximum number of corners in overlap polygon */
+
+  size_t lnk_nbr; /* [nbr] Number of links */
+  size_t lnk_idx; /* [idx] Link index */
+
+  /* Construct overlap mesh here
+     NB: Parallelize loop with OpenMP and/or MPI
+     Final lnk_nbr and grd_crn_nbr_vrl are known only after a full loop through input grids */
+
+  lnk_nbr=1L; /* [nbr] Number of overlap polygons */
+  grd_crn_nbr_vrl=1L; /* [nbr] Maximum number of vertices in overlap polygon */
+  
+  lat_crn_vrl=(double *)nco_malloc_dbg(lnk_nbr*grd_crn_nbr_vrl*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for overlap latitude corners");
+  lat_ctr_vrl=(double *)nco_malloc_dbg(lnk_nbr*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for overlap latitude centers");
+  lon_crn_vrl=(double *)nco_malloc_dbg(lnk_nbr*grd_crn_nbr_vrl*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for overlap longitude corners");
+  lon_ctr_vrl=(double *)nco_malloc_dbg(lnk_nbr*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for overlap longitude centers");
+
+  wgt_raw=(double *)nco_malloc_dbg(lnk_nbr*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for remapping weights");
+  col_src_adr=(int *)nco_malloc_dbg(lnk_nbr*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
+  row_dst_adr=(int *)nco_malloc_dbg(lnk_nbr*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
+
+  /* Initialize arguments before they are actually computed */
+  for(idx=0;idx<lnk_nbr;idx++) wgt_raw[idx]=0.0;
+  for(idx=0;idx<lnk_nbr;idx++) col_src_adr[idx]=-1;
+  for(idx=0;idx<lnk_nbr;idx++) row_dst_adr[idx]=-1;
+  for(idx=0;idx<grd_sz_in;idx++) frc_in[idx]=0.0;
+  for(idx=0;idx<grd_sz_out;idx++) frc_out[idx]=0.0;
+
+  if(lat_crn_vrl) lat_crn_vrl=(double *)nco_free(lat_crn_vrl);
+  if(lat_ctr_vrl) lat_ctr_vrl=(double *)nco_free(lat_ctr_vrl);
+  if(lon_crn_vrl) lon_crn_vrl=(double *)nco_free(lon_crn_vrl);
+  if(lon_ctr_vrl) lon_ctr_vrl=(double *)nco_free(lon_ctr_vrl);
+
+  *wgt_raw_ptr=wgt_raw;
+  *col_src_adr_ptr=col_src_adr;
+  *row_dst_adr_ptr=row_dst_adr;
+  *lnk_nbr_ptr=lnk_nbr;
+
+  return rcd;
+} /* !nco_msh_mk() */
diff --git a/src/nco/nco_map.h b/src/nco/nco_map.h
new file mode 100644
index 0000000..5cffad3
--- /dev/null
+++ b/src/nco/nco_map.h
@@ -0,0 +1,75 @@
+/* $Header$ */
+
+/* Purpose: Description (definition) of map-generation functions */
+
+/* Copyright (C) 2015--2017 Charlie Zender
+   This file is part of NCO, the netCDF Operators. NCO is free software.
+   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 */
+
+/* Usage:
+   #include "nco_map.h" *//* Map generation */
+
+#ifndef NCO_MAP_H
+#define NCO_MAP_H
+
+/* Standard header files */
+#include <limits.h> /* INT_MAX, LONG_MAX */
+#include <math.h> /* sin cos cos sin 3.14159 */
+#include <stdio.h> /* stderr, FILE, NULL, printf */
+#include <stdlib.h> /* atof, atoi, malloc, getopt */
+
+/* 3rd party vendors */
+#include <netcdf.h> /* netCDF definitions and C library */
+#include "nco_netcdf.h" /* NCO wrappers for netCDF C library */
+
+/* Personal headers */
+#include "nco.h" /* netCDF Operator (NCO) definitions */
+#include "nco_mmr.h" /* Memory management */
+#include "nco_omp.h" /* OpenMP utilities */
+#include "nco_rgr.h" /* Regridding */
+#include "nco_sld.h" /* Swath-Like Data */
+#include "nco_sng_utl.h" /* String utilities */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+  int /* O [enm] Return code */
+  nco_map_mk /* [fnc] Create ESMF-format map file */
+  (rgr_sct * const rgr); /* I/O [sct] Regridding structure */
+
+  int /* O [enm] Return code */
+  nco_msh_mk /* [fnc] Compute overlap mesh and weights */
+  (rgr_sct * const rgr, /* I [sct] Regridding structure */
+   
+   double *area_in, /* I [sr] Area of source grid */
+   int *msk_in, /* I [flg] Mask on source grid */
+   double *lat_ctr_in, /* I [dgr] Latitude  centers of source grid */
+   double *lon_ctr_in, /* I [dgr] Longitude centers of source grid */
+   double *lat_crn_in, /* I [dgr] Latitude  corners of source grid */
+   double *lon_crn_in, /* I [dgr] Longitude corners of source grid */
+   size_t grd_sz_in, /* I [nbr] Number of elements in single layer of source grid */
+   long grd_crn_nbr_in, /* I [nbr] Maximum number of corners in source gridcell */
+   
+   double *area_out, /* I [sr] Area of destination grid */
+   int *msk_out, /* I [flg] Mask on destination grid */
+   double *lat_ctr_out, /* I [dgr] Latitude  centers of destination grid */
+   double *lon_ctr_out, /* I [dgr] Longitude centers of destination grid */
+   double *lat_crn_out, /* I [dgr] Latitude  corners of destination grid */
+   double *lon_crn_out, /* I [dgr] Longitude corners of destination grid */
+   size_t grd_sz_out, /* I [nbr] Number of elements in single layer of destination grid */
+   long grd_crn_nbr_out, /* I [nbr] Maximum number of corners in destination gridcell */
+   
+   double *frc_in, /* O [frc] Fraction of source grid */
+   double *frc_out, /* O [frc] Fraction of destination grid */
+   int **col_src_adr_ptr, /* O [idx] Source address (col) */
+   int **row_dst_adr_ptr, /* O [idx] Destination address (row) */
+   double **wgt_raw_ptr, /* O [frc] Remapping weights */ 
+   size_t *lnk_nbr_ptr); /* O [nbr] Number of links */
+  
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif /* __cplusplus */
+
+#endif /* NCO_MAP_H */
diff --git a/src/nco/nco_mmr.c b/src/nco/nco_mmr.c
index 5b4442b..5454c41 100644
--- a/src/nco/nco_mmr.c
+++ b/src/nco/nco_mmr.c
@@ -199,7 +199,7 @@ nco_malloc_err_hnt_prn /* [fnc] Explain meaning and workarounds for malloc() fai
 (void)
 {
   /* Purpose: Explain meaning and workarounds for malloc() failures */
-  (void)fprintf(stdout,"%s: INFO NCO has reported a malloc() failure. malloc() failures usually indicate that your machine has less free memory (RAM+swap) than the requested amount. As such, malloc() failures result from the physical limitations imposed by your hardware. Read http://nco.sf.net/nco.html#mmr for a description of NCO memory usage. The likiest case is that this problem is caused by inadequate RAM on your system, and is not an NCO bug. If so, there are two potential workaroun [...]
+  (void)fprintf(stdout,"%s: INFO NCO has reported a malloc() failure. malloc() failures usually indicate that your machine has less free memory (RAM+swap) than the requested amount. As such, malloc() failures result from the physical limitations imposed by your hardware. Read http://nco.sf.net/nco.html#mmr for a description of NCO memory usage. The likeliest case is that this problem is caused by inadequate RAM on your system, and is not an NCO bug. If so, there are two potential workaro [...]
   if(nco_prg_id_get() == ncap) (void)fprintf(stdout,"Large tasks may uncover memory leaks in NCO. ncap2 scripts are completely dynamic and may be of arbitrary length and complexity. A script that contains many thousands of operations may uncover a slow memory leak even though each single operation consumes little additional memory. Memory leaks are usually identifiable by their memory usage signature. Leaks cause peak memory usage to increase monotonically with time regardless of script  [...]
 } /* nco_malloc_err_hnt_prn() */
 
diff --git a/src/nco/nco_netcdf.c b/src/nco/nco_netcdf.c
index 34f34de..15be183 100644
--- a/src/nco/nco_netcdf.c
+++ b/src/nco/nco_netcdf.c
@@ -94,10 +94,10 @@ nco_err_exit /* [fnc] Print netCDF error message, routine name, then exit */
 #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/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. [...]
+     (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 occur when attempting to copy or aggregate input files together into an output file that exceeds the per-file capacity of the output file format, and when trying to copy, aggregate, or define individual variables that exceed the per-variable constraints of the output file format. The per-file limit of all netCDF formats is not less than 8 EiB on mode [...]
+  case NC_EVARSIZE: (void)fprintf(stdout,"ERROR NC_EVARSIZE One or more variable sizes violate format constraints\nHINT: NC_EVARSIZE errors occur when attempting to copy or aggregate input files together into an output file that exceeds the per-file capacity of the output file format, and when trying to copy, aggregate, or define individual variables that exceed the per-variable constraints of the output file format. The per-file limit of all netCDF formats is not less than 8 EiB on mode [...]
   } /* end switch */
 
   /* Print NCO-generated error message, if any */
@@ -898,7 +898,9 @@ nco_close(const int nc_id)
   /* Purpose: Wrapper for nc_close() */
   const char fnc_nm[]="nco_close()";
   int rcd=NC_NOERR;
-#if NC_LIB_VERSION >= 440
+  /* 20171108: Activate this check by building NCO with, e.g., CPPFLAGS='-DNCO_CDF5_BUG_CHK' ./configure ... */
+#ifdef NCO_CDF5_BUG_CHK
+# if NC_LIB_VERSION >= 440
   /* 20170912 Diagnose whether file may be (for input files) or is (for output files) infected by CDF5 bug */
   int fl_fmt; /* [enm] File format */
   int fl_fmt_xtn; /* [enm] Extended file format */
@@ -914,6 +916,7 @@ nco_close(const int nc_id)
     int bug_nbr=0;
     int dmn_idx;
     int dmn_nbr;
+    int FIRST_WARNING=1;
     int var_idx;
     int var_nbr;
     nc_type var_typ;
@@ -923,7 +926,6 @@ nco_close(const int nc_id)
     rcd=nc_inq_path(nc_id,&pathlen,NULL);
     path=(char *)malloc(pathlen*sizeof(char));
     rcd=nc_inq_path(nc_id,NULL,path);
-    (void)fprintf(stdout,"INFO: %s currently closing and sniffing-around for corruption in CDF5 file %s\n",fnc_nm,path);
     //(void)fprintf(stdout,"DEBUG: %s reports NC_LIB_VERSION = %d.\n",fnc_nm,NC_LIB_VERSION);
     //(void)fprintf(stdout,"DEBUG: %s reports file format and extended format are %d = %s and %d = %s, respectively\n",fnc_nm,fl_fmt,nco_fmt_sng(fl_fmt),fl_fmt_xtn,nco_fmt_xtn_sng(fl_fmt_xtn));
     //(void)fprintf(stdout,"DEBUG: %s reports file mode is %o (octal) = %d (decimal) = %04x (hex)\n",fnc_nm,mode,(unsigned)mode,(unsigned)mode);
@@ -939,6 +941,10 @@ nco_close(const int nc_id)
       rcd=nc_inq_vartype(nc_id,var_id[var_idx],&var_typ);
       var_sz*=nco_typ_lng(var_typ);
       if(var_sz > 4ULL*1073741824ULL){ /* 4 GiB */
+	if(FIRST_WARNING){
+	  (void)fprintf(stdout,"INFO: %s currently closing and sniffing-around for corruption in CDF5 file %s\n",fnc_nm,path);
+	  FIRST_WARNING=0;
+	} /* !FIRST_WARNING */
 	rcd=nc_inq_varname(nc_id,var_id[var_idx],var_nm);
 	(void)fprintf(stdout,"WARNING: %s reports variable %s is \"large\" (%lu B =~ %lu GiB > 4294967296 B = 4 GiB)\n",fnc_nm,var_nm,(unsigned long)var_sz,(unsigned long)(1.0*var_sz/1073741824UL));
 	bug_idx=var_idx;
@@ -949,13 +955,14 @@ nco_close(const int nc_id)
     if(bug_nbr > 0){
       (void)fprintf(stdout,"WARNING: %s reports total number of \"large\" (> 4 GiB) variables in this CDF5 file is %d\n",fnc_nm,bug_nbr);
       if(bug_nbr > 1 || bug_idx != var_nbr-1){
-	(void)fprintf(stdout,"WARNING: %s reports at least one \"large\" (> 4 GiB) variable in this CDF5 file is not the last variable defined. Writing CDF5 files with large variables is buggy in netCDF library versions 4.4.0-4.4.1 unless there is only one such \"large\" variable and it is the last to be defined. Input datasets (that NCO reads) that were originally written by PnetCDF are likely fine (because PnetCDF writes CDF5 through a different mechanism than serial programs like NCO's write [...]
+	(void)fprintf(stdout,"WARNING: %s reports at least one \"large\" (> 4 GiB) variable in this CDF5 file is not the last variable defined. Writing CDF5 files with large variables is buggy in netCDF library versions 4.4.0-4.5.0 unless there is only one such \"large\" variable and it is the last to be defined. Input datasets (that NCO reads) that were originally written by PnetCDF are likely fine (because PnetCDF writes CDF5 through a different mechanism than serial programs like NCO's write [...]
       }else{
-	(void)fprintf(stdout,"WARNING: Congratulations! %s reports that the only \"large\" (> 4 GiB) variable in this CDF5 file appears to be the last variable defined. Writing CDF5 files with large variables is buggy in netCDF library versions 4.4.0-4.4.1 (this NCO is linked to netCDF library version %d) unless there is only one such \"large\" variable and it is the last to be defined. Therefore this file may be fine, i.e., not corrupted by this nasty netCDF CDF5 bug: https://github.com/Unidat [...]
+	(void)fprintf(stdout,"WARNING: Congratulations! %s reports that the only \"large\" (> 4 GiB) variable in this CDF5 file appears to be the last variable defined. Writing CDF5 files with large variables is buggy in netCDF library versions 4.4.0-4.5.0 (this NCO is linked to netCDF library version %d) unless there is only one such \"large\" variable and it is the last to be defined. Therefore this file may be fine, i.e., not corrupted by this nasty netCDF CDF5 bug: https://github.com/Unidat [...]
       } /* !bug_idx */
     } /* !bug_nbr */
   } /* !CDF5 */
-#endif /* !NC_LIB_VERSION */
+# endif /* !NC_LIB_VERSION */
+#endif /* !NCO_CDF5_BUG_CHK */
   rcd=nc_close(nc_id);
   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
@@ -1824,6 +1831,7 @@ int
 nco_get_var(const int nc_id,const int var_id,void * const vp,const nc_type type)
 {
   /* Purpose: Wrapper for nc_get_var_*() */
+  const char fnc_nm[]="nco_get_var()";
   int rcd=NC_NOERR;
   switch(type){
   case NC_FLOAT: rcd=nc_get_var_float(nc_id,var_id,(float *)vp); break;
@@ -1842,7 +1850,12 @@ nco_get_var(const int nc_id,const int var_id,void * const vp,const nc_type type)
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_var()");
+  if(rcd != NC_NOERR){
+    char var_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_varname(nc_id,var_id,var_nm);
+    (void)fprintf(stdout,"ERROR: %s failed to nc_get_var() variable \"%s\"\n",fnc_nm,var_nm);
+  } /* endif */
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_get_var */
 
@@ -1884,6 +1897,7 @@ int
 nco_get_var1(const int nc_id,const int var_id,const long * const srt,void * const vp,const nc_type var_typ)
 {
   /* Purpose: Wrapper for nc_get_var1_*() */
+  const char fnc_nm[]="nco_get_var1()";
   int rcd=NC_NOERR;
   switch(var_typ){
   case NC_FLOAT: rcd=nc_get_var1_float(nc_id,var_id,(const size_t *)srt,(float *)vp); break;
@@ -1902,7 +1916,12 @@ nco_get_var1(const int nc_id,const int var_id,const long * const srt,void * cons
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_var1()");
+  if(rcd != NC_NOERR){
+    char var_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_varname(nc_id,var_id,var_nm);
+    (void)fprintf(stdout,"ERROR: %s failed to nc_get_var1() variable \"%s\"\n",fnc_nm,var_nm);
+  } /* endif */
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_get_var1 */
 
@@ -1952,7 +1971,7 @@ nco_put_var1(const int nc_id,const int var_id,const long * const srt,const void
     (void)nco_inq_varname(nc_id,var_id,var_nm);
     (void)fprintf(stdout,"ERROR: %s failed to nc_put_var1() variable \"%s\"\n",fnc_nm,var_nm);
   } /* endif */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_var1()");
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_put_var1 */
 
@@ -1960,6 +1979,7 @@ int
 nco_get_vara(const int nc_id,const int var_id,const long * const srt,const long * const cnt,void * const vp,const nc_type type)
 {
   /* Purpose: Wrapper for nc_get_vara_*() */
+  const char fnc_nm[]="nco_get_vara()";
   int rcd=NC_NOERR;
   switch(type){
   case NC_FLOAT: rcd=nc_get_vara_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(float *)vp); break;
@@ -1978,7 +1998,12 @@ nco_get_vara(const int nc_id,const int var_id,const long * const srt,const long
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_vara()");
+  if(rcd != NC_NOERR){
+    char var_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_varname(nc_id,var_id,var_nm);
+    (void)fprintf(stdout,"ERROR: %s failed to nc_get_vara() variable \"%s\"\n",fnc_nm,var_nm);
+  } /* endif */
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_get_vara */
 
@@ -2019,6 +2044,7 @@ int
 nco_get_vars(const int nc_id,const int var_id,const long * const srt,const long * const cnt,const long * const srd,void * const vp,const nc_type type)
 {
   /* Purpose: Wrapper for nc_get_vars_*() */
+  const char fnc_nm[]="nco_get_vars()";
   int rcd=NC_NOERR;
   switch(type){
   case NC_FLOAT: rcd=nc_get_vars_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(float *)vp); break;
@@ -2037,7 +2063,12 @@ nco_get_vars(const int nc_id,const int var_id,const long * const srt,const long
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_vars()");
+  if(rcd != NC_NOERR){
+    char var_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_varname(nc_id,var_id,var_nm);
+    (void)fprintf(stdout,"ERROR: %s failed to nc_get_vars() variable \"%s\"\n",fnc_nm,var_nm);
+  } /* endif */
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_get_vars */
 
@@ -2065,7 +2096,12 @@ nco_put_vars(const int nc_id,const int var_id,const long * const srt,const long
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
-  if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_vars()");
+  if(rcd != NC_NOERR){
+    char var_nm[NC_MAX_NAME+1L];
+    (void)nco_inq_varname(nc_id,var_id,var_nm);
+    (void)fprintf(stdout,"ERROR: %s failed to nc_put_vars() variable \"%s\"\n",fnc_nm,var_nm);
+  } /* endif */
+  if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
 } /* end nco_put_vars */
 
@@ -2288,11 +2324,11 @@ 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 */
+  /* 20170811: netCDF 4.5.0-development enforced 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);
+    (void)fprintf(stdout,"WARNING: %s received NC_EGLOBAL error writing attribute \"%s\" to metadata for group \"%s\". netCDF 4.5.0-development forbids writing the _FillValue attribute to global or group metadata, 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()");
diff --git a/src/nco/nco_ppc.c b/src/nco/nco_ppc.c
index 2860e90..9fe3b8f 100644
--- a/src/nco/nco_ppc.c
+++ b/src/nco/nco_ppc.c
@@ -781,7 +781,7 @@ nco_ppc_bitmask_scl /* [fnc] Round input value significand by specified number o
 {
   /* Purpose: Mask-out bit_xpl_nbr_zro least most significant bits of a scalar double precision value
      Code originally from nco_ppc_bitmask() (bitmasking is my signature move)
-     Code used in nco_rgr_map() when diagnosing whether quadrature weights properly normalized */
+     Code used in nco_rgr_wgt() when diagnosing whether quadrature weights properly normalized */
 
   const int bit_xpl_nbr_sgn_dbl=53; /* [nbr] Bits 0-52 of DP significands are explicit. Bit 53 is implicit. */
   double val_rnd; /* [frc] Rounded version of exact value */
diff --git a/src/nco/nco_rgr.c b/src/nco/nco_rgr.c
index d3a669d..33de13d 100644
--- a/src/nco/nco_rgr.c
+++ b/src/nco/nco_rgr.c
@@ -19,33 +19,35 @@ nco_rgr_ctl /* [fnc] Control regridding logic */
   const char fnc_nm[]="nco_rgr_ctl()";
 
   nco_bool flg_grd=False; /* [flg] Create SCRIP-format grid file */
+  nco_bool flg_map=False; /* [flg] Create ESMF-format mapfile */
   nco_bool flg_nfr=False; /* [flg] Infer SCRIP-format grid file */
-  nco_bool flg_map=False; /* [flg] Regrid with external weights */
-  nco_bool flg_smf=False; /* [flg] ESMF regridding */
-  nco_bool flg_tps=False; /* [flg] Tempest regridding */
+  nco_bool flg_smf=False; /* [flg] ESMF regridding (unused) */
+  nco_bool flg_tps=False; /* [flg] Tempest regridding (unused) */
+  nco_bool flg_wgt=False; /* [flg] Regrid with external weights */
 
   /* Main control branching occurs here
      Branching complexity and utility will increase as regridding features are added */
   if(rgr->flg_grd) flg_grd=True;
-
+  if(rgr->flg_grd_src && rgr->flg_grd_dst && rgr->flg_wgt) flg_map=True;
   if(rgr->flg_nfr) flg_nfr=True;
-  if(rgr->flg_map) flg_map=True;
-  if(rgr->flg_grd_src && rgr->flg_grd_dst) flg_smf=True;
-  if(rgr->drc_tps && !flg_map) flg_tps=True;
-  assert(!(flg_smf && flg_map));
-  assert(!(flg_smf && flg_tps));
-  assert(!(flg_map && flg_tps));
+  if(rgr->flg_wgt && !(rgr->flg_grd_src && rgr->flg_grd_dst)) flg_wgt=True;
+  assert(!flg_smf);
+  assert(!flg_tps);
   
   /* Create SCRIP-format grid file */
   if(flg_grd) rcd=nco_grd_mk(rgr);
 
-  /* Infer SCRIP-format grid file */
+  /* Create ESMF-format map file */
+  if(flg_map) rcd=nco_map_mk(rgr);
+
+  /* Infer SCRIP-format grid file from data file */
   if(flg_nfr) rcd=nco_grd_nfr(rgr);
 
-  /* Regrid using external mapping weights */
-  if(flg_map) rcd=nco_rgr_map(rgr,trv_tbl);
+  /* Regrid data file using weights from mapping file */
+  if(flg_wgt) rcd=nco_rgr_wgt(rgr,trv_tbl);
 
-  /* Regrid using ESMF library */
+  /* Regrid using ESMF library
+     20150701: On-line weight generation with ESMF never worked well and was abandoned */
   if(flg_smf){
 #ifdef ENABLE_ESMF
     (void)fprintf(stderr,"%s: %s calling nco_rgr_esmf() to generate and apply regridding map\n",nco_prg_nm_get(),fnc_nm);
@@ -167,7 +169,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
   rgr->fl_out=rgr_out; /* [sng] File containing regridded fields */
   rgr->fl_out_tmp=NULL_CEWI; /* [sng] Temporary file containing regridded fields */
 
-  rgr->flg_map= rgr_map ? True : False; /* [flg] User-specified mapping weights */
+  rgr->flg_wgt= rgr_map ? True : False; /* [flg] User-specified mapping weights */
   rgr->fl_map=rgr_map; /* [sng] File containing mapping weights from source to destination grid */
 
   rgr->var_nm=rgr_var; /* [sng] Variable for special regridding treatment */
@@ -577,7 +579,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
 } /* end nco_rgr_ini() */
   
 int /* O [enm] Return code */
-nco_rgr_map /* [fnc] Regrid with external weights */
+nco_rgr_wgt /* [fnc] Regrid with external weights */
 (rgr_sct * const rgr, /* I/O [sct] Regridding structure */
  trv_tbl_sct * const trv_tbl) /* I/O [sct] Traversal Table */
 {
@@ -649,7 +651,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      Sample regrid T42->POP43, SCRIP:
      ncks -O --map=${DATA}/scrip/rmp_T42_to_POP43_conserv.nc ${DATA}/rgr/essgcm14_clm.nc ~/foo.nc */
 
-  const char fnc_nm[]="nco_rgr_map()"; /* [sng] Function name */
+  const char fnc_nm[]="nco_rgr_wgt()"; /* [sng] Function name */
 
   char *fl_in;
   char *fl_pth_lcl=NULL;
@@ -657,20 +659,21 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   const double rdn2dgr=180.0/M_PI;
   const double dgr2rdn=M_PI/180.0;
   const double eps_rlt=1.0e-14; /* [frc] Round-off error tolerance */
+
   double lat_wgt_ttl=0.0; /* [frc] Actual sum of quadrature weights */
   double area_out_ttl=0.0; /* [frc] Exact sum of area */
 
+  int dfl_lvl=NCO_DFL_LVL_UNDEFINED; /* [enm] Deflate level */
+  int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
+  int fll_md_old; /* [enm] Old fill mode */
   int in_id; /* I [id] Input netCDF file ID */
-  int out_id; /* I [id] Output netCDF file ID */
   int md_open; /* [enm] Mode flag for nc_open() call */
+  int out_id; /* I [id] Output netCDF file ID */
   int rcd=NC_NOERR;
 
-  int dfl_lvl=NCO_DFL_LVL_UNDEFINED; /* [enm] Deflate level */
   int dst_grid_corners_id; /* [id] Destination grid corners dimension ID */
   int dst_grid_rank_id; /* [id] Destination grid rank dimension ID */
   int dst_grid_size_id; /* [id] Destination grid size dimension ID */
-  int fl_out_fmt=NCO_FORMAT_UNDEFINED; /* [enm] Output file format */
-  int fll_md_old; /* [enm] Old fill mode */
   int num_links_id; /* [id] Number of links dimension ID */
   int num_wgts_id; /* [id] Number of weights dimension ID */
   int src_grid_corners_id; /* [id] Source grid corners dimension ID */
@@ -693,7 +696,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   nco_grd_lat_typ_enm nco_grd_lat_typ=nco_grd_lat_nil; /* [enm] Latitude grid-type enum */
   nco_grd_lon_typ_enm nco_grd_lon_typ=nco_grd_lon_nil; /* [enm] Longitude grid-type enum */
 
-  nco_mpf_sct rgr_map;
+  nco_mpf_sct mpf;
 
   size_t bfr_sz_hnt=NC_SIZEHINT_DEFAULT; /* [B] Buffer size hint */
   
@@ -799,25 +802,25 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* end switch */
 
   /* Use dimension IDs to get dimension sizes */
-  rcd+=nco_inq_dimlen(in_id,num_links_id,&rgr_map.num_links);
+  rcd+=nco_inq_dimlen(in_id,num_links_id,&mpf.num_links);
   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);
+    rcd+=nco_inq_dimlen(in_id,src_grid_size_id,&mpf.src_grid_size);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_size_id,&mpf.dst_grid_size);
+    rcd+=nco_inq_dimlen(in_id,src_grid_corners_id,&mpf.src_grid_corners);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_corners_id,&mpf.dst_grid_corners);
+    rcd+=nco_inq_dimlen(in_id,src_grid_rank_id,&mpf.src_grid_rank);
+    rcd+=nco_inq_dimlen(in_id,dst_grid_rank_id,&mpf.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);
+    if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest) mpf.num_wgts=int_CEWI; else rcd+=nco_inq_dimlen(in_id,num_wgts_id,&mpf.num_wgts); 
+    assert(mpf.src_grid_size < INT_MAX && mpf.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;
+    mpf.src_grid_size=long_CEWI;
+    mpf.dst_grid_size=long_CEWI;
+    mpf.src_grid_corners=long_CEWI;
+    mpf.dst_grid_corners=long_CEWI;
+    mpf.src_grid_rank=long_CEWI;
+    mpf.dst_grid_rank=long_CEWI;
+    mpf.num_wgts=int_CEWI;
   } /* !ESMF_weight_only */
   
   cnv_sng=strdup("normalization");
@@ -863,7 +866,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   if(nco_dbg_lvl_get() >= nco_dbg_scl){
     (void)fprintf(stderr,"%s: INFO %s regridding input metadata and grid sizes: ",nco_prg_nm_get(),fnc_nm);
-    (void)fprintf(stderr,"mapfile_generator = %s, map_method = %s, normalization = %s, src_grid_size = n_a = %li, dst_grid_size = n_b = %li, src_grid_corners = nv_a = %li, dst_grid_corners = nv_b = %li, src_grid_rank = %li, dst_grid_rank = %li, num_links = n_s = %li, num_wgts = %li\n",nco_rgr_mpf_sng(nco_rgr_mpf_typ),nco_rgr_mth_sng(nco_rgr_mth_typ),nco_rgr_nrm_sng(nco_rgr_nrm_typ),rgr_map.src_grid_size,rgr_map.dst_grid_size,rgr_map.src_grid_corners,rgr_map.dst_grid_corners,rgr_map.src_g [...]
+    (void)fprintf(stderr,"mapfile_generator = %s, map_method = %s, normalization = %s, src_grid_size = n_a = %li, dst_grid_size = n_b = %li, src_grid_corners = nv_a = %li, dst_grid_corners = nv_b = %li, src_grid_rank = %li, dst_grid_rank = %li, num_links = n_s = %li, num_wgts = %li\n",nco_rgr_mpf_sng(nco_rgr_mpf_typ),nco_rgr_mth_sng(nco_rgr_mth_typ),nco_rgr_nrm_sng(nco_rgr_nrm_typ),mpf.src_grid_size,mpf.dst_grid_size,mpf.src_grid_corners,mpf.dst_grid_corners,mpf.src_grid_rank,mpf.dst_gri [...]
   } /* endif dbg */
   if(nco_rgr_nrm_typ == nco_rgr_nrm_none){
     (void)fprintf(stdout,"%s: ERROR %s reports requested normalization type = %s is not yet supported. Specifically, masks specified by a mask variable (dst_grid_imask,mask_b) are ignored. More specifically, any destination mask information is assumed to be built into the weight array so that no source points will contribute to masked locations. Talk to Charlie if you want this changed.\n",nco_prg_nm_get(),fnc_nm,nco_rgr_nrm_sng(nco_rgr_nrm_typ));
@@ -875,10 +878,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   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;
-  if(rgr_map.src_grid_rank == 2 && rgr_map.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_2D_to_1D;
-  if(rgr_map.src_grid_rank == 2 && rgr_map.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_2D_to_2D;
+  if(mpf.src_grid_rank == 1 && mpf.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_1D_to_1D;
+  if(mpf.src_grid_rank == 1 && mpf.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_1D_to_2D;
+  if(mpf.src_grid_rank == 2 && mpf.dst_grid_rank == 1) nco_rgr_typ=nco_rgr_grd_2D_to_1D;
+  if(mpf.src_grid_rank == 2 && mpf.dst_grid_rank == 2) nco_rgr_typ=nco_rgr_grd_2D_to_2D;
   assert(nco_rgr_typ != nco_rgr_grd_nil);
   /* Save typing later */
   nco_bool flg_grd_in_1D=False;
@@ -1036,35 +1039,35 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   long *dmn_srd=NULL;
   long idx; /* [idx] Counting index for unrolled grids */
     
-  /* Allocate space to hold dimension metadata for rectangular destination grid */
+  /* Allocate space to hold dimension metadata for destination grid */
   dmn_srt=(long *)nco_malloc(dmn_nbr_grd_max*sizeof(long));
   dmn_cnt=(long *)nco_malloc(dmn_nbr_grd_max*sizeof(long));
   dmn_srd=(long *)nco_malloc(dmn_nbr_grd_max*sizeof(long));
 
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.src_grid_rank;
-  dmn_sz_in_int=(int *)nco_malloc(rgr_map.src_grid_rank*nco_typ_lng((nc_type)NC_INT));
+  dmn_cnt[0]=mpf.src_grid_rank;
+  dmn_sz_in_int=(int *)nco_malloc(mpf.src_grid_rank*nco_typ_lng((nc_type)NC_INT));
   rcd=nco_get_vara(in_id,dmn_sz_in_int_id,dmn_srt,dmn_cnt,dmn_sz_in_int,(nc_type)NC_INT);
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.dst_grid_rank;
-  dmn_sz_out_int=(int *)nco_malloc(rgr_map.dst_grid_rank*nco_typ_lng((nc_type)NC_INT));
+  dmn_cnt[0]=mpf.dst_grid_rank;
+  dmn_sz_out_int=(int *)nco_malloc(mpf.dst_grid_rank*nco_typ_lng((nc_type)NC_INT));
   rcd=nco_get_vara(in_id,dmn_sz_out_int_id,dmn_srt,dmn_cnt,dmn_sz_out_int,(nc_type)NC_INT);
 
   /* Check-for and workaround faulty Tempest and MPAS-O/I grid sizes */
-  if(flg_grd_in_1D && (rgr_map.src_grid_size != dmn_sz_in_int[0])){
-    (void)fprintf(stdout,"%s: INFO %s reports input grid dimension sizes disagree: rgr_map.src_grid_size = %ld != %d = dmn_sz_in[0]. Problem may be caused by incorrect src_grid_dims variable. This is a known issue with some TempestRemap mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.src_grid_size,dmn_sz_in_int[0]);
-      dmn_sz_in_int[0]=rgr_map.src_grid_size;
+  if(flg_grd_in_1D && (mpf.src_grid_size != dmn_sz_in_int[0])){
+    (void)fprintf(stdout,"%s: INFO %s reports input grid dimension sizes disagree: mpf.src_grid_size = %ld != %d = dmn_sz_in[0]. Problem may be caused by incorrect src_grid_dims variable. This is a known issue with some TempestRemap mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,mpf.src_grid_size,dmn_sz_in_int[0]);
+      dmn_sz_in_int[0]=mpf.src_grid_size;
   } /* !bug */
-  if(flg_grd_out_1D && (rgr_map.dst_grid_size != dmn_sz_out_int[0])){
-    (void)fprintf(stdout,"%s: INFO %s reports output grid dimension sizes disagree: rgr_map.dst_grid_size = %ld != %d = dmn_sz_out[0]. Problem may be caused by incorrect dst_grid_dims variable. This is a known issue with some TempestRemap mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.dst_grid_size,dmn_sz_out_int[0]);
-    dmn_sz_out_int[0]=rgr_map.dst_grid_size;
+  if(flg_grd_out_1D && (mpf.dst_grid_size != dmn_sz_out_int[0])){
+    (void)fprintf(stdout,"%s: INFO %s reports output grid dimension sizes disagree: mpf.dst_grid_size = %ld != %d = dmn_sz_out[0]. Problem may be caused by incorrect dst_grid_dims variable. This is a known issue with some TempestRemap mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. This problem can be safely ignored if workaround succeeds. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,mpf.dst_grid_size,dmn_sz_out_int[0]);
+    dmn_sz_out_int[0]=mpf.dst_grid_size;
   } /* !bug */
  
   long col_nbr_in; /* [idx] Number of columns in source grid */
   long lon_nbr_in; /* [idx] Number of longitudes in rectangular source grid */
   long lat_nbr_in; /* [idx] Number of latitudes  in rectangular source grid */
-  const size_t grd_sz_in=rgr_map.src_grid_size; /* [nbr] Number of elements in single layer of input grid */
-  const size_t grd_sz_out=rgr_map.dst_grid_size; /* [nbr] Number of elements in single layer of output grid */
+  const size_t grd_sz_in=mpf.src_grid_size; /* [nbr] Number of elements in single layer of input grid */
+  const size_t grd_sz_out=mpf.dst_grid_size; /* [nbr] Number of elements in single layer of output grid */
   if(flg_grd_in_1D){
     col_nbr_in=dmn_sz_in_int[0];
     lon_nbr_in=dmn_sz_in_int[0];
@@ -1085,7 +1088,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   long slat_nbr_out=long_CEWI; /* [nbr] Number of latitudes in staggered FV grid destination grid */
   long slon_nbr_out=long_CEWI; /* [nbr] Number of longitudes in staggered FV grid destination grid */
   if(flg_grd_out_1D){
-    bnd_nbr_out=rgr_map.dst_grid_corners;
+    bnd_nbr_out=mpf.dst_grid_corners;
     col_nbr_out=dmn_sz_out_int[0];
     lat_nbr_out=dmn_sz_out_int[0];
     lon_nbr_out=dmn_sz_out_int[0];
@@ -1122,8 +1125,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(flg_grd_out_2D){
     lon_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
     lat_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
-    lon_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
-    lat_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
+    lon_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
+    lat_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
 
     dmn_srt[0]=0L;
     dmn_cnt[0]=grd_sz_out;
@@ -1131,11 +1134,11 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd=nco_get_vara(in_id,dst_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_out,crd_typ_out);
     dmn_srt[0]=dmn_srt[1]=0L;
     dmn_cnt[0]=grd_sz_out;
-    dmn_cnt[1]=rgr_map.dst_grid_corners;
+    dmn_cnt[1]=mpf.dst_grid_corners;
     rcd=nco_get_vara(in_id,dst_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_out,crd_typ_out);
     rcd=nco_get_vara(in_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_out,crd_typ_out);
 
-    /* User may specify curvilinear grid (with --rgr crv). If not specified, manually test output grid for curvilinearity... */
+    /* User may specify curvilinear grid (with --rgr crv). Otherwise, manually test for curvilinear source grid. */
     flg_grd_out_crv=rgr->flg_crv; /* [flg] Curvilinear coordinates */
     if(flg_grd_out_crv){
       if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid specified to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
@@ -1151,7 +1154,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid detected to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
     } /* !flg_grd_out_crv */
 
-    if(flg_grd_out_crv) bnd_nbr_out=rgr_map.dst_grid_corners;
+    if(flg_grd_out_crv) bnd_nbr_out=mpf.dst_grid_corners;
     if(flg_grd_out_rct) bnd_nbr_out=2; /* NB: Assumes rectangular latitude and longitude and is invalid for other quadrilaterals */
   } /* !flg_grd_out_2D */
 
@@ -1175,8 +1178,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     if(lon_crn_out) lon_crn_out=(double *)nco_free(lon_crn_out);
     lon_ctr_out=(double *)nco_malloc(lon_nbr_out*nco_typ_lng(crd_typ_out));
     lat_ctr_out=(double *)nco_malloc(lat_nbr_out*nco_typ_lng(crd_typ_out));
-    lon_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*lon_nbr_out*nco_typ_lng(crd_typ_out));
-    lat_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*lat_nbr_out*nco_typ_lng(crd_typ_out));
+    lon_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*lon_nbr_out*nco_typ_lng(crd_typ_out));
+    lat_crn_out=(double *)nco_malloc(mpf.dst_grid_corners*lat_nbr_out*nco_typ_lng(crd_typ_out));
     lat_wgt_out=(double *)nco_malloc(lat_nbr_out*nco_typ_lng(crd_typ_out));
     lon_ntf_out=(double *)nco_malloc((lon_nbr_out+1L)*nco_typ_lng(crd_typ_out));
     lat_ntf_out=(double *)nco_malloc((lat_nbr_out+1L)*nco_typ_lng(crd_typ_out));
@@ -1250,20 +1253,20 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd=nco_get_vars(in_id,dst_grd_ctr_lat_id,dmn_srt,dmn_cnt,dmn_srd,lat_ctr_out,crd_typ_out);
     dmn_srt[0]=dmn_srt[1]=0L;
     dmn_cnt[0]=lon_nbr_out;
-    dmn_cnt[1]=rgr_map.dst_grid_corners;
+    dmn_cnt[1]=mpf.dst_grid_corners;
     rcd=nco_get_vara(in_id,dst_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_out,crd_typ_out);
     dmn_srt[0]=0L;
     dmn_cnt[0]=lat_nbr_out;
     dmn_srd[0]=lon_nbr_out;
     dmn_srt[1]=0L;
-    dmn_cnt[1]=rgr_map.dst_grid_corners;
+    dmn_cnt[1]=mpf.dst_grid_corners;
     dmn_srd[1]=1L;
     rcd=nco_get_vars(in_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,dmn_srd,lat_crn_out,crd_typ_out);
     if(flg_crd_rdn){
       for(idx=0;idx<lon_nbr_out;idx++) lon_ctr_out[idx]*=rdn2dgr;
       for(idx=0;idx<lat_nbr_out;idx++) lat_ctr_out[idx]*=rdn2dgr;
-      for(idx=0;idx<lon_nbr_out*rgr_map.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
-      for(idx=0;idx<lat_nbr_out*rgr_map.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
+      for(idx=0;idx<lon_nbr_out*mpf.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
+      for(idx=0;idx<lat_nbr_out*mpf.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
     } /* !rdn */
   } /* !flg_grd_out_rct */
     
@@ -1271,8 +1274,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     if(flg_crd_rdn){
       for(idx=0;idx<(long)grd_sz_out;idx++) lon_ctr_out[idx]*=rdn2dgr;
       for(idx=0;idx<(long)grd_sz_out;idx++) lat_ctr_out[idx]*=rdn2dgr;
-      for(idx=0;idx<(long)grd_sz_out*rgr_map.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
-      for(idx=0;idx<(long)grd_sz_out*rgr_map.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
+      for(idx=0;idx<(long)grd_sz_out*mpf.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
+      for(idx=0;idx<(long)grd_sz_out*mpf.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
     } /* !rdn */
   } /* !flg_grd_out_crv */
 
@@ -1291,7 +1294,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     msk_out=(int *)nco_malloc(grd_sz_out*nco_typ_lng(NC_INT));
     dmn_srt[0]=0L;
     dmn_cnt[0]=grd_sz_out;
-    rcd=nco_get_vara(in_id,msk_dst_id,dmn_srt,dmn_cnt,msk_out,NC_INT);
+    rcd=nco_get_vara(in_id,msk_dst_id,dmn_srt,dmn_cnt,msk_out,(nc_type)NC_INT);
   } /* !msk */
   
   /* Derive 2D interface boundaries from lat and lon grid-center values
@@ -1322,11 +1325,11 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     double lat_spn; /* [dgr] Latitude span */
 
     /* Obtain 1-D rectangular interfaces from unrolled 1-D vertice arrays */
-    for(idx=0;idx<lon_nbr_out;idx++) lon_ntf_out[idx]=lon_crn_out[rgr_map.dst_grid_corners*idx];
-    lon_ntf_out[lon_nbr_out]=lon_crn_out[rgr_map.dst_grid_corners*lon_nbr_out-(rgr_map.dst_grid_corners-1L)];
+    for(idx=0;idx<lon_nbr_out;idx++) lon_ntf_out[idx]=lon_crn_out[mpf.dst_grid_corners*idx];
+    lon_ntf_out[lon_nbr_out]=lon_crn_out[mpf.dst_grid_corners*lon_nbr_out-(mpf.dst_grid_corners-1L)];
     lon_spn=lon_ntf_out[lon_nbr_out]-lon_ntf_out[0];
-    for(idx=0;idx<lat_nbr_out;idx++) lat_ntf_out[idx]=lat_crn_out[rgr_map.dst_grid_corners*idx];
-    lat_ntf_out[lat_nbr_out]=lat_crn_out[rgr_map.dst_grid_corners*lat_nbr_out-1L];
+    for(idx=0;idx<lat_nbr_out;idx++) lat_ntf_out[idx]=lat_crn_out[mpf.dst_grid_corners*idx];
+    lat_ntf_out[lat_nbr_out]=lat_crn_out[mpf.dst_grid_corners*lat_nbr_out-1L];
     lat_spn=lat_ntf_out[lat_nbr_out]-lat_ntf_out[0];
 
     /* Place 1-D rectangular interfaces into 2-D coordinate boundaries */
@@ -1582,17 +1585,17 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* endif dbg */
 
   /* Allocate space for and obtain weights and addresses */
-  wgt_raw=(double *)nco_malloc_dbg(rgr_map.num_links*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for remapping weights");
-  col_src_adr=(int *)nco_malloc_dbg(rgr_map.num_links*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
-  row_dst_adr=(int *)nco_malloc_dbg(rgr_map.num_links*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
+  wgt_raw=(double *)nco_malloc_dbg(mpf.num_links*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for remapping weights");
+  col_src_adr=(int *)nco_malloc_dbg(mpf.num_links*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
+  row_dst_adr=(int *)nco_malloc_dbg(mpf.num_links*nco_typ_lng(NC_INT),fnc_nm,"Unable to malloc() value buffer for remapping addresses");
 
   /* Obtain remap matrix addresses and weights from map file */
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.num_links;
+  dmn_cnt[0]=mpf.num_links;
   rcd=nco_get_vara(in_id,col_src_adr_id,dmn_srt,dmn_cnt,col_src_adr,NC_INT);
   rcd=nco_get_vara(in_id,row_dst_adr_id,dmn_srt,dmn_cnt,row_dst_adr,NC_INT);
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.num_links;
+  dmn_cnt[0]=mpf.num_links;
   if(nco_rgr_mpf_typ != nco_rgr_mpf_SCRIP){
     rcd=nco_get_vara(in_id,wgt_raw_id,dmn_srt,dmn_cnt,wgt_raw,NC_DOUBLE);
   }else if(nco_rgr_mpf_typ == nco_rgr_mpf_SCRIP){
@@ -1602,14 +1605,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     dmn_srd[0]=1L;
     dmn_srt[1]=0L;
     dmn_cnt[1]=1L;
-    dmn_srd[1]=rgr_map.num_wgts;
+    dmn_srd[1]=mpf.num_wgts;
     rcd=nco_get_vars(in_id,wgt_raw_id,dmn_srt,dmn_cnt,dmn_srd,wgt_raw,NC_DOUBLE);
   } /* !SCRIP */
 
   /* Pre-subtract one from row/column addresses (stored, by convention, as Fortran indices) to optimize access with C indices */
   size_t lnk_nbr; /* [nbr] Number of links */
   size_t lnk_idx; /* [idx] Link index */
-  lnk_nbr=rgr_map.num_links;
+  lnk_nbr=mpf.num_links;
   for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++) row_dst_adr[lnk_idx]--;
   for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++) col_src_adr[lnk_idx]--;
   if(nco_dbg_lvl_get() >= nco_dbg_io){
@@ -1816,12 +1819,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
        Internally we label LRV as "lat" and MRV as "lon" so that code looks similar for curvilinear and rectangular grids */
     dmn_id_lat=cf->dmn_id[0];
     dmn_id_lon=cf->dmn_id[1];
-    /* Subtlety: lat_nm_in is coordinate (variable+dimension) name when specified from command-line (as in nco_grd_nfr()), dimension name when found through CF-method (as in nco_rgr_map()). This confusing distinction could be avoided by passing command-line dimension names through-to nco_rgr_map(). However, that route would require complex priorities for what to do when passing command-line coordinate names not dimension names and visa-versa. */
+    /* Subtlety: lat_nm_in is coordinate (variable+dimension) name when specified from command-line (as in nco_grd_nfr()), dimension name when found through CF-method (as in nco_rgr_wgt()). This confusing distinction could be avoided by passing command-line dimension names through-to nco_rgr_wgt(). However, that route would require complex priorities for what to do when passing command-line coordinate names not dimension names and visa-versa. */
     lat_nm_in=strdup(cf->dmn_nm[0]);
     lon_nm_in=strdup(cf->dmn_nm[1]);
     //lat_nm_in=strdup(cf->crd_nm[idx_lat]);
     //lon_nm_in=strdup(cf->crd_nm[idx_lon]);
-    /* Next four lines unnecessary in nco_rgr_map() which only needs dimension names (it reads input coordinates from map- not data-file) */
+    /* Next four lines unnecessary in nco_rgr_wgt() which only needs dimension names (it reads input coordinates from map- not data-file) */
     //lat_ctr_id=cf->crd_id[idx_lat];
     //lon_ctr_id=cf->crd_id[idx_lon];
     //lat_dmn_nm=strdup(cf->dmn_nm[0]);
@@ -3110,12 +3113,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   double *wgt_vld_out=NULL;
   double var_val_crr;
   int *tally=NULL; /* [nbr] Number of valid (non-missing) values */
-  size_t idx_in; /* [idx] Input grid index */
-  size_t idx_out; /* [idx] Output grid index */
   int lvl_idx; /* [idx] Level index */
   int lvl_nbr; /* [nbr] Number of levels */
   int thr_idx; /* [idx] Thread index */
   size_t dst_idx; 
+  size_t idx_in; /* [idx] Input grid index */
+  size_t idx_out; /* [idx] Output grid index */
   size_t var_sz_in; /* [nbr] Number of elements in variable (will be self-multiplied) */
   size_t var_sz_out; /* [nbr] Number of elements in variable (will be self-multiplied) */
   size_t val_in_fst; /* [nbr] Number of elements by which current N-D slab input values are offset from origin */
@@ -3124,7 +3127,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"Regridding progress: # means regridded, ~ means copied\n");
 
   /* Using naked stdin/stdout/stderr in parallel region generates warning
-     Copy appropriate filehandle to variable scoped shared in parallel clause */
+     Copy appropriate filehandle to variable scoped as shared in parallel clause */
   FILE * const fp_stdout=stdout; /* [fl] stdout filehandle CEWI */
 
   /* OpenMP notes:
@@ -3525,7 +3528,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* !flg_grd_out_crv */
 
   return rcd;
-} /* end nco_rgr_map() */
+} /* end nco_rgr_wgt() */
 
 void
 nco_bsl_zro /* Return Bessel function zeros */
@@ -4045,6 +4048,9 @@ nco_rgr_tps /* [fnc] Regrid using TempestRemap library */
 (rgr_sct * const rgr) /* I/O [sct] Regridding structure */
 {
   /* Purpose: Regrid fields using TempestRemap "library" (more precisely, executables)
+     Routine was originally written to call Tempest executables
+     However, that functionality was all placed into the ncremap shell script
+     Thus this C-interface is currently unused
 
      Test Tempest library: no way to activate yet
      export DATA_TEMPEST='/data/zender/rgr';ncks -O --rgr=Y ${DATA}/rgr/essgcm14_clm.nc ~/foo.nc */
@@ -4059,7 +4065,7 @@ nco_rgr_tps /* [fnc] Regrid using TempestRemap library */
   int rcd_sys;
   int lat_nbr_rqs=180;
   int lon_nbr_rqs=360;
-  nco_rgr_cmd_typ nco_rgr_cmd; /* [enm] TempestRemap command enum */
+  nco_rgr_tps_cmd nco_tps_cmd; /* [enm] TempestRemap command enum */
 
   char *nvr_DATA_TEMPEST; /* [sng] Directory where Tempest grids, meshes, and weights are stored */
   nvr_DATA_TEMPEST=getenv("DATA_TEMPEST");
@@ -4076,8 +4082,8 @@ nco_rgr_tps /* [fnc] Regrid using TempestRemap library */
   fl_grd_dst_cdl=nm2sng_fl(fl_grd_dst);
 
   /* Construct and execute regridding command */
-  nco_rgr_cmd=nco_rgr_GenerateRLLMesh;
-  cmd_rgr_fmt=nco_tps_cmd_fmt_sng(nco_rgr_cmd);
+  nco_tps_cmd=nco_rgr_GenerateRLLMesh;
+  cmd_rgr_fmt=nco_tps_cmd_fmt_sng(nco_tps_cmd);
   cmd_rgr=(char *)nco_malloc((strlen(cmd_rgr_fmt)+strlen(fl_grd_dst_cdl)-fmt_chr_nbr+1UL)*sizeof(char));
   if(nco_dbg_lvl_get() >= nco_dbg_fl) (void)fprintf(stderr,"%s: %s reports generating %d by %d RLL mesh in %s...\n",nco_prg_nm_get(),fnc_nm,lat_nbr_rqs,lon_nbr_rqs,fl_grd_dst);
   (void)sprintf(cmd_rgr,cmd_rgr_fmt,lat_nbr_rqs,lon_nbr_rqs,fl_grd_dst_cdl);
@@ -4234,10 +4240,10 @@ nco_rgr_nrm_sng /* [fnc] Convert regridding normalization enum to string */
 
 const char * /* O [sng] String containing regridding command and format */
 nco_tps_cmd_fmt_sng /* [fnc] Convert TempestRemap command enum to command string */
-(const nco_rgr_cmd_typ nco_rgr_cmd) /* I [enm] TempestRemap command enum */
+(const nco_rgr_tps_cmd nco_tps_cmd) /* I [enm] TempestRemap command enum */
 {
   /* Purpose: Convert TempestRemap command enum to command string and format */
-  switch(nco_rgr_cmd){
+  switch(nco_tps_cmd){
   case nco_rgr_ApplyOfflineMap:
     return "ApplyOfflineMap";
   case nco_rgr_CalculateDiffNorms:
@@ -4271,10 +4277,10 @@ nco_tps_cmd_fmt_sng /* [fnc] Convert TempestRemap command enum to command string
 
 const char * /* O [sng] String containing regridding command name */
 nco_tps_cmd_sng /* [fnc] Convert TempestRemap command enum to command name */
-(const nco_rgr_cmd_typ nco_rgr_cmd) /* I [enm] TempestRemap command enum */
+(const nco_rgr_tps_cmd nco_tps_cmd) /* I [enm] TempestRemap command enum */
 {
   /* Purpose: Convert TempestRemap command enum to command string */
-  switch(nco_rgr_cmd){
+  switch(nco_tps_cmd){
   case nco_rgr_ApplyOfflineMap: return "ApplyOfflineMap";
   case nco_rgr_CalculateDiffNorms: return "CalculateDiffNorms";
   case nco_rgr_GenerateCSMesh: return "GenerateCSMesh";
@@ -4902,7 +4908,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   (void)nco_def_var(out_id,grd_crn_lon_nm,crd_typ,dmn_nbr_2D,dmn_ids,&grd_crn_lon_id);
   if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,grd_crn_lon_id,shuffle,deflate,dfl_lvl);
 
-  /* Define "units" attributes */
+  /* Define global and "units" attributes */
   aed_sct aed_mtd;
   char *att_nm;
   char *att_val;
@@ -5902,12 +5908,12 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
        Internally we label LRV as "lat" and MRV as "lon" so that code looks similar for curvilinear and rectangular grids */
     dmn_id_lat=cf->dmn_id[0];
     dmn_id_lon=cf->dmn_id[1];
-    /* Subtlety: lat_nm_in is coordinate (variable+dimension) name when specified from command-line (as in nco_grd_nfr()), dimension name when found through CF-method (as in nco_rgr_map()). This confusing distinction could be avoided by passing command-line dimension names through-to nco_rgr_map(). However, that route would require complex priorities for what to do when passing command-line coordinate names not dimension names and visa-versa. */
+    /* Subtlety: lat_nm_in is coordinate (variable+dimension) name when specified from command-line (as in nco_grd_nfr()), dimension name when found through CF-method (as in nco_rgr_wgt()). This confusing distinction could be avoided by passing command-line dimension names through-to nco_rgr_wgt(). However, that route would require complex priorities for what to do when passing command-line coordinate names not dimension names and visa-versa. */
     //lat_nm_in=strdup(cf->dmn_nm[0]);
     //lon_nm_in=strdup(cf->dmn_nm[1]);
     lat_nm_in=strdup(cf->crd_nm[idx_lat]);
     lon_nm_in=strdup(cf->crd_nm[idx_lon]);
-    /* Next four lines unnecessary in nco_rgr_map() which only needs dimension names (it reads input coordinates from map- not data-file) */
+    /* Next four lines unnecessary in nco_rgr_wgt() which only needs dimension names (it reads input coordinates from map- not data-file) */
     lat_ctr_id=cf->crd_id[idx_lat];
     lon_ctr_id=cf->crd_id[idx_lon];
     lat_dmn_nm=strdup(cf->dmn_nm[0]);
diff --git a/src/nco/nco_rgr.h b/src/nco/nco_rgr.h
index 3f668dc..dab0795 100644
--- a/src/nco/nco_rgr.h
+++ b/src/nco/nco_rgr.h
@@ -25,6 +25,7 @@
 
 /* Personal headers */
 #include "nco.h" /* netCDF Operator (NCO) definitions */
+#include "nco_map.h" /* Map generation */
 #include "nco_mmr.h" /* Memory management */
 #include "nco_omp.h" /* OpenMP utilities */
 #include "nco_sld.h" /* Swath-Like Data */
@@ -34,7 +35,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-  typedef enum nco_rgr_cmd_typ_enm{ /* [enm] Tempest remap type enum */
+  typedef enum nco_rgr_tps_cmd_enm{ /* [enm] Tempest remap type enum */
     nco_rgr_AAA_nil=0,
     nco_rgr_ApplyOfflineMap,
     nco_rgr_CalculateDiffNorms,
@@ -48,7 +49,7 @@ extern "C" {
     nco_rgr_GenerateTestData,
     nco_rgr_MeshToTxt,
     nco_rgr_ZZZ_last
-  } nco_rgr_cmd_typ;
+  } nco_rgr_tps_cmd;
 
   typedef enum nco_rgr_mpf_typ_enm{ /* [enm] Mapfile type enum */
     nco_rgr_mpf_nil=0,
@@ -134,7 +135,7 @@ extern "C" {
    double * const wgt_Gss); /* O [frc] Gaussian weights */
 
   int /* O [enm] Return code */
-  nco_rgr_map /* [fnc] Regrid with external weights */
+  nco_rgr_wgt /* [fnc] Regrid with external weights */
   (rgr_sct * const rgr_nfo, /* I/O [sct] Regridding structure */
    trv_tbl_sct * const trv_tbl); /* I/O [sct] Traversal Table */
 
@@ -201,11 +202,11 @@ extern "C" {
 
   const char * /* O [sng] String containing regridding command and format */
   nco_tps_cmd_fmt_sng /* [fnc] Convert Tempest remap command enum to command string */
-  (const nco_rgr_cmd_typ nco_rgr_cmd); /* I [enm] Tempest remap command enum */
+  (const nco_rgr_tps_cmd nco_tps_cmd); /* I [enm] Tempest remap command enum */
 
   const char * /* O [sng] String containing regridding command name */
   nco_tps_cmd_sng /* [fnc] Convert Tempest remap command enum to command name */
-  (const nco_rgr_cmd_typ nco_rgr_cmd); /* I [enm] Tempest remap command enum */
+  (const nco_rgr_tps_cmd nco_tps_cmd); /* I [enm] Tempest remap command enum */
 
   double /* O [dgr] Longitude difference (lon_r-lon_l) */
   nco_lon_dff_brnch_dgr /* [fnc] Subtract longitudes with branch-cut rules */
diff --git a/src/nco/nco_sld.c b/src/nco/nco_sld.c
index c659913..431854a 100644
--- a/src/nco/nco_sld.c
+++ b/src/nco/nco_sld.c
@@ -546,49 +546,6 @@ nco_trr_ntl_sng /* [fnc] Convert interleave-type enum to string */
   return (char *)NULL;
 } /* end nco_trr_ntl_sng() */
 
-int /* O [rcd] Return code */
-nco_scrip_read /* [fnc] Read, parse, and print contents of SCRIP file */
-(char *fl_scrip, /* SCRIP file name with proper path */
- kvm_sct *kvm_scrip)/* structure to hold contents of SCRIP file */ 
-{
-  char *sng_line;
-  
-  int icnt;
-  int idx=0;
-
-  FILE *fp_scrip;
-
-  fp_scrip=fopen(fl_scrip,"r");
-
-  if(!fp_scrip){
-    (void)fprintf(stderr,"%s: ERROR Cannot open SCRIP file %s\n",nco_prg_nm_get(),fl_scrip);
-    return NCO_ERR;
-  } /* endif */
-
-  sng_line=(char *)nco_malloc(BUFSIZ*sizeof(char));
-  while(fgets(sng_line,sizeof(sng_line),fp_scrip)){
-    /* Each line must contain "=" */
-    if(!strstr(sng_line,"=")){
-      (void)fprintf(stderr,"%s: ERROR Invalid line in SCRIP file: %s\n",nco_prg_nm_get(),sng_line);
-      fclose(fp_scrip);
-      return NCO_ERR;
-    } /* endif */
-    kvm_scrip[idx]=nco_sng2kvm(sng_line);
-    if(!kvm_scrip[idx].key){
-      fclose(fp_scrip);
-      return NCO_ERR;
-    }else{
-      idx++;
-    } /* end else */
-  } /* finish parsing SCRIP file */
-  fclose(fp_scrip);
-  if(sng_line) sng_line=(char *)nco_free(sng_line);
-
-  for(icnt=0;icnt<idx;icnt++) nco_kvm_prn(kvm_scrip[icnt]);
-
-  return NCO_NOERR;
-} /* end nco_scrip_read */
-
 #ifdef ENABLE_ESMF
 const char * /* O [sng] String version of ESMC_FileFormat_Flag */
 nco_esmf_fl_fmt_sng /* [fnc] Convert ESMF file format to string */
diff --git a/src/nco/nco_sld.h b/src/nco/nco_sld.h
index 0517b36..60bb9bd 100644
--- a/src/nco/nco_sld.h
+++ b/src/nco/nco_sld.h
@@ -34,11 +34,6 @@ extern "C" {
 #endif /* __cplusplus */
 
   int /* O [rcd] Return code */
-  nco_scrip_read /* [fnc] Read, parse, and print contents of SCRIP file */
-  (char *fl_scrip, /* I [sng] SCRIP file name with proper path */
-   kvm_sct *kvm_scrip); /* I/O [sct] Structure to hold contents of SCRIP file */ 
-
-  int /* O [rcd] Return code */
   nco_trr_read /* [fnc] Read, parse, and print contents of TERRAREF file */
   (trr_sct *trr_nfo); /* I/O [sct] Terraref information */
   
diff --git a/src/nco/ncra.c b/src/nco/ncra.c
index d1ce8f6..148d5e3 100644
--- a/src/nco/ncra.c
+++ b/src/nco/ncra.c
@@ -1216,18 +1216,14 @@ main(int argc,char **argv)
         /* Fill record array */
         (void)nco_lmt_evl(grp_id,lmt_rec[idx_rec],rec_usd_cml[idx_rec],FORTRAN_IDX_CNV);
 
-        if(lmt_rec[idx_rec]->is_rec_dmn)
-        {
+        if(lmt_rec[idx_rec]->is_rec_dmn){
           int mid=-1;
-
-          if(nco_inq_varid_flg(grp_id, lmt_rec[idx_rec]->nm, &mid)==NC_NOERR  && mid>=0) {
-            fl_udu_sng = nco_lmt_get_udu_att(grp_id, mid, "units"); /* Units attribute of coordinate variable */
-
+          if(nco_inq_varid_flg(grp_id,lmt_rec[idx_rec]->nm,&mid) == NC_NOERR && mid >= 0){
+            fl_udu_sng=nco_lmt_get_udu_att(grp_id,mid,"units"); /* Units attribute of coordinate variable */
             ra_bnds_lst=nco_lst_cf_att(grp_id,"bounds",&ra_bnds_nbr);
             ra_climo_lst=nco_lst_cf_att(grp_id,"climatology",&ra_climo_nbr);
-          }
-
-        }
+          } /* !mid */
+        } /* !is_rec_dmn */
 
         if(REC_APN){
           /* Append records directly to output file */
@@ -1334,29 +1330,25 @@ main(int argc,char **argv)
             /* Re-base record coordinate and bounds if necessary (e.g., time, time_bnds) */
             /* if(var_prc[idx]->is_crd_var|| nco_is_spc_in_cf_att(grp_id,"bounds",var_prc[idx]->id) || nco_is_spc_in_cf_att(grp_id,"climatology",var_prc[idx]->id)) */
 
-            /*  This code rebases  the  coordinate var to the units of the coordinate var in the first input file */
-            /* if the record hyperslab indice(s) are double or strings then the coordinate var and limits are (re)read earlier by (void)nco_lmt_evl() */
-            /* so if the units between files are incompatible the ncra will bomb out in that call  and not in  nco_cln_clc_dbl_var_dff() below*/
-            if(var_prc[idx]->is_crd_var)
-            {
+            /* Re-base coordinate variable to units of coordinate in the first input file
+	       If record hyperslab indice(s) are double or strings then coordinate variable and limits
+	       are (re)-read earlier by nco_lmt_evl() and if units between files are incompatible 
+	       then ncra will die in that call and not in nco_cln_clc_dbl_var_dff() below */
+            if(var_prc[idx]->is_crd_var){
               nco_bool do_rebase=False;
-
-              if( !strcmp(var_prc[idx]->nm, lmt_rec[idx_rec]->nm) ||
-                  ra_lst_chk( ra_bnds_lst,ra_bnds_nbr, lmt_rec[idx_rec]->nm, var_prc[idx]->nm ) ||
-                  ra_lst_chk( ra_climo_lst, ra_climo_nbr, lmt_rec[idx_rec]->nm, var_prc[idx]->nm   )
-              ) do_rebase=True;
-
-
-              //(void)fprintf(fp_stderr,"%s: converting variable \"%s\" from units \"%s\" to \" %s\"\n",nco_prg_nm_get(), var_prc[idx]->nm, fl_udu_sng, lmt_rec[idx_rec]->rbs_sng);
-
-              if(do_rebase && fl_udu_sng && lmt_rec[idx_rec]->rbs_sng) {
-                if( nco_cln_clc_dbl_var_dff(fl_udu_sng,lmt_rec[idx_rec]->rbs_sng, lmt_rec[idx_rec]->lmt_cln, (double*)NULL, var_prc[idx]) !=NCO_NOERR) {
+              if(!strcmp(var_prc[idx]->nm,lmt_rec[idx_rec]->nm) ||
+		 ra_lst_chk(ra_bnds_lst,ra_bnds_nbr,lmt_rec[idx_rec]->nm,var_prc[idx]->nm) ||
+		 ra_lst_chk(ra_climo_lst,ra_climo_nbr,lmt_rec[idx_rec]->nm,var_prc[idx]->nm))
+		do_rebase=True;
+              //(void)fprintf(fp_stderr,"%s: converting variable \"%s\" from units \"%s\" to \" %s\"\n",nco_prg_nm_get(),var_prc[idx]->nm,fl_udu_sng,lmt_rec[idx_rec]->rbs_sng);
+              if(do_rebase && fl_udu_sng && lmt_rec[idx_rec]->rbs_sng){
+                if(nco_cln_clc_dbl_var_dff(fl_udu_sng,lmt_rec[idx_rec]->rbs_sng,lmt_rec[idx_rec]->lmt_cln,(double*)NULL,var_prc[idx]) != NCO_NOERR){
                   (void)fprintf(fp_stderr,"%s: problem converting variable \"%s\" from units \"%s\" to \" %s\"\n",nco_prg_nm_get(), var_prc[idx]->nm, fl_udu_sng, lmt_rec[idx_rec]->rbs_sng);
                   nco_exit(EXIT_FAILURE);
-                }
+                } /* !nco_cln_clc_dbl_var_dff() */
                 //nco_free(fl_udu_sng);
-              } /* end re-basing */
-            } 
+              } /* end !do_rebase */
+            } /* !crd_var */
               
             if(nco_prg_id == ncra){
               nco_bool flg_rth_ntl;
diff --git a/src/nco/ncrename.c b/src/nco/ncrename.c
index 5f42939..139674d 100644
--- a/src/nco/ncrename.c
+++ b/src/nco/ncrename.c
@@ -413,7 +413,7 @@ main(int argc,char **argv)
     }else if(mch_nbr == 0 && is_opt){
       (void)fprintf(stdout,"%s: INFO Optional variable \'%s\' not present in %s, skipping it\n",nco_prg_nm,var_rnm_lst[idx_var].old_nm+1L,fl_in);
     }else{
-      if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stdout,"%s: Renamed %d variable%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",var_rnm_lst[idx_var].old_nm,var_rnm_lst[idx_var].new_nm);
+      if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stdout,"%s: Renamed %d variable%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",var_rnm_lst[idx_var].old_nm,var_rnm_lst[idx_var].new_nm);
     } /* end else */
 
     mch_nbr_var+=mch_nbr;
@@ -448,7 +448,7 @@ main(int argc,char **argv)
     }else if(mch_nbr == 0 && is_opt){
       (void)fprintf(stdout,"%s: INFO Optional group \'%s\' not present in %s, skipping it\n",nco_prg_nm,grp_rnm_lst[idx_grp].old_nm+1L,fl_in);
     }else{
-      if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stdout,"%s: Renamed %d group%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",grp_rnm_lst[idx_grp].old_nm,grp_rnm_lst[idx_grp].new_nm);
+      if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stdout,"%s: Renamed %d group%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",grp_rnm_lst[idx_grp].old_nm,grp_rnm_lst[idx_grp].new_nm);
     } /* end else */
 
     mch_nbr_grp+=mch_nbr;
@@ -484,7 +484,7 @@ main(int argc,char **argv)
     }else if(mch_nbr == 0 && is_opt){
       (void)fprintf(stdout,"%s: INFO Optional dimension \'%s\' not present in %s, skipping it\n",nco_prg_nm,dmn_rnm_lst[idx_dmn].old_nm+1L,fl_in);
     }else{
-      if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stdout,"%s: Renamed %d dimension%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",dmn_rnm_lst[idx_dmn].old_nm,dmn_rnm_lst[idx_dmn].new_nm);
+      if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stdout,"%s: Renamed %d dimension%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",dmn_rnm_lst[idx_dmn].old_nm,dmn_rnm_lst[idx_dmn].new_nm);
     } /* end else */
 
     mch_nbr_dmn+=mch_nbr;
@@ -603,7 +603,7 @@ main(int argc,char **argv)
       } /* !obj_is_opt */
     } /* endif specified object not found */
 
-    if(nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stdout,"%s: Renamed %d attribute%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",att_rnm_lst[idx_att].old_nm,att_rnm_lst[idx_att].new_nm);
+    if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stdout,"%s: Renamed %d attribute%s from \'%s\' to \'%s\'\n",nco_prg_nm,mch_nbr,mch_nbr != 1 ? "s" : "",att_rnm_lst[idx_att].old_nm,att_rnm_lst[idx_att].new_nm);
 
     mch_nbr_att+=mch_nbr;
 
@@ -612,12 +612,14 @@ main(int argc,char **argv)
   /* Reset error return code */
   rcd=NC_NOERR;
 
-  (void)fprintf(stdout,"%s: In total renamed ",nco_prg_nm);
-  (void)fprintf(stdout,"%d attribute%s",mch_nbr_att,mch_nbr_att != 1 ? "s" : "");
-  (void)fprintf(stdout,", %d dimension%s",mch_nbr_dmn,mch_nbr_dmn != 1 ? "s" : "");
-  (void)fprintf(stdout,", %d group%s",mch_nbr_grp,mch_nbr_grp != 1 ? "s" : "");
-  (void)fprintf(stdout,", and %d variable%s\n",mch_nbr_var,mch_nbr_var != 1 ? "s" : "");
-
+  if(nco_dbg_lvl >= nco_dbg_std){
+    (void)fprintf(stdout,"%s: In total renamed ",nco_prg_nm);
+    (void)fprintf(stdout,"%d attribute%s",mch_nbr_att,mch_nbr_att != 1 ? "s" : "");
+    (void)fprintf(stdout,", %d dimension%s",mch_nbr_dmn,mch_nbr_dmn != 1 ? "s" : "");
+    (void)fprintf(stdout,", %d group%s",mch_nbr_grp,mch_nbr_grp != 1 ? "s" : "");
+    (void)fprintf(stdout,", and %d variable%s\n",mch_nbr_var,mch_nbr_var != 1 ? "s" : "");
+  } /* !nco_dbg_lvl */
+    
   /* Catenate time-stamped command line to "history" global attribute */
   if(HISTORY_APPEND) (void)nco_hst_att_cat(nc_id,cmd_ln);
   if(gaa_nbr > 0) (void)nco_glb_att_add(nc_id,gaa_arg,gaa_nbr);
diff --git a/src/nco/ncwa.c b/src/nco/ncwa.c
index 8d17ab6..8dbea15 100644
--- a/src/nco/ncwa.c
+++ b/src/nco/ncwa.c
@@ -384,9 +384,9 @@ main(int argc,char **argv)
     {"normalize-by-tally",no_argument,0,'W',},
     {"exclude",no_argument,0,'x'},
     {"xcl",no_argument,0,'x'},
-    {"weight",no_argument,0,'w'},
-    {"wgt",no_argument,0,'w'},
-    {"wgt_var",no_argument,0,'w'},
+    {"weight",required_argument,0,'w'},
+    {"wgt",required_argument,0,'w'},
+    {"wgt_var",required_argument,0,'w'},
     {"operation",required_argument,0,'y'},
     {"op_typ",required_argument,0,'y'},
     {0,0,0,0}

-- 
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