[nco] 01/05: New upstream version 4.7.1

Bas Couwenberg sebastic at debian.org
Thu Dec 21 17:37:36 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 189b14f95529e5b570593d60de2c65d12d519f39
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu Dec 21 18:19:41 2017 +0100

    New upstream version 4.7.1
---
 .travis.yml               |   3 +
 CMakeLists.txt            |  53 ++++---
 appveyor.yml              |  38 +++++
 bld/Makefile              |   2 +
 bld/nco.spec              |  11 +-
 bld/nco_dst.pl            |  30 ++--
 conda.recipe/bld.bat      |  34 +++++
 conda.recipe/meta.yaml    |  43 ++++++
 conda.recipe/run_test.bat |   8 ++
 config.h.in               |   3 +
 configure                 |  42 ++++--
 configure.ac              |  15 +-
 configure.eg              |  47 ++++--
 data/in.cdl               |  10 +-
 data/ncclimo              |  43 +++---
 data/ncremap              |  81 +++++++++--
 debian/changelog          |   6 +
 doc/ANNOUNCE              | 150 ++++++++++---------
 doc/ChangeLog             |  80 +++++++++++
 doc/VERSION               |   2 +-
 doc/build_hints.shtml     |   2 +-
 doc/debian.txt            | 162 ++++++++++-----------
 doc/index.shtml           |  81 ++++++-----
 doc/nco.texi              | 115 ++++++++++++---
 src/nco++/fmc_all_cls.cc  | 358 ++++++++++++++++++++++++++++++++++++++++++++--
 src/nco++/fmc_all_cls.hh  |   7 +-
 src/nco++/ncap2_utl.cc    |  12 +-
 src/nco++/ncoGrammer.g    |   4 +-
 src/nco++/ncoTree.cpp     |   4 +-
 src/nco++/prs_cls.cc      |   2 +-
 src/nco/ncap_utl.c        |   8 +-
 src/nco/ncks.c            |  26 ++--
 src/nco/nco.h             |   6 +-
 src/nco/nco_cnf_dmn.c     |  28 ++--
 src/nco/nco_ctl.c         |   2 +-
 src/nco/nco_fl_utl.c      |   2 +-
 src/nco/nco_grp_trv.c     |   4 +
 src/nco/nco_grp_utl.c     |  18 +--
 src/nco/nco_netcdf.c      | 304 ++++++++++++++++++++++++++-------------
 src/nco/nco_netcdf.h      |  17 ++-
 src/nco/nco_prn.c         |  84 ++++++-----
 src/nco/nco_sng_utl.c     |   7 +-
 src/nco/nco_sng_utl.h     |   4 +-
 src/nco/nco_var_avg.c     |  16 +--
 src/nco/nco_var_utl.c     |   2 +-
 src/nco_c++/nco_utl.cc    |   2 +-
 46 files changed, 1452 insertions(+), 526 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 788f2e9..16374fe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,12 +2,15 @@
 # Force Travis to rebuild by commiting an increment to this counter: 5
 
 language: c
+
 compiler:
   - gcc
   - clang
   - g++
 
 before_install:
+  - if [[ "${CC}" == "gcc" || "${CC}" == "g++" ]]; then export CXX=g++; fi
+  - if [[ "${CC}" == "clang" || "${CC}" == "clang++" ]]; then export CXX=clang++; fi
   - sudo apt-get update -qq
   - sudo apt-get install -y -qq antlr libantlr-dev libnetcdfc7 libnetcdf-dev netcdf-bin udunits-bin libudunits2-0 libudunits2-dev
   - ./configure
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6d63a7..5c5d78c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,10 +52,12 @@ endif()
 #general C/C++ build flags
 #/////////////////////////////////////////////////////////////////////////////////////
 
-set(CMAKE_BUILD_TYPE Debug)
-set(BUILD_STATIC_LIBS ON)
-set(BUILD_SHARED_LIBS OFF)
-add_definitions(-DENABLE_STATIC)
+set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build.")
+set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libs.")
+
+if (NOT BUILD_SHARED_LIBS)
+  add_definitions(-DENABLE_STATIC)
+endif()
 
 #//////////////////////////
 #detect minimum dependencies using
@@ -104,6 +106,7 @@ endif()
 #netCDF
 #Check for several functions in the netCDF library; define C macro accordingly
 #CMAKE_REQUIRED_LIBRARIES needs NETCDF_LIBRARY
+#check for header file netcdf_mem.h existence
 #/////////////////////////////////////////////////////////////////////////////////////
 
 set(CMAKE_REQUIRED_LIBRARIES ${NETCDF_LIBRARY})
@@ -119,19 +122,27 @@ if (has_nc_inq_format)
   add_definitions(-DHAVE_NC_INQ_FORMAT)
 endif()
 
+find_path(netcdf_mem_h netcdf_mem.h)
+if (netcdf_mem_h)
+  message("-- Found netcdf_mem.h in: " ${netcdf_mem_h})
+  add_definitions(-DHAVE_NETCDF_MEM_H)
+else()
+  message("-- NetCDF diskless functionaliy not available, netcdf_mem.h not found")
+endif()
+
 #/////////////////////////////////////////////////////////////////////////////////////
 #HDF5
 #/////////////////////////////////////////////////////////////////////////////////////
 
 
-find_library(HDF5_LIBRARY NAMES hdf5 ${find_opt})
+find_library(HDF5_LIBRARY NAMES hdf5 PATHS "/usr/lib/x86_64-linux-gnu/hdf5/serial")
 if(NOT HDF5_LIBRARY)
   message(FATAL_ERROR "${color_red}hdf5 library not found${color_reset}")
 else()
   message("-- Found hdf5 library at: " ${HDF5_LIBRARY})
 endif()
 
-find_library(HDF5_HL_LIBRARY NAMES hdf5_hl ${find_opt})
+find_library(HDF5_HL_LIBRARY NAMES hdf5_hl PATHS "/usr/lib/x86_64-linux-gnu/hdf5/serial")
 if(NOT HDF5_HL_LIBRARY)
   message(FATAL_ERROR "${color_red}hdf5 high level library not found${color_reset}")
 else()
@@ -238,22 +249,27 @@ endif()
 #compile as C++/static CRT on Visual Studio and as C99 on UNIX
 #//////////////////////////
 
+set(NCO_MSVC_USE_MT yes CACHE BOOL "Use MT flags when compiling in MSVC")
+
 if (MSVC)
   add_definitions( "/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE" )
-  message("-- Building with static runtime library")
-  set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
-  set(CMAKE_CXX_FLAGS_MINSIZEREL     "/MT /O1 /Ob1 /D NDEBUG")
-  set(CMAKE_CXX_FLAGS_RELEASE        "/MT /O2 /Ob2 /D NDEBUG")
-  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG")
-  
+
+  if (NCO_MSVC_USE_MT)
+     foreach(CompilerFlag CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+                          CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
+                          CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+                          CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+       string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
+     endforeach()
+  endif()
+
   #//////////////////////////
   #compile as C++ Code (/TP)
   #//////////////////////////
-
-  set(CMAKE_C_FLAGS_DEBUG "/TP /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
-  set(CMAKE_C_FLAGS_MINSIZEREL     "/TP /MT /O1 /Ob1 /D NDEBUG")
-  set(CMAKE_C_FLAGS_RELEASE        "/TP /MT /O2 /Ob2 /D NDEBUG")
-  set(CMAKE_C_FLAGS_RELWITHDEBINFO "/TP /MT /Zi /O2 /Ob1 /D NDEBUG")
+  foreach(CompilerFlag CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+                       CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+    set(${CompilerFlag} "/TP ${${CompilerFlag}}")
+  endforeach()
 
   #//////////////////////////
   #visual studio defines math symbols in math.h, avoid duplicate definition
@@ -393,7 +409,8 @@ set(nco_SOURCES ${nco_SOURCES} src/nco/nco_var_rth.c src/nco/nco_var_rth.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_var_scv.c src/nco/nco_var_scv.h)
 set(nco_SOURCES ${nco_SOURCES} src/nco/nco_var_utl.c src/nco/nco_var_utl.h)
 
-add_library(nco STATIC ${nco_SOURCES})
+# Type of library (SHARED, STATIC) is configured using BUILD_SHARED_LIBS
+add_library(nco ${nco_SOURCES})
 add_executable(ncks src/nco/ncks.c)
 add_executable(ncbo src/nco/ncbo.c)
 add_executable(ncecat src/nco/ncecat.c)
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..290f818
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,38 @@
+environment:
+  matrix:
+    - TARGET_ARCH: x64
+      CONDA_PY: 36
+      CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
+
+platform:
+  - x64
+
+install:
+  # If there is a newer build queued for the same PR, cancel this one.
+  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
+        https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
+        Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
+        throw "There are newer queued builds for this pull request, failing early." }
+
+  - cmd: rmdir C:\cygwin /s /q
+
+  # Add path, activate `conda` and update conda.
+  - cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
+
+  # # Add path, activate `conda` and update conda.
+  - cmd: conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
+  - cmd: conda update conda
+  - cmd: conda config --prepend channels conda-forge
+
+  - cmd: set PYTHONUNBUFFERED=1
+
+  - cmd: conda install conda-build
+  - cmd: conda info --all
+  - cmd: conda list
+
+
+# Skip .NET project specific build phase.
+build: off
+
+test_script:
+  - "conda build conda.recipe"
diff --git a/bld/Makefile b/bld/Makefile
index 11ddc06..de1eb47 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -655,6 +655,8 @@ CPP_TKN_OS := -DHAVE_REGEX_H -DNCO_HAVE_REGEX_FUNCTIONALITY -DHAVE_GETPAGESIZE -
 CPP_TKN_OS += -DHAVE_NC_INQ_FORMAT
 # Assume netCDF >= 4.3.2
 CPP_TKN_OS += -DHAVE_NC_INQ_PATH
+# Assume netCDF >= 4.4.0
+CPP_TKN_OS += -DHAVE_NETCDF_MEM_H
 # gcc 4.7.3 finally includes strcasestr() in string.h iff _GNU_SOURCE token is defined
 # NB: C++ (or at least g++ 4.7.3) always includes strcasestr()---work around this with tokens in nco_sng_utl.[ch]
 ifneq (${PVM_ARCH},CRAY)
diff --git a/bld/nco.spec b/bld/nco.spec
index 6733e95..545f62f 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.7.0
+Version:        4.7.1
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.7.0-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.7.1-1 tar.gz from Sourceforge using CVS:
 # cvs -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco login
-# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-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}
+# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.7.1-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.7.1/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
 Source0:        nco-%{version}.tar.gz
 #Patch0:		nco_install_C_headers.patch
 #Patch1:         nco_find_udunits-dat.patch
@@ -108,6 +108,9 @@ fi
 # %{_libdir}/libnco++.so
 
 %changelog
+* Thu Dec 21 2017 Charlie Zender <zender at uci.edu> - 4.7.1-1
+- new upstream 4.7.1
+
 * Wed Nov 08 2017 Charlie Zender <zender at uci.edu> - 4.7.0-1
 - new upstream 4.7.0
 
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index 6644798..51fa9ee 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.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
+# /usr/bin/scp ${DATA}/nco-4.7.1.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.7.1 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.7.1 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.7.1 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.7.1 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.7.1
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.7.1
 
 # Export daily snapshot
 # ${HOME}/nco/bld/nco_dst.pl --dbg=2 
@@ -256,7 +256,7 @@ if($bld){
 # Set up FTP server
     chdir $dst_pth_pfx or die "$prg_nm: ERROR unable to chdir to $dst_pth_pfx: $!\n"; # $! is system error string
     cmd_prc("$cp_cmd $doc_fl ./$dst_vrs/doc"); # Copy derived documentation to source directory
-    cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-4.7.0/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
+    cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-4.7.1/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
     cmd_prc("$rsh_cmd $www_mch $rm_cmd $www_drc/src/$dst_fl"); # Remove any distribution with same name
     if($dly_snp){cmd_prc("$rsh_cmd $www_mch $rm_cmd -r $www_drc/src/nco-????????.tar.gz");} # Remove previous daily snapshots from WWW server
     cmd_prc("$rcp_cmd $dst_fl $www_mch:$www_drc/src"); # Copy local tarfile to WWW server
diff --git a/conda.recipe/bld.bat b/conda.recipe/bld.bat
new file mode 100644
index 0000000..e29197c
--- /dev/null
+++ b/conda.recipe/bld.bat
@@ -0,0 +1,34 @@
+mkdir %SRC_DIR%\build
+cd %SRC_DIR%\build
+
+set "CFLAGS=%CFLAGS% -DWIN32 -DGSL_DLL"
+set "CXXFLAGS=%CXXFLAGS% -DWIN32 -DGSL_DLL"
+
+cmake -G "NMake Makefiles" ^
+      -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
+      -D CMAKE_BUILD_TYPE=Release ^
+      -D NCO_MSVC_USE_MT=no ^
+      -D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
+      -D NETCDF_INCLUDE=%LIBRARY_INC% ^
+      -D NETCDF_LIBRARY=%LIBRARY_LIB%\netcdf.lib ^
+      -D HDF5_LIBRARY=%LIBRARY_LIB%\libhdf5.lib ^
+      -D HDF5_HL_LIBRARY=%LIBRARY_LIB%\libhdf5_hl.lib ^
+      -D GSL_INCLUDE=%LIBRARY_INC% ^
+      -D GSL_LIBRARY=%LIBRARY_LIB%\gsl.lib ^
+      -D GSL_CBLAS_LIBRARY=%LIBRARY_LIB%\gslcblas.lib ^
+      -D UDUNITS2_INCLUDE=%LIBRARY_LIB% ^
+      -D UDUNITS2_LIBRARY=%LIBRARY_LIB%\udunits2.lib ^
+      -D EXPAT_LIBRARY=%LIBRARY_LIB%\expat.lib ^
+      -D CURL_LIBRARY=%LIBRARY_LIB%\libcurl.lib ^
+      -D ANTLR_INCLUDE:PATH=%LIBRARY_INC%\antlr ^
+      %SRC_DIR%
+if errorlevel 1 exit 1
+
+
+nmake
+if errorlevel 1 exit 1
+
+nmake install
+if errorlevel 1 exit 1
+
+move %LIBRARY_PREFIX%\*.exe %LIBRARY_BIN% || exit 1
diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml
new file mode 100644
index 0000000..11633b0
--- /dev/null
+++ b/conda.recipe/meta.yaml
@@ -0,0 +1,43 @@
+{% set version = "dev" %}
+
+package:
+  name: nco
+  version: {{ version }}
+
+source:
+  path: ../
+
+build:
+  number: 0
+  features:
+    - vc14
+
+requirements:
+  build:
+    - python
+    - cmake
+    - antlr >=2.7.7,<3
+    - curl >=7.44.0,<8
+    - expat 2.2.*
+    - gsl >=2.2,<2.3
+    - hdf5 1.10.1
+    - libnetcdf 4.4.*
+    - udunits2
+    - zlib 1.2.11
+    - vc 14
+  run:
+    - curl >=7.44.0,<8
+    - expat 2.2.*
+    - gsl >=2.2,<2.3
+    - hdf5 1.10.1
+    - libnetcdf 4.4.*
+    - udunits2
+    - vc 14
+
+test:
+  source_files:
+    - data/in.cdl
+  commands:
+    - ncks --help
+    - ncap2 --help
+    - ncks -M "http://tds.marine.rutgers.edu/thredds/dodsC/roms/espresso/2013_da/his/ESPRESSO_Real-Time_v2_History_Best"
diff --git a/conda.recipe/run_test.bat b/conda.recipe/run_test.bat
new file mode 100644
index 0000000..f7db654
--- /dev/null
+++ b/conda.recipe/run_test.bat
@@ -0,0 +1,8 @@
+cd data
+
+ncgen -o in.nc in.cdl || exit 1
+
+ncks -H --trd -v one in.nc || exit 1
+
+ncap2 -O -v -s "erf_one=float(gsl_sf_erf(1.0f));" in.nc foo.nc || exit 1
+ncks -v erf_one foo.nc || exit 1
diff --git a/config.h.in b/config.h.in
index f998b53..4ddb574 100644
--- a/config.h.in
+++ b/config.h.in
@@ -253,6 +253,9 @@
 /* Define to 1 if you have the <netcdf.h> header file. */
 #undef HAVE_NETCDF_H
 
+/* Define to 1 if <netcdf_mem.h> is present */
+#undef HAVE_NETCDF_MEM_H
+
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #undef HAVE_NETINET_IN_H
 
diff --git a/configure b/configure
index ce77161..e319021 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.7.0.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.7.1.
 #
 # 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.7.0'
-PACKAGE_STRING='NCO netCDF Operators 4.7.0'
+PACKAGE_VERSION='4.7.1'
+PACKAGE_STRING='NCO netCDF Operators 4.7.1'
 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.7.0 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.7.1 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.7.0:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.7.1:";;
    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.7.0
+NCO netCDF Operators configure 4.7.1
 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.7.0, which was
+It was created by NCO netCDF Operators $as_me 4.7.1, 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.7.0'
+ VERSION='4.7.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -17824,6 +17824,28 @@ fi
 
 fi
 
+# 20171218: nc_open_mem() is defined in netCDF >= 4.4.0, however ...
+# Ubuntu (Xenial at least) used broken netCDF CMake (not autoconf) to package 4.4.0 (it does not install netcdf_mem.h):
+# https://github.com/nco/nco/issues/44
+# Symptom of "missing netcdf_mem.h" and/or "unresolved nc_open_mem()" occurs with NCO 4.6.2+
+# Until 20171112 we used (Option 1):
+# #if NC_LIB_VERSION >= 440
+# which forces Ubuntu netCDF 4.4.0 users to build netCDF with autoconf and install, e.g., into /usr/local, or
+# to manually copy netcdf_mem.h into /usr/include (has anyone tested whether that really solves the problem?)
+# Option 2 is to add test/symbol in build-engine, e.g.,
+#  #if defined(HAVE_NETCDF_MEM_H)
+# which requires additional build tests in Autoconf/CMake/Makefile */
+ac_fn_c_check_header_mongrel "$LINENO" "netcdf_mem.h" "ac_cv_header_netcdf_mem_h" "$ac_includes_default"
+if test "x$ac_cv_header_netcdf_mem_h" = xyes; then :
+
+$as_echo "#define HAVE_NETCDF_MEM_H 1" >>confdefs.h
+
+else
+  nco_have_netcdf_mem_h=no
+fi
+
+
+
 # Begin OpenMP
 # Check whether --enable-openmp was given.
 if test "${enable_openmp+set}" = set; then :
@@ -21526,7 +21548,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.7.0, which was
+This file was extended by NCO netCDF Operators $as_me 4.7.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21592,7 +21614,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.7.0
+NCO netCDF Operators config.status 4.7.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 97c2ca3..8c4be7b 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.7.0],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[4.7.1],[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
@@ -312,6 +312,19 @@ if (test "x${enable_netcdf4}" = 'xyes' && test "x${header_defines_nc_chunked}" =
 	    ])
 fi
 
+# 20171218: nc_open_mem() is defined in netCDF >= 4.4.0, however ...
+# Ubuntu (Xenial at least) used broken netCDF CMake (not autoconf) to package 4.4.0 (it does not install netcdf_mem.h):
+# https://github.com/nco/nco/issues/44
+# Symptom of "missing netcdf_mem.h" and/or "unresolved nc_open_mem()" occurs with NCO 4.6.2+
+# Until 20171112 we used (Option 1): 
+# #if NC_LIB_VERSION >= 440 
+# which forces Ubuntu netCDF 4.4.0 users to build netCDF with autoconf and install, e.g., into /usr/local, or
+# to manually copy netcdf_mem.h into /usr/include (has anyone tested whether that really solves the problem?)
+# Option 2 is to add test/symbol in build-engine, e.g., 
+#  #if defined(HAVE_NETCDF_MEM_H)
+# which requires additional build tests in Autoconf/CMake/Makefile */
+AC_CHECK_HEADER([netcdf_mem.h],AC_DEFINE([HAVE_NETCDF_MEM_H],1,[Define to 1 if <netcdf_mem.h> is present]),nco_have_netcdf_mem_h=no)
+
 # Begin OpenMP
 AC_ARG_ENABLE(openmp,AS_HELP_STRING([--enable-openmp],[Build NCO with OpenMP [[default=yes]]]),enable_openmp=${enableval},enable_openmp=yes)
 # Enable OpenMP unless told not to
diff --git a/configure.eg b/configure.eg
index 516d195..2fbdfcb 100644
--- a/configure.eg
+++ b/configure.eg
@@ -268,14 +268,41 @@ 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 develop/install/update netCDF4-enabled NCO in personal directories with CMake:
+# Generic when netCDF is in /usr (Ubuntu glace, Fedora skyglow)
+export GNU_TRP=`~/nco/autobld/config.guess`
+cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
+cd ~/nco/cmake
+cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}
+make install
+
+# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in system directories with CMake:
+# Generic when netCDF is in /usr (Ubuntu glace, Fedora skyglow)
+cd ~/nco/cmake
+cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
+make
+sudo make install
+
+# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in system directories with CMake, when build requirements are in unusual directories:
+# netCDF4/HDF5 in /usr/local
+cd ~/nco/cmake
+cmake .. -DCMAKE_INSTALL_PREFIX=${HOME} -DNETCDF_INCLUDE:PATH=${NETCDF_INC} -DNETCDF_LIBRARY:FILE=${NETCDF_LIB}/libnetcdf.a -DHDF5_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a -DHDF5_HL_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a # Skyglow (Fedora does not supply szip packages)
+make install
+
+# netCDF4/HDF5 in /usr/local
+cd ~/nco/cmake
+cmake .. -DCMAKE_INSTALL_PREFIX=${HOME} -DNETCDF_INCLUDE:PATH=${NETCDF_INC} -DNETCDF_LIBRARY:FILE=${NETCDF_LIB}/libnetcdf.a -DHDF5_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a -DHDF5_HL_LIBRARY:FILE=${NETCDF_LIB}/libhdf5.a # Glace
+make install
+
 # 20150901: gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on cooley:
 # Sysadmin upgrade request: 20170825
 # Latest ticket: alcf-support #345910
 # Latest sysadmin-compiled module usage: soft add +nco-4.6.8, soft add +netcdf-4.4.1.1
 # Personal recipe last modified: 20170825
-# Personal recipe last used successfully: 20170825
+# Personal recipe last used successfully: 20171108
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
+cd ~/nco;git reset --hard origin/master
 ANTLR_ROOT=${HOME} CC='gcc' CXX='g++' NETCDF_ROOT='/soft/libraries/unsupported/netcdf-4.4.1.1' UDUNITS2_PATH=${HOME} ./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
 /bin/cp -f config.log nco.config.log.${GNU_TRP}.foo
 /bin/cp -f libtool nco.libtool.${GNU_TRP}.foo
@@ -320,7 +347,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: 20170919
+# Personal recipe last used successfully: 20171108
 module load szip
 module load gsl
 module load udunits
@@ -341,7 +368,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: 20170927
+# Personal recipe last used successfully: 20171108
 module load szip
 module load gsl
 module load udunits2
@@ -360,7 +387,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: 20170918
+# Personal recipe last used successfully: 20171108
 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
@@ -378,7 +405,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # Latest ticket: AREQ0159277 on 20170526
 # Latest sysadmin-compiled module usage: soft add +nco-4.6.7 # 20170526
 # Personal recipe last modified: 20161223
-# Personal recipe last used successfully: 20170526
+# Personal recipe last used successfully: 20171108
 # fails to link to udunits...why?
 # nm -a /soft/udunits/2.1.21/lib/libudunits2.a | grep ut_read_xml
 # First use: 20161223 Latest use: 20161223
@@ -412,11 +439,11 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 # 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: 20170919
+# Personal recipe last used successfully: 20171108
 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;git pull
 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:
@@ -436,7 +463,7 @@ cd ~/nco/bld;make NETCDF_ROOT='/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/17.0.1'
 # 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: 20170927
+# Personal recipe last used successfully: 20171108
 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'
@@ -455,7 +482,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: 20170919
+# Personal recipe last used successfully: 20171108
 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
@@ -680,7 +707,7 @@ 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-install netCDF (and ESMF) binaries in /usr/local (givre, roulee, grele)
+# gcc/g++ Zender uses this to debug NCO with custom-install netCDF (and ESMF) binaries in /usr/local (givre, roulee, grele, skyglow)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 CC='gcc' CXX='g++' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/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
diff --git a/data/in.cdl b/data/in.cdl
index 5d4dd3a..5756b9e 100644
--- a/data/in.cdl
+++ b/data/in.cdl
@@ -629,7 +629,13 @@ variables:
 	char char_var_nul;
 	char_var_nul:long_name = "Character variable containing one NUL";
 
-	// 20131015: This confuses the XML parser. Omit it for now.
+	char char_var_1D_arr(time);
+        char_var_1D_arr:long_name = "char-type 1D variable array";
+
+	char char_var_2D_arr(lat,lon);
+        char_var_2D_arr:long_name = "char-type 2D variable array";
+	
+        // 20131015: This confuses the XML parser. Omit it for now.
 	// char char_var_multinul(lev);
 	// char_var_multinul:long_name = "Character variable containing multiple NULs";
 
@@ -1362,6 +1368,8 @@ data:
 	// char_var_multinul='0','\n','\0';
 	char_var_nul='\0';
 	char_var_space=" ";
+        char_var_1D_arr="two words";
+        char_var_2D_arr="one","two";
         cnv_CF_grd=1,2,3,4,5,6,7,8;
 	cnv_CF_crd=273.1,273.2,273.3,273.4,273.5,273.6,273.7,273.8;
 	cnv_CF_ncl=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.;
diff --git a/data/ncclimo b/data/ncclimo
index adafbbb..57ec464 100755
--- a/data/ncclimo
+++ b/data/ncclimo
@@ -390,7 +390,7 @@ lbr_vrs=$(ncks --library 2>&1 > /dev/null | awk '{print $6}')
 if [ "${drc_spt}" != "${drc_nco}" ]; then
     echo "WARNING: Possible mixture of NCO versions from different locations. Script ${spt_nm} is from directory ${drc_spt} while NCO binaries are from directory ${drc_nco}. Normally this script and the binaries are from the same executables directory. This WARNING may be safely ignored for customized scripts and/or binaries that the user has intentionally split into different directories."
     echo "HINT (All-users): Conflicting script and binary directories may result from 1) Hardcoding an NCO script and/or binary pathnames, 2) Having incomplete NCO installations in one or more directories in the \$PATH environment variable, 3) Loading multiple NCO modules with different locations."
-    echo "HINT (E3SM-only): The ncclimo and ncremap scripts hard-code the NCO binary executable and library paths to point to C. Zender's home directories on the major E3SM machines. This facilitates quicker feature and fix updates to NCO binaries, and means users need only scripts to run climatologies and regridding with the latest NCO. However, this can be counterproductive for those employing carefully coordinated paths, such as MPAS Analysis or A-Prime, which use a Conda-based enviro [...]
+    echo "HINT (E3SM-only): The ncclimo and ncremap scripts hard-code the NCO binary executable and library paths to point to C. Zender's home directories on the major E3SM machines. This facilitates quicker feature and fix updates to NCO binaries, and means users need only scripts to run climatologies and regridding with the latest NCO. However, this can be counterproductive for those employing carefully coordinated paths, such as MPAS Analysis or A-Prime, which use a Conda-based enviro [...]
 fi # drc_spt
 
 # When running in a terminal window (not in an non-interactive batch queue)...
@@ -420,6 +420,7 @@ caseid_xmp='famipc5_ne30_v0.3_00003' # [sng] Case ID for examples
 cf_flg='Yes' # [sng] Produce CF climatology attribute?
 clm_flg='Yes' # [sng] Generate climatology
 clm_md='mth' # [sng] Climatology mode ('ann', 'dly', or 'mth')
+csn_flg='No' # [flg] Trigger season-processing code
 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)
@@ -757,7 +758,7 @@ else # !bch
     fi # !stdin
 fi # !bch
 if [ ${inp_std} = 'Yes' ] && [ ${inp_psn} = 'Yes' ]; then
-    echo "${spt_nm}: ERROR expecting input both from stdin and positional command-line arguments\n"
+    echo "${spt_nm}: ERROR expecting input both from stdin and positional command-line arguments"
     exit 1
 fi # !inp_std
 
@@ -874,13 +875,6 @@ if [[ "${caseid}" =~ ^(.*)([0-9][0-9][0-9][0-9][01][0-9].nc.?)$ ]]; then
     out_nm=${bs_nm}
     bs_sfx="${caseid#*.}"
 fi # !caseid
-if [ -n "${csn_lst}" ]; then
-    csn_flg='Yes'
-    if [ ${csn_lst} = 'none' ]; then
-	csn_nbr=0
-	csn_flg='No'
-    fi # !csn_lst
-fi # !csn_lst
 if [ "${clm_md}" != 'ann' ] && [ "${clm_md}" != 'dly' ] && [ "${clm_md}" != 'mth' ] ; then 
     echo "${spt_nm}: ERROR User-defined climatology mode is ${clm_md}. Valid options are 'ann', 'dly', or 'mth' (default)"
     exit 1
@@ -893,6 +887,11 @@ elif [ "${clm_md}" = 'dly' ]; then
     dec_md='sdd'
 elif [ "${clm_md}" = 'mth' ]; then 
     clm_nbr=12
+    csn_flg='Yes'
+    if [ ${csn_lst} = 'none' ]; then
+	csn_nbr=0
+	csn_flg='No'
+    fi # !csn_lst
 fi # !clm_md
 if [ -z "${drc_in}" ]; then
     drc_in="${drc_pwd}"
@@ -1521,8 +1520,10 @@ if [ "${clm_flg}" = 'Yes' ]; then
     fi # !bnr_flg
     if [ "${mdl_typ}" = 'yyyymm' ]; then
 	printf "Filenames will be constructed with generic conventions as ${bs_nm}_YYYYMM.${bs_sfx}\n"
+    elif [ ${inp_aut} = 'Yes' ]; then 
+	printf "Input filenames will be constructed with CESM'ish or E3SM/ACME'ish conventions\n"
     else # !mdl_typ
-	printf "Filenames will be constructed with CESM'ish or E3SM/ACME'ish conventions\n"
+	printf "Input filenames will be read from globbing, positional arguments, or stdin\n"
     fi # !mdl_typ
     if [ ${clm_md} = 'ann' ]; then 
 	printf "Each input file assumed to contain mean of one year\n"
@@ -1531,10 +1532,10 @@ if [ "${clm_flg}" = 'Yes' ]; then
     elif [ ${clm_md} = 'mth' ]; then 
 	printf "Each input file assumed to contain mean of one month\n"
     fi # !mth
-    if [ ${csn_flg} = 'No' ]; then 
-	printf "Seasons and therefore annual means derived from seasonal means have been turned-off and will not be computed\n"
-    elif [ ${clm_md} = 'mth' ]; then 
-	if [ ${dec_md} = 'scd' ]; then 
+    if [ ${clm_md} = 'mth' ]; then 
+	if [ ${csn_flg} = 'No' ]; then 
+	    printf "Seasons and therefore annual means derived from seasonal means have been turned-off and will not be computed\n"
+	elif [ ${dec_md} = 'scd' ]; then 
 	    printf "Winter statistics based on seasonally contiguous December (scd-mode): DJF sequences are consecutive and cross calendar-year boundaries\n"
 	else
 	    printf "Winter statistics based on seasonally discontiguous December (sdd-mode): DJF sequences comprise three months from the same calendar year\n"
@@ -1941,6 +1942,16 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'dly' ]; then
 	fl_all="${fl_all} ${fl_in[${fl_idx}]}"
     done # !fl
 
+    ppn_opt="-p ${drc_in}"
+    if [ ${inp_std} = 'Yes' ]; then
+	# 20171208 Detect whether stdin names are full-path (i.e., contain directory prefix)
+	# If full-path, then use as-is later on, otherwise prepend drc_in
+	# Currently this is only done for 'dly', yet could be adapted to sbs as well
+	if [ "$(basename ${fl_in[0]})" != "${fl_in[0]}" ]; then
+	    ppn_opt=''
+	fi # !basename
+    fi # !inp_std
+
     unset dpm # Days per month
     declare -a dpm
     dpm=(0 31 28 31 30 31 30 31 31 30 31 30 31) # 365-day calendar, 1-based indexing
@@ -1960,10 +1971,10 @@ if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'dly' ]; then
 	    tm_srt="${yyyy_srt}-${MM}-${DD} 00:00:00"
 	    tm_end="${yyyy_end}-${MM}-${DD} 23:59:59"
 	    if [ ${tpd_out} -eq 1 ]; then
-		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},1 -p ${drc_in} ${fl_all} ${fl_out[${clm_idx}]}"
+		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},1 ${ppn_opt} ${fl_all} ${fl_out[${clm_idx}]}"
 	    else
 		# 20170619: Diurnal mode is really slow on MacOSX (UDUnits parsing sluggishness?)
-		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncrcat -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},${drn} -p ${drc_in} ${fl_all} ${fl_cat[${clm_idx}]};/bin/rm -f ${fl_out[${clm_idx}]};for srt in `seq 0 $((tpd_out-1))`; do ncra --rec_apn -d time,\${srt},,${tpd_out} ${nco_opt} ${gaa_sng} ${fl_cat[${clm_idx}]} ${fl_out[${clm_idx}]};done;/bin/rm -f ${fl_cat[${clm_idx}]}"
+		cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncrcat -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},${drn} ${ppn_opt} ${fl_all} ${fl_cat[${clm_idx}]};/bin/rm -f ${fl_out[${clm_idx}]};for srt in `seq 0 $((tpd_out-1))`; do ncra --rec_apn -d time,\${srt},,${tpd_out} ${nco_opt} ${gaa_sng} ${fl_cat[${clm_idx}]} ${fl_out[${clm_idx}]};done;/bin/rm -f ${fl_cat[${clm_idx}]}"
 	    fi # !tpd
 	    let clm_idx=${clm_idx}+1
 	done # !day
diff --git a/data/ncremap b/data/ncremap
index a0ac1cc..3dfce56 100755
--- a/data/ncremap
+++ b/data/ncremap
@@ -238,13 +238,13 @@ fi # !hrd_pth && !NCO_PATH_OVERRIDE
 # ncremap -P mpas -i ${DATA}/hdf/mpaso.hist.am.timeSeriesStatsMonthly.0001-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
 # ncremap -P mpas -i ${DATA}/hdf/mpascice.hist.am.timeSeriesStatsMonthly.0251-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
 # E3SM/ACME benchmarks:
-# ncremap -v FSNT,AODVIS -a conserve -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
-# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
-# ncremap -v FSNT,AODVIS -a tempest -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
+# ncremap -v FSNT,AODVIS -a conserve -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -o ~/foo.nc
+# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/foo.nc
+# ncremap -v FSNT,AODVIS -a tempest -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/foo.nc
 # Positional arguments:
 # ncremap --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=~/rgr ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-??.nc
 # Omit cell_measures:
-# ncremap --no_cll_msr --var=FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
+# ncremap --no_cll_msr --var=FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -o ~/foo.nc
 # SGS (201705):
 # ncremap --vrb=3 -P sgs --var=area,FSDS,landfrac,landmask,TBOT -i ${DATA}/ne30/raw/F_acmev03_enso_camse_clm45bgc_ne30_co2cycle.clm2.h0.2000-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/alm_rgr.nc # 20170510 1D->2D works conserve and bilinear, no inferral
 # ncremap --vrb=3 -P sgs --var=area,FSDS,landfrac,landmask,TBOT -i ${DATA}/essgcm14/essgcm14.clm2.h0.0000-01.nc -s ${DATA}/grids/t42_SCRIP.20150901.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/t42_rgr.nc # 20170510 2D->2D works conserve and bilinear, no inferral
@@ -261,8 +261,12 @@ fi # !hrd_pth && !NCO_PATH_OVERRIDE
 # ncremap -a conserve -i ${DATA}/hdf/ctl_brcp85c5cn_deg1.enm.cice.h.2050-07.nc -s ${DATA}/grids/gx1v7_151008.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -o ~/wenshan.nc # 20170521: conservative requires supplied tri-pole grid for centers/bounds in masked regions
 # File-format
 # ncremap -v FSNT,AODVIS -s ${DATA}/grids/ne30np4_pentagons.091226.nc -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -o ~/foo.nc
+# TempestRemap boutique:
+# GenerateCSMesh --alt --res 30 --file ${DATA}/grids/ne30.g
+# ncremap --dbg=1 --src_grd=${DATA}/grids/ne30.g --dst_grd=${DATA}/grids/129x256_SCRIP.20150901.nc -m ~/map_ne30np4_to_fv129x256_mono.20180101.nc -a se2fv_flx
+# ncremap --dbg=1 --src_grd=${DATA}/grids/ne30.g --se_mtd=${DATA}/grids/ne30np4_latlon.091226.nc --dst_grd=${DATA}/grids/129x256_SCRIP.20150901.nc -m ~/map_ne30np4_to_fv129x256_mono.20180101.nc -a se2fv_flx
 # Debugging and Benchmarking:
-# ncremap -D 1 -i ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr > ~/ncremap.out 2>&1 &
+# ncremap -D 1 -i ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -o ~/foo.nc > ~/ncremap.out 2>&1 &
 
 # dbg_lvl: 0 = Quiet, print basic status during evaluation
 #          1 = Print configuration, full commands, and status to output during evaluation
@@ -309,7 +313,7 @@ fi # !TERM
 
 # Defaults for command-line options and some derived variables
 # Modify these defaults to save typing later
-alg_typ='bilinear' # [nbr] Algorithm for interpolation (bilinear|conserve|nearestdtos|neareststod|patch|tempest)
+alg_typ='bilinear' # [nbr] Algorithm for remapping (bilinear|conserve|nearestdtos|neareststod|patch|tempest|se2fv_flx|se2fv_stt|se2fv_alt|fv2se_flx|fv2se_stt|fv2se_alt)
 bch_pbs='No' # [sng] PBS batch (non-interactive) job
 bch_slr='No' # [sng] SLURM batch (non-interactive) job
 cln_flg='Yes' # [flg] Clean-up (remove) intermediate files before exiting
@@ -326,6 +330,7 @@ dst_xmp='dst.nc' # [sng] Destination file for examples
 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
+gll_fl='' # [sng] GLL grid metadata (geometry+connectivity+Jacobian) file
 grd_dst='' # [sng] Destination grid-file
 grd_dst_xmp='grd_dst.nc' # [sng] Destination grid-file for examples
 grd_sng='' # [sng] Grid string
@@ -380,7 +385,7 @@ vrb_4=4 # [enm] Verbosity level: Pedantic
 vrs_prn='No' # [sng] Print version information
 wgt_exe_esmf='ESMF_RegridWeightGen' # [sng] ESMF executable
 wgt_exe_tps='GenerateOfflineMap' # [sng] TempestRemap executable
-wgt_typ='esmf' # [sng] Weight-generator program
+wgt_typ='esmf' # [sng] Weight-generator program ('esmf' or 'tempest')
 wgt_opt='' # [sng] Weight-generator options
 #wgt_opt_esmf='--ignore_unmapped --netcdf4' # [sng] ESMF_RegridWeightGen options
 wgt_opt_esmf='--ignore_unmapped' # [sng] ESMF_RegridWeightGen options
@@ -409,11 +414,14 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     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 "            ESMF algorithms: bilinear|conserve|nearestdtos|neareststod|patch|tempest|se2fv_flx|se2fv_stt|se2fv_alt|fv2se_flx|fv2se_stt|fv2se_alt"
+    echo "            Tempest algorithms: tempest|se2fv_flx|se2fv_stt|se2fv_alt|fv2se_flx|fv2se_stt|fv2se_alt"
     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 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}-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, dst_grd, dest_grid, destination_grid${fnt_nrm}]"
+    echo " ${fnt_bld}--gll_fl${fnt_nrm}   GLL metadata (SE grid geometry+connectivity+Jacobian) file (default ${fnt_bld}${gll_fl}${fnt_nrm}) [${fnt_tlc}gll_fl, gll_mtd, se_gmt, se_mtd${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}]"
@@ -543,10 +551,11 @@ 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:-
 	       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_dst=?* | grid_dest=?* | dst_grd=?* | dest_grid=?* | destination_grid=?* ) grd_dst="${LONG_OPTARG}" ;; # -g # Destination grid-file
 	       grd_sng=?* | grid_generation=?* | grid_gen=?* | grid_string=?* ) grd_sng="${LONG_OPTARG}" ;; # -G # Grid generation string
 	       drc_in=?* | in_drc=?* | dir_in=?* | in_dir=?* | input=?* ) drc_in="${LONG_OPTARG}" ;; # -i # Input directory
 	       fl_fmt=?* | fmt_out=?* | file_format=?* | format_out=?* ) fl_fmt="${LONG_OPTARG}" ;; # # Output file format
+	       gll_fl=?* | gll_mtd=?* | se_gmt=?* | se_mtd=?* ) gll_fl="${LONG_OPTARG}" ;; # # GLL grid metadata (geometry+connectivity+Jacobian) file
 	       in_fl=?* | in_file=?* | input_file=?* ) in_fl="${LONG_OPTARG}" ;; # -i # Input file
 	       job_nbr=?* | job_number=?* | jobs=?* ) job_usr="${LONG_OPTARG}" ;; # -j # Job simultaneity
 	       mlt_map | multimap | no_multimap | nomultimap ) mlt_map_flg='No' ;; # -M # Multi-map flag
@@ -737,7 +746,7 @@ pdq_fl=${pdq_fl}${unq_sfx}
 tmp_out_fl=${tmp_out_fl}${unq_sfx}
 znl_fl=${znl_fl}${unq_sfx}
 
-# Algorithm options are bilinear|conserve|nearestdtos|neareststod|patch|tempest
+# Algorithm options are bilinear|conserve|nearestdtos|neareststod|patch|tempest|se2fv_flx|se2fv_stt|se2fv_alt|fv2se_flx|fv2se_stt|fv2se_alt
 if [ ${alg_typ} = 'bilinear' ] || [ ${alg_typ} = 'bln' ]; then 
     alg_opt='bilinear'
 elif [ ${alg_typ} = 'conserve' ] || [ ${alg_typ} = 'conservative' ] || [ ${alg_typ} = 'cns' ]; then 
@@ -749,10 +758,54 @@ elif [ ${alg_typ} = 'neareststod' ] || [ ${alg_typ} = 'nsd' ] || [ ${alg_typ} =
 elif [ ${alg_typ} = 'patch' ] || [ ${alg_typ} = 'pch' ] || [ ${alg_typ} = 'ptc' ]; then 
     alg_opt='patch'
 elif [ ${alg_typ} = 'tempest' ] || [ ${alg_typ} = 'tps' ] || [ ${alg_typ} = 'tmp' ]; then 
+    # 20171108 'tempest' invokes TempestRemap with no automatic options, suitable for RLL re-mapping?
+    # 20171108 TempestRemap boutique options based on particular remapping type
+    # https://acme-climate.atlassian.net/wiki/spaces/Docs/pages/178848194/Transition+to+TempestRemap+for+Atmosphere+grids
+    # map_tag in comments is for E3SM naming convention map_src_to_dst_${map_tag}.20180101.nc
     alg_opt='tempest'
+    wgt_typ='tempest'
+elif [ ${alg_typ} = 'se2fv_flx' ] || [ ${alg_typ} = 'mono_se2fv' ] || [ ${alg_typ} = 'conservative_monotone_se2fv' ]; then # map_tag='mono'
+    wgt_opt_tps="--in_type cgll --in_np 4 --out_type fv --out_double --mono"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="--in_meta ${gll_fl} ${wgt_opt_tps}"
+    fi # !gll_fl
+    wgt_typ='tempest'
+elif [ ${alg_typ} = 'se2fv_stt' ] || [ ${alg_typ} = 'highorder_se2fv' ] || [ ${alg_typ} = 'accurate_conservative_nonmonotone_se2fv' ]; then # map_tag='highorder'
+    wgt_opt_tps="--in_type cgll --in_np 4 --out_type fv --out_double"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="--in_meta ${gll_fl} ${wgt_opt_tps}"
+    fi # !gll_fl
+    wgt_typ='tempest'
+elif [ ${alg_typ} = 'se2fv_alt' ] || [ ${alg_typ} = 'intbilin_se2fv' ] || [ ${alg_typ} = 'accurate_monotone_nonconservative_se2fv' ]; then # map_tag='intbilin'
+    wgt_opt_tps="--in_type cgll --in_np 4 --out_type fv --out_double --mono3 --noconserve"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="--in_meta ${gll_fl} ${wgt_opt_tps}"
+    fi # !gll_fl
+    wgt_typ='tempest'
+elif [ ${alg_typ} = 'fv2se_flx' ] || [ ${alg_typ} = 'monotr_fv2se' ] || [ ${alg_typ} = 'conservative_monotone_fv2se' ]; then # map_tag='monotr'
+    wgt_opt_tps="--in_type cgll --in_np 4 --out_type fv --out_double --mono"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="--in_meta ${gll_fl} ${wgt_opt_tps}"
+    fi # !gll_fl
+    wgt_typ='tempest'
+    # fxm: transpose maps need additional call:
+    # ./GenerateTransposeMap --in map_atm2ocn_mono.nc --out map_ocn2atm_monotr.nc
+elif [ ${alg_typ} = 'fv2se_stt' ] || [ ${alg_typ} = 'highorder_fv2se' ] || [ ${alg_typ} = 'accurate_conservative_nonmonotone_fv2se' ]; then # map_tag='highorder'
+    wgt_opt_tps="--in_type fv --in_np 2 --out_type cgll --out_np 4 --out_double --volumetric"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="${wgt_opt_tps} --out_meta ${gll_fl}"
+    fi # !gll_fl
+    wgt_typ='tempest'
+elif [ ${alg_typ} = 'fv2se_alt' ] || [ ${alg_typ} = 'mono_fv2se' ] || [ ${alg_typ} = 'conservative_monotone_fv2se_alt' ]; then # map_tag='mono'
+    wgt_opt_tps="--in_type fv --in_np 1 --out_type cgll --out_np 4 --out_double --mono --volumetric"
+    if [ -n "${gll_fl}" ]; then
+	wgt_opt_tps="${wgt_opt_tps} --out_meta ${gll_fl}"
+    fi # !gll_fl
+    wgt_typ='tempest'
 else 
-    echo "${spt_nm}: ERROR ${alg_typ} is not a valid interpolation option\n"
-    echo "${spt_nm}: HINT Valid interpolation options are bilinear|conserve|nearestdtos|neareststod|patch|tempest\n"
+    echo "${spt_nm}: ERROR ${alg_typ} is not a valid remapping algorithm\n"
+    echo "${spt_nm}: HINT Valid ESMF remapping algorithms are bilinear,bln | conserve,cns | nearestdtos,nds,dtos | neareststod,nsd,stod | patch,pch\n"
+    echo "${spt_nm}: HINT Valid TempestRemap remapping options are tempest | se2fv_flx,mono_se2fv | se2fv_stt,highorder_se2fv | se2fv_alt,intbilin | fv2se_flx,monotr_fv2se | fv2se_stt,highorder_fv2se | fv2se_alt,mono_fv2se\n"
     exit 1
 fi # !alg_typ
 if [ -n "${fl_fmt}" ]; then
@@ -777,9 +830,6 @@ if [ -n "${fl_fmt}" ]; then
     fi # !fl_fmt
     nco_opt="${nco_opt} ${nco_fl_fmt}"
 fi # !fl_fmt
-if [ ${alg_opt} = 'tempest' ]; then
-    wgt_typ='tempest'
-fi # alg_opt
 if [ ${wgt_typ} = 'esmf' ]; then
     wgt_cmd="${wgt_exe_esmf}"
     wgt_exe="${wgt_exe_esmf}"
@@ -1159,6 +1209,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: dst_fl   = ${dst_fl}\n"
     printf "dbg: fl_fmt   = ${fl_fmt}\n"
     printf "dbg: gaa_sng  = ${gaa_sng}\n"
+    printf "dbg: gll_fl   = ${gll_fl}\n"
     printf "dbg: grd_dst  = ${grd_dst}\n"
     printf "dbg: grd_sng  = ${grd_sng}\n"
     printf "dbg: grd_src  = ${grd_src}\n"
diff --git a/debian/changelog b/debian/changelog
index 14a8052..d1e176e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nco (4.7.1-1) unstable; urgency=low
+
+  * new upstream version WIN64 ABI; Conda Windows; JSON tweaks; fix clm_md=dly,ann
+
+ -- Charlie Zender <zender at uci.edu>  Thu, 21 Dec 2017 12:25:27 -0700
+
 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
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index 630a2a8..d33c80a 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,88 +1,95 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.7.0 are released. 
+The netCDF Operators NCO version 4.7.1 have escaped.
 
-http://nco.sf.net (Homepage, Mailing lists)
+http://nco.sf.net (Homepage, Mailing lists, Help)
 http://github.com/nco (Source Code, Releases, Developers)
 
 What's new?
-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.
+Version 4.7.1 contains mostly minor fixes and few new features.
+One major improvement, long in development, is a Conda Windows port. 
+Most NCO functionality is now easily available to Windows users
+through the Conda distribution. 
+
+Pedro Vicente turned his Windows scripts into a CMake implementation. 
+Building on Pedro's CMake contribution, a team of about six volunteers
+used, refined, or implemented Windows ports for the full NCO software
+stack. Filipe Fernandez coordinated the Conda work, added AppVeyor
+support, and brought in extra help and testing. Pedro and Isuru
+Fernando tracked down bugs and improved the build matrix.
+No one person could have accomplished this.
+The power of Open Source development is awesome.
 
 Work on NCO 4.7.1 has commenced. Planned changes include
 better diagnosis and workarounds for the netCDF CDF5 bug,
-and parallel weight generation by ncremap.
+parallel weight generation by ncremap, and possibly workarounds for 
+using quotation marks with ncap2 in Windows.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-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
-
-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
-   cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
-   make
-   sudo make install
-   Additional examples in cmake/build.bat
-   http://nco.sf.net#bld
-
-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
+A. NCO Conda package for Windows: All NCO binaries are thought
+   to work correctly, although the regression test script itself
+   (which is written in Perl) has not yet been run on Windows.
+   Windows' idiosyncratic quoting rules can interfere with ncap2
+   (try running from Powershell to use UNIXy quotes).
+   The two scripted operators, ncclimo and ncremap, are problematic.
+   As sophisticated Bash scripts, these do not work on Windows.
+   Volunteers to port them to a Windows-friendly language (e.g.,
+   Python) are welcome! 
+   Within a few days of release, try this Windows install command:
+   conda install -c conda-forge nco   
+   http://nco.sf.net/nco.html#conda
+   
+B. ncclimo in daily mode now handles stdin input more cleverly.
+   Piping or redirecting filename lists to ncclimo --clm_md=dly
+   is the easiest way to feed huge lists of filenames to ncclimo.
+   However, these lists are often dominated in size by the path
+   component of the filename, rather than the filename itself.
+   Now ncclimo allows specification of the path with -i drc_in,
+   and it will prepend that path to the standard input names.
+   Previously it prepended the current working directory.
+   This functionality allows easy retention of the full
+   provenance of the input files, without requiring repetitive
+   inclusion of long pathnames in the filenames.
+   ls *.clm2.h0.* | ncclimo -c caseid -C dly -s 1960 -e 2005 -i data
+   http://nco.sf.net/nco.html#ncclimo
+
+C. JSON printing of netCDF3 strings, i.e., character arrays,
+   has changed. Previously ncks printed square brackets around
+   the string, as with numeric arrays. However this was somewhat
+   redundant since the quotation marks around a JSON string already
+   indicate an array of characters. Now ncks omits the inner-most
+   (i.e., most rapidly varying) set of brackets from the printing of
+   character arrays: 
+   ncks --jsn_fmt=2 -C -H -v char_var_2D_arr ~/nco/data/in.nc
+   {
+     "dimensions": {
+         "lat": 2,
+         "lon": 4
+      },
+      "variables": {
+         "char_var_2D_arr": {
+         "shape": ["lat", "lon"],
+         "type": "char",
+         "data": ["one", "two"]
+    ...
+
+   This is instead of "data": [["one"], ["two"]]
+   in the last line. 
+   http://nco.sf.net/nco.html#json
 
 BUG FIXES:
 
-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.
+A. Fix bug where ncclimo --clm_md=dly/ann expected a season list.
+   This bug was inadvertently introduced with season code in 4.6.8.
+   The workaround is to use NCO <= 4.6.7 or upgrade to 4.7.1.
+
+B. ncks in JSON, CDL, and XML modes now prints a single NUL as "".
+   Previously a scalar NUL printed as "0", as in ncdump's CDL.
+   However, we think this is a bug in ncdump since NUL is not zero.
 
 Full release statement at http://nco.sf.net/ANNOUNCE
 
@@ -90,9 +97,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.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 (201701101) on HDF5 1.8.19.
+   These problems occur with NCO 4.7.1 built/tested under
+   MacOS 10.13.2 with netCDF 4.4.1.1 on HDF5 1.10.1 and with
+   Linux with netCDF 4.5.1-development (20171220) on HDF5 1.8.19.
 
 A. NOT YET FIXED (NCO problem)
    Correctly read arrays of NC_STRING with embedded delimiters in ncatted arguments
@@ -149,7 +156,7 @@ B. NOT YET FIXED (netCDF4 library bug)
    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
-
+   20171107: https://github.com/Unidata/netcdf-c/issues/597
    Bug tracking: https://www.unidata.ucar.edu/jira/browse/fxm
    More details: http://nco.sf.net/nco.html#ncrename_crd
 
@@ -162,6 +169,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
+   20171107: https://github.com/Unidata/netcdf-c/issues/597
 
    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 a212131..3b4f745 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,85 @@
+2017-12-21  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.1 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.1: Ajudar';git push
+	git tag -a 4.7.1 -m 'WIN64 ABI; Conda Windows; JSON tweaks; fix clm_md=dly,ann;';git push --tags
+
+2017-12-20  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.1-beta01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.1-beta01: Neverwhere';git push
+	git tag -a 4.7.1-beta01 -m 'JSON NUL, brackets, Conda Windows';git push --tags
+
+	* Fix Travis build matrix to eliminate false negatives (thanks to @isuruf)
+
+	* Print scalar char of NUL as "" instead of 0 in JSON, CDL, XML
+
+	* Remove inner set of brackets when printing character arrays in JSON
+
+2017-12-18  Charlie Zender  <zender at uci.edu>
+
+	* Add detection of netcdf_mem.h to autoconf and #define	HAVE_NETCDF_MEM_H accordingly
+
+2017-12-16  Charlie Zender  <zender at uci.edu>
+
+	* Add AppVeyor to build conda recipe for Windows. Contributed by Filipe.
+
+2017-12-14  Charlie Zender  <zender at uci.edu>
+
+	* CMakefile.txt and nco_sng_utl.h changes for Conda Windows package
+
+2017-12-08  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.1-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.1-alpha03: Red Velvet';git push
+	git tag -a 4.7.1-alpha03 -m 'ncclimo fix clm_md=dly,ann bugs and add prepend savvy';git push --tags
+
+	* ncclimo: for clm_md=dly and inp_std, prepend drc_in to fl_in iff stdin names are basenames
+
+2017-12-07  Charlie Zender  <zender at uci.edu>
+
+	* Stop ncclimo from setting csn_flg when clm_md='dly' or 'ann'
+
+	* Fix ncclimo E3SM instruction on how to override default PATH at HPCs
+
+2017-12-03  Charlie Zender  <zender at uci.edu>
+
+	* Warn when input file contains non-atomic variables
+
+2017-11-15  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.7.1-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.1-alpha02: Raspberry-infused vodka';git push
+	git tag -a 4.7.1-alpha02 -m 'long/size_t workaround for WIN64';git push --tags
+
+	* long/size_t workaround for var1 routines
+
+	* Change most NC_MAX_DIMS to NC_MAX_VAR_DIMS
+
+	* long/size_t workaround for srt,cnt and long/ptrdiff_t workaround for srd,map
+
+	* WIN64 workaround for sizeof(long) = 4 != 8 = sizeof(size_t) with dmn_sz, att_sz
+
+2017-11-12  Charlie Zender  <zender at uci.edu>
+
+	* Modify how netcdf_mem.h and nc_open_mem() are detected/provided
+
+2017-11-10  Charlie Zender  <zender at uci.edu>
+
+	* ncremap: Use gll_fl only when supplied, do not require it
+
+	* ncremap: Implement all boutique Tempest algorithms except for transpose
+
+	* ncrename: report collective rename bugs in https://github.com/Unidata/netcdf-c/issues/597
+
 2017-11-08  Charlie Zender  <zender at uci.edu>
 
+	* ncremap: Add hooks for more elaborate TempestRemap options
+
+	* NCO 4.7.1-alpha01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.7.1-alpha01: 1.3 lb salad';git push
+	git tag -a 4.7.1-alpha01 -m 'Identical to 4.7.0 except for version info';git push --tags
+
 	* 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
diff --git a/doc/VERSION b/doc/VERSION
index f6cdf40..7c66fca 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.7.0
+4.7.1
diff --git a/doc/build_hints.shtml b/doc/build_hints.shtml
index 8861619..8f0b3f6 100644
--- a/doc/build_hints.shtml
+++ b/doc/build_hints.shtml
@@ -9,7 +9,7 @@ file:///home/zender/nco/doc/build_hints.shtml
 
 Usage:
 /usr/bin/scp ~/nco/doc/build_hints.shtml zender,nco at web.sf.net:/home/project-web/nco/htdocs
-scp -p ~/nco/doc/build_hints.shtml dust.ess.uci.edu:/var/www/html/nco
+scp -p ~/nco/doc/build_hints.shtml dust.ess.uci.edu:Sites/nco
 -->
 
 <!doctype html public "-//W3C//DTD HTML 3.2//EN">
diff --git a/doc/debian.txt b/doc/debian.txt
index b6db67d..e5f72bc 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.7.0
-   First we create a clean source distribution of nco and place it in nco-4.7.0
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.7.1
+   First we create a clean source distribution of nco and place it in nco-4.7.1
    Until we know what is necessary, however, we just copy a snapshot
    
    2.1 Clean all build files from development directory
 
 cd ~/nco;make distclean;cd bld;make clean;cd ~
 tar cvzf ./nco/nco.tar.gz ./nco/*
-cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-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
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.7.1
+/bin/rm nco.tar.gz;tar cvzf nco-4.7.1.tar.gz ./nco-4.7.1/*
+cd ~/nco/nco-4.7.1
+dh_make -e zender at uci.edu -f ../nco-4.7.1.tar.gz
 
     2.2 The preceding steps created template debian files for a .deb,
     Those files now reside in ~/nco/debian.
@@ -55,7 +55,7 @@ dh_make -e zender at uci.edu -f ../nco-4.7.0.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.7.0
+   cd ~/nco/nco-4.7.1
    dpkg-buildpackage -rfakeroot > foo 2>&1
    dpkg-buildpackage -rsudo > foo 2>&1
 
@@ -84,33 +84,33 @@ patch -p0 < nco_X.Y.Z-3.diff   # Patch destination with Debian diff
    make tags
 # Put cute version-specific string in nco_ctl.c:nco_nmn_get()
 # Install correct version numbers before updating Debian
-# tags-query replace 4.7.0 with X.Y.Z+1
+# tags-query replace 4.7.1 with X.Y.Z+1
 # If tags-query replace does not work, be sure to manually change
 # versions in configure.ac, debian/files, doc/ANNOUNCE, doc/debian.txt,
 # doc/index.shtml, doc/nco.texi, bld/nco_dst.pl, doc/VERSION
 # 20141201: Change NCO_VERSION_PATCH in src/nco.h!!!!!!!!!!!!!!!!!!!!!!
-   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.7.0-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.7.1-1 # Update changelog (-b forces this version number)
    emacs ~/nco/bld/nco.spec # Update changelog
 # For unknown reason rules file may lose its executable bit
    chmod a+x ~/nco/debian/rules
 # Rebuild autotools so new version # propagates
    cd ~/nco;aclocal;autoheader;automake --foreign;autoconf
 # Save all files in emacs before tagging
-   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.7.0
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.7.1
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.7.0.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.7.1.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.7.0-2~ppa1_source.changes
+dput NCO nco_4.7.1-2~ppa1_source.changes
 sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
 
 # Location of build diagnostics for mentors to help 
-http://dust.ess.uci.edu/nco/src/nco_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
+http://dust.ess.uci.edu/nco/src/nco_4.7.1-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.7.1-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.7.1-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.7.1-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.7.1.orig.tar.gz
 
 # Becoming a Debian developer
 http://www.debian.org/devel/join/newmaint
@@ -164,31 +164,31 @@ Matej Vela <vela at debian.org>, Daniel Baumann <daniel at debian.org>, Warren Turkal
 # export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/X11R6/lib
 # sudo aptitude install antlr bison flex gsl-bin libgsl0-dev libantlr-dev netcdf-bin libnetcdfc7 libnetcdf-dev texinfo libcurl4-gnutls-dev libexpat1-dev libxml2-dev udunits-bin libudunits2-0 libudunits2-dev
 cd ~/nco;cvc
-sudo /bin/rm -rf ${DATA}/nco-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
+sudo /bin/rm -rf ${DATA}/nco-4.7.1 ${DATA}/nco_4.7.1* ${DATA}/debian # Cleanup last build. sudo necessary for removal because dpkg-buildpackage uses sudo?
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.7.1-1 -d nco-4.7.1 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -d nco-4.7.1 nco # Export most recent
+tar cvzf ./nco_4.7.1.orig.tar.gz --exclude='nco-4.7.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.1 
+/bin/rm -rf ${DATA}/nco-4.7.1 # Remove cvs-exported directory
+tar xvzf ./nco_4.7.1.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.7.1/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.7.1/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.7.1/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
 #export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-#cd ${DATA}/nco-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
+#cd ${DATA}/nco-4.7.1;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.7.1;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.7.1;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.7.0-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.7.1-1_*.deb
 cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
 # http://lintian.debian.org/full/zender@uci.edu.html
-lintian ${DATA}/nco_4.7.0-1_*.deb
-ls -l ${DATA}/nco_4.7.0*
+lintian ${DATA}/nco_4.7.1-1_*.deb
+ls -l ${DATA}/nco_4.7.1*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-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
+scp ${DATA}/nco_4.7.1* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.7.1* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 # NB: Make sure RPMs build before uploading to debian, since changing
 # Debian versions is a PITA
 # NB: Only upload pbuilder Debian Sid (not personal Ubuntu) .deb builds to Debian mentors
-# cd ${DATA};dupload -t mentors nco_4.7.0-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.7.1-1_*.changes
 bsrc # Reset shell environment for regular development
 
 # New build system #2
@@ -202,52 +202,52 @@ DIST=sid sudo pbuilder update # Update chroot before building package in it
 # dget http://ftp.debian.org/debian/pool/main/n/nco/nco_3.9.0-1.dsc
 # dget http://ftp.debian.org/debian/pool/main/n/netcdf/netcdf_3.6.1-1.dsc
 # apt-get source nco # Get package source
-sudo /bin/rm /var/cache/pbuilder/result/nco_4.7.0* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.7.1* # Cleanup prior build
 # To pass DEB_BUILD_OPTIONS to pbuilder while using sudo, one must first
 # modify sudoers with visudo to prevent sudo from resetting environment
 #export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-cd ${DATA};DIST=sid sudo pbuilder build nco_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
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.7.1-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.7.1-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.7.1-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.7.0-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.7.1-1_*.deb
 cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
 # NB: Upload pbuilder Debian Sid packages to Debian mentors, but not
 # to personal or NCO websites since most people use Ubuntu not Debian
 # NB: Debian versions are a PITA, ensure RPMs build before uploading to Debian
-cd /var/cache/pbuilder/result;dupload -t mentors nco_4.7.0-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.7.1-1_*.changes
 
 # RPM builds as root
 export rpm_root='/usr/src/redhat'
 # export sudo_sng='' # sudo not-necessary when builing in user directories
 export sudo_sng='sudo' # sudo necessary when building in system directories
 cd ~/nco;cvc;cvu
-/bin/rm -rf ${DATA}/nco-4.7.0 ${DATA}/nco-4.7.0* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.7.1 ${DATA}/nco-4.7.1* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${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
+${rpm_root}/BUILD/nco-4.7.1 \
+${rpm_root}/RPMS/i386/nco-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.1-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.7.1.tar.gz \
+${rpm_root}/SPECS/nco-4.7.1.spec \
+${rpm_root}/SRPMS/nco-4.7.1-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.7.1-1 -d nco-4.7.1 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.7.1.spec
+tar cvzf ./nco-4.7.1.tar.gz --exclude='nco-4.7.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.1 
+${sudo_sng} /bin/cp ${DATA}/nco-4.7.1.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.7.0.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.7.1.spec > ~/foo.nco 2>&1
 scp \
-${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 \
+${rpm_root}/RPMS/i386/nco-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.1-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.7.1-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${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 \
+${rpm_root}/RPMS/i386/nco-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.7.1-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.7.1-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.7.1-?.src.rpm \
 zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 
 # RPM builds as user
@@ -256,33 +256,33 @@ zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 export rpm_root="${DATA}/rpm/nco"
 #cd ~/nco;cvc;cvu # This risks committing unwanted *.[ch]pp files
 mkdir -p ${DATA}/rpm/nco/TMP ${DATA}/rpm/nco/BUILD
-/bin/rm -rf ${DATA}/nco-4.7.0 ${DATA}/nco-4.7.0* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.7.1 ${DATA}/nco-4.7.1* # Cleanup last build
 /bin/rm -r -f \
-${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}
+${rpm_root}/nco-4.7.1-?.src.rpm \
+${rpm_root}/nco-4.7.1.spec \
+${rpm_root}/nco-4.7.1.tar.gz \
+${rpm_root}/*/nco-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.1-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.7.1-1 -d nco-4.7.1 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -dnco-4.7.1 nco # Export most recent and build as 4.7.1-1
+tar cvzf ./nco-4.7.1.tar.gz --exclude='nco-4.7.1/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.7.1 
+/bin/cp ${DATA}/nco-4.7.1.tar.gz ${rpm_root}
 ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/nco.spec
 cd ${rpm_root}
 rpmbuild -ba --sign nco.spec > ~/foo.nco 2>&1
-rpmlint ${rpm_root}/*/nco-4.7.0-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.7.1-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.7.0-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.7.1-?.*.rpm
 scp \
-${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 \
+${rpm_root}/*/nco-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.1-?.*.rpm \
+${rpm_root}/nco-4.7.1-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${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 \
+${rpm_root}/*/nco-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.7.1-?.*.rpm \
+${rpm_root}/*/nco-devel-4.7.1-?.*.rpm \
+${rpm_root}/nco-4.7.1-?.*.src.rpm \
 zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
diff --git a/doc/index.shtml b/doc/index.shtml
index 0877603..962f3ad 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.7.0 released <!--#flastmod file="src/nco-4.7.0.tar.gz"-->
+Current stable NCO version is 4.7.1 released <!--#flastmod file="src/nco-4.7.1.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,7 +149,8 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2017 Dec ??: 4.7.1 <i>In Progress...</i>
+<li>2017 Jan ??: 4.7.2 <i>In Progress...</i>
+<li>2017 Dec 21: 4.7.1 Conda Windows port
 <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
@@ -182,10 +183,10 @@ command-line programs that take
 <a href="http://www.unidata.ucar.edu/netcdf">netCDF</a>,
 <a href="http://hdfgroup.org">HDF</a>, and/or
 <a href="http://opendap.org">DAP</a>
-files as input, then operate (e.g., derive new data, compute
-statistics, print, hyperslab, manipulate metadata) and output the
-results to screen or files in text, binary, or netCDF formats.
-NCO aids analysis of gridded scientific data.  
+files as input, then operate (e.g., derive new fields, compute
+statistics, print, hyperslab, manipulate metadata, regrid) and output
+the results to screen or files in text, binary, or netCDF formats.
+NCO aids analysis of gridded and unstructured scientific data.  
 The shell-command style of NCO allows users to manipulate and analyze
 files interactively, or with expressive scripts that avoid some
 overhead of higher-level programming environments.  
@@ -253,8 +254,8 @@ special cases.
 
 <p><hr width="100%"></p>
 
-<!-- http://nco.sf.net#Contribute -->
-<dt><a name="Contribute"></a></dt>
+<a name="Contribute"></a> <!-- http://nco.sf.net#Contribute -->
+<a name="contribute"></a> <!-- http://nco.sf.net#contribute -->
 <h2>How to Contribute: Volunteer, Endorse, or Donate</h2>
 <p>NCO has always (since 1995) been GPL'd Open Source.
 <a href="http://sf.net">SourceForge.net</a> started hosting NCO 
@@ -616,18 +617,23 @@ 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.7.0 http://github.com/nco/nco.git nco-4.7.0</tt></a>.
+<tt>git clone -b 4.7.1 http://github.com/nco/nco.git nco-4.7.1</tt></a>.
 <ul>
-<li><b>NCO 4.7.2</b>: (<i>Future</i>)
+<li><b>NCO 4.7.3</b>: (<i>Future</i>)
 Chunking bytes not elements;
 extensive hashing?;
 netCDF4 compound types?;</li>
-<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;
+<li><b>NCO 4.7.2</b>: (<i>In Progress, features in-progress or complete include</i>) 
 <tt>ncclimo -v</tt> splitter support for regular expressions;
 <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>)
+<li><b>NCO 4.7.1</b>: (<i>Current Stable Release</i>)
+Conda Windows port;
+<tt>ncclimo --clm_md=dly/ann</tt> fix;
+JSON tweaks;</li>
+<li><b>NCO 4.7.0</b>: 
+CMake build-engine intrinsic math, networking support on MS Windows;
+<tt>ncclimo/ncremap --fl_fmt</tt> options;
 <tt>ncclimo/ncremap --dfl_lvl</tt> compression;
 <tt>ncclimo --ppc</tt> compression;
 <tt>ncra/ncrcat</tt> fix negative hyperslab off-by-one error;</li>
@@ -751,15 +757,15 @@ cross-platform Python environment that utilizes the <tt>conda</tt> package manag
 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>.
+Up-to-date Anaconda-compatible versions of NCO for Linux, MacOS, and 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
 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.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.
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-4.7.1</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+Thanks to Rich Signell, Filipe Fernandes, Pedro Vicente, and others for developing and maintaining the NCO package for conda.
 </ul>
 
 <a name="debian"></a><a name="dbn"></a> <!-- http://nco.sf.net#debian -->
@@ -767,7 +773,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.7.0</a></li>
+<li><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux-compatible Intel systems, prebuilt binary executable <a href="http://www.debian.org">deb</a>: <a href="http://packages.debian.org/testing/math/nco.html">nco-4.7.1</a></li>
 -->
 <a href="http://packages.debian.org/unstable/science/nco">Debian NCO</a> and 
 <a href="https://launchpad.net/ubuntu/+source/nco">Ubuntu NCO</a> homepages.
@@ -775,8 +781,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.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>
+<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_4.7.1-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/4.7.1-1">nco_4.7.1-1_amd64.deb</a> : Executables AMD64-compatible</li>
 Thanks to Daniel Baumann, Sebastian Couwenberg, Barry deFreese, Francesco Lovergine, 
 Brian Mays, Rorik Peterson, and Matej Vela for their help packaging
 NCO for Debian over the years. 
@@ -820,10 +826,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
 <!-- 
 # Mac OS X 10.12 (Sierra) systems (aerosol):
 /usr/bin/scp ~/nco/doc/index.shtml zender,nco at web.sf.net:/home/project-web/nco/htdocs
-cd ~/bin;tar cvzf ${DATA}/nco-4.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
+cd ~/bin;tar cvzf ${DATA}/nco-4.7.1.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.7.1.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.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"-->). 
+<li><a href="src/nco-4.7.1.macosx.10.12.tar.gz">nco-4.7.1.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.7.1.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.7.1.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>
@@ -1018,12 +1024,12 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- 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"--> 
+<!-- scp ${DATA}/nco-4.7.1.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/4.7.1.tar.gz">nco-4.7.1.tar.gz</a> 
+(<!--#fsize file="src/nco-4.7.1.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-4.7.1.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-4.7.1.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha256 src/nco-4.7.1.tar.gz"--> 
 </li>
 </ul>
 
@@ -1042,8 +1048,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.7.0</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.7.0</tt></p>
+then checks out NCO version <tt>4.7.1</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.7.1</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
@@ -1051,9 +1057,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.7.0</tt>) and the development version is that the
+(e.g., <tt>4.7.1</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.7.0</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.7.1</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.
@@ -1078,6 +1084,7 @@ Source documentation for NCO and netCDF4(alpha13)</a></li>
 <!-- http://nco.sf.net#bld -->
 <dt><a name="Rqr"></a><a name="rqr"></a></dt> <!-- http://nco.sf.net#rqr -->
 <dt><a name="bld"></a></dt> <!-- http://nco.sf.net#bld -->
+<dt><a name="build"></a></dt> <!-- http://nco.sf.net#build -->
 <dt><a name="cmp"></a></dt> <!-- http://nco.sf.net#cmp -->
 <h2>Compilation Requirements</h2>
 
@@ -1178,6 +1185,7 @@ For Mac OS X with MacPorts:
 <dt>sudo port install libdap # DAP</dt>
 <dt>sudo port install gsl # GSL</dt>
 <dt>sudo port install netcdf # netCDF</dt>
+<dt>sudo port install netcdf-fortran +gcc7 # netCDF for ESMF</dt>
 <dt>sudo port install udunits2 # UDUnits</dt>
 </tt>
 Without MacPorts, the system TeXInfo may be too old to build the
@@ -1199,9 +1207,9 @@ As of 20131101 there is no Cygwin package for ANTLR, and the netCDF package does
 
 <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.7.0.tar.gz</dt>
-<dt>tar xvzf 4.7.0.tar.gz</dt>
-<dt>cd nco-4.7.0</dt>
+<dt>wget https://github.com/nco/nco/archive/4.7.1.tar.gz</dt>
+<dt>tar xvzf 4.7.1.tar.gz</dt>
+<dt>cd nco-4.7.1</dt>
 <dt>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1210,8 +1218,7 @@ As of 20131101 there is no Cygwin package for ANTLR, and the netCDF package does
 </tt>
 <dt><a name="cmake"></a></dt> <!-- http://nco.sf.net#cmake -->
 <dt><a name="CMake"></a></dt> <!-- http://nco.sf.net#CMake -->
-<li>The CMake-equivalent to the autoconf/configure build-engine
-  example above is:
+<li>The CMake-equivalent to the autoconf/configure build-engine example above is:
 <tt>
 <dt>cd ~/nco/cmake</dt>
 <dt>cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local</dt>
@@ -1254,7 +1261,7 @@ For more sophisticated build/install options, see the next section.
 <dt><a name="Makefile"></a></dt> <!-- http://nco.sf.net#Makefile -->
 <dt><a name="hnt"></a></dt> <!-- http://nco.sf.net#hnt -->
 <dt><a name="bld_hnt"></a></dt> <!-- http://nco.sf.net#bld_hnt -->
-Still having trouble building NCO from source? Read these 
+Still having trouble building NCO from source? Read these (much older)
 <a href="./build_hints.shtml">Build Hints</a>
 
 </ul>
diff --git a/doc/nco.texi b/doc/nco.texi
index 6c73a85..32b38b3 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.7.0
- at set doc-edition 4.7.0
+ at set nco-edition 4.7.1
+ at set doc-edition 4.7.1
 @set copyright-years 1995--2017
 @set update-year 2017
- at set update-date 7 November 2017
- at set update-month November 2017
+ at set update-date 21 December 2017
+ at set update-month December 2017
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -996,6 +996,11 @@ distribution of @acronym{NCO}.
 
 @cindex C99
 @cindex CMake
+ at html
+<a name="CMake"></a> <!-- http://nco.sf.net/nco.html#CMake -->
+<a name="cmake"></a> <!-- http://nco.sf.net/nco.html#cmake -->
+<a name="cmk"></a> <!-- http://nco.sf.net/nco.html#cmk -->
+ at end html
 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
@@ -1006,11 +1011,32 @@ Windows executables with CMake:
 @verbatim
 cd ~/nco/cmake
 cmake .. -DCMAKE_INSTALL_PREFIX=${HOME}
+make install
 @end verbatim
 @end example
 The file @file{nco/cmake/build.bat} shows how deal with various path
 issues. 
 
+ at cindex Anaconda
+ at cindex Conda
+ at html
+<a name="anaconda"></a> <!-- http://nco.sf.net/nco.html#anaconda -->
+<a name="cnd"></a> <!-- http://nco.sf.net/nco.html#cnd -->
+<a name="conda"></a> <!-- http://nco.sf.net/nco.html#conda -->
+ at end html
+As of @acronym{NCO} version 4.7.1 (September, 2017) the Conda package
+for @acronym{NCO} is available from the @code{conda-forge} channel on
+all three smithies: Linux, MacOS, and Windows. 
+ at example
+ at verbatim
+# Recommended install with Conda
+conda config --add channels conda-forge # Permananently add conda-forge
+conda install nco
+# Or, specify conda-forge explicitly as a one-off:
+conda install -c conda-forge nco
+ at end verbatim
+ at end example
+
 Using the freely available Cygwin (formerly gnu-win32) development
 environment  
 @footnote{The Cygwin package is available from@*
@@ -2101,8 +2127,7 @@ numerous or their names are too lengthy (when strung together as a
 single argument) to be passed by the calling shell to the @acronym{NCO}
 operator
 @footnote{The exact length which exceeds the operating system internal
-limit for command line lengths varies from @acronym{OS} to @acronym{OS}
-and from shell to shell.  
+limit for command line lengths varies across @acronym{OS}s and shells.
 @acronym{GNU} @code{bash} may not have any arbitrary fixed limits to the
 size of command line arguments. 
 Many @acronym{OS}s cannot handle command line arguments (including
@@ -7930,7 +7955,7 @@ Dataset chunking issues are described by @acronym{THG} and Unidata
 and
 @uref{http://www.unidata.ucar.edu/blogs/developer/en/entry/chunking_data_choosing_shapes,here}.
 @acronym{NCO} authors are working on generalized algorithms and
-applications of chunking strategies (stay tuned for more in 2017).
+applications of chunking strategies (stay tuned for more in 2018).
 
 @html
 <a name="chunk_cache"></a> <!-- http://nco.sf.net/nco.html#chunk_cache -->
@@ -17320,6 +17345,7 @@ The value @samp{dly} is used for all input files whose temporal
 resolution is daily or finer.
 The data could be a daily average, or diurnally-resolved, e.g.,
 3-hourly. 
+
 The climatology generator and splitter do not require that daily-mode
 input files begin or end on daily boundaries.
 These tools hyperslab the input files using the date information
@@ -17327,6 +17353,24 @@ required to performed their analysis.
 This facilitates analyzing datasets with varying numbers of days per
 input file.
 
+ at cindex @code{stdin}
+ at cindex @command{crontab}
+ at cindex @code{nohup}
+ at cindex Python
+Explicitly specifying @samp{--clm_md=mth} serves a secondary purpose,
+namely invoking the default setting on systems that control
+ at code{stdin}.
+When @command{ncclimo} detects that @code{stdin} is not attached to the
+terminal (keyboard) it automatically expects a list of files on
+ at code{stdin}. 
+Some environments, however, hijack @code{stdin} for their purposes
+and thereby confuse @code{ncclimo} into expecting a list argument.
+Users have encountered this issue when attempting to run
+ at command{ncclimo} in Python parallel environments, via inclusion in 
+ at command{crontab}, and in @command{nohup}-mode (whatever that is!).
+In such cases, explicitly specify @samp{--clm_md=mth} (or @code{ann} or
+ at code{day}) to persuade @command{ncclimo} to run a normal climatology.
+
 @cindex @code{-c @var{caseid}}
 @cindex @var{caseid}
 @cindex @code{--caseid}
@@ -17732,6 +17776,8 @@ ncclimo --seasons=jfm,jas,ann ...     # Monthly + JFM,JAS,ANN
 ncclimo --seasons=fm,on ...           # Monthly + FM,ON
 @end example
 
+ at cindex @acronym{SLURM}
+ at cindex @acronym{PBS}
 @cindex @code{--stdin}
 @cindex @code{--inp_std}
 @cindex @code{--std_flg}
@@ -17753,7 +17799,15 @@ non-interactive batch jobs on @acronym{PBS} when the input files
 are piped to @code{stdin}, and on @acronym{SLURM} when the input files 
 are redirected from a file to @code{stdin}.
 Using this switch in any other context (e.g., interactive shells) is
-optional. 
+optional.
+
+In some other non-interactive environments (e.g., @command{crontab},
+ at code{nohup}), @command{ncclimo} may mistakenly expect input to be
+provided on @code{stdin} simply because the environment is using
+ at code{stdin} for other purposes.
+In such cases users may persuade @command{ncclimo} to @emph{ignore}
+ at code{stdin} by explicitly invoking the @samp{--clm_md} option
+(described above).
 
 @cindex @code{-t @var{thr_nbr}}
 @cindex @var{thr_nbr}
@@ -19642,21 +19696,37 @@ Features common to many operators are described in
 @end html
 @cindex alphabetization
 @cindex sort alphabetically
- at cindex @code{-a}
 @cindex @code{--abc}
 @cindex @code{--alphabetize}
+ at cindex @code{--no_abc}
+ at cindex @code{--no_alphabetize}
+ at cindex @code{--no-abc}
+ at cindex @code{--no-alphabetize}
 @item -a
-Do not alphabetize extracted fields. 
-By default, the specified output variables are extracted, printed, and
-written to disk in alphabetical order.
+Switches @samp{-a}, @samp{--abc}, and @samp{--alphabetize}
+ at emph{turn-off} the default alphbetization of extracted fields in
+ at command{ncks} only.
+These switches are misleadingly named and were deprecated in
+ at command{ncks} as of @acronym{NCO} version 4.7.1 (December, 2017).  
+
+This is the default behavior so these switches are no-ops included only
+for completeness.
+By default, @acronym{NCO} extracts, prints, and writes specified output
+variables to disk in alphabetical order. 
 This tends to make long output lists easier to search for particular
 variables. 
-Specifying @code{-a} results in the variables being extracted, printed,
-and written to disk in the order in which they were saved in the input
-file.
-Thus @code{-a} retains the original (often non-alphabetic) variable
-ordering.
-Also @samp{--abc} and @samp{--alphabetize}.
+Again, no option is necessary to write output in alphabetical order.
+Until @acronym{NCO} version 4.7.1 (December, 2017), @command{ncks}
+used the @code{-a}, @code{--abc}, or @code{--alphabetize} switches to
+ at emph{turn-off} the default alphabetization.
+These names were counter-intuitive and needlessly confusing.
+As of @acronym{NCO} version 4.7.1, @command{ncks} uses the new switches
+ at code{--no_abc}, @code{--no-abc}, @code{--no_alphabetize}, or
+ at code{--no-alphabetize}, all of which are equivalent.
+The @code{--abc} and @code{--alphabetize} switches are now no-ops,
+i.e., they write the output in the unsorted order of the input.
+The @code{-a} switch is now completely deprecated in favor of the
+clearer long option switches.
 
 @html
 <a name="bnr"></a> <!-- http://nco.sf.net/nco.html#bnr -->
@@ -23816,12 +23886,15 @@ 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
+Oddly this issue shows that simultaneously renaming a dimension and
+coordinate can succeed (in contrast to a bug described above), and that
+separating that into two steps can fail.
 The workaround is to convert to netCDF3, then rename, then convert back
 to netCDF4.
 @example
 @verbatim
 # Demonstrate bug in netCDF4 library versions 4.4.1--4.5.0+
+# 20171107: https://github.com/Unidata/netcdf-c/issues/597
 # 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
@@ -24521,6 +24594,7 @@ OPeNDAP configuration.
 @item Pedro Vicente
 Windows Visual Studio support.
 netCDF4 groups.
+CMake build-engine.
 @cindex Jerome Mao
 @item Jerome Mao
 Multi-argument parsing.
@@ -24575,10 +24649,11 @@ Large work-load testing
 @item Dave Blodgett, Peter Campbell, Martin Dix, Mark Flanner, Markus Liebig, Keith Lindsay, Mike Page, Martin Schmidt, Michael Schulz, Lori Sentman, Rich Signell, Bob Simons, Gary Strand, Adrian Tompkins, George White Andrew Wittenberg, Remik Ziemlinski
 Excellent bug reports and feature requests.
 @cindex Filipe Fernandes
+ at cindex Isuru Fernando
 @cindex Hugo Oliveira
 @cindex Rich Signell
 @cindex Kyle Wilcox
- at item Filipe Fernandes, Hugo Oliveira, Rich Signell, Kyle Wilcox
+ at item Filipe Fernandes, Isuru Fernando, Hugo Oliveira, Rich Signell, Kyle Wilcox
 Anaconda packaging
 @cindex Daniel Baumann
 @cindex Nick Bower
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index 7d02c2a..68e230d 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -1683,6 +1683,8 @@ var_sct * bsc_cls::getdims_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_
       fmc_vtr.push_back( fmc_cls("pow",this,(int)PPOW));
       fmc_vtr.push_back( fmc_cls("atan2",this,(int)PATAN2));
       fmc_vtr.push_back( fmc_cls("convert",this,(int)PCONVERT));
+      fmc_vtr.push_back( fmc_cls("xratio",this,(int)PXRATIO));
+      fmc_vtr.push_back( fmc_cls("solar_zenith_angle",this,(int)PSOLARZENITHANGLE));
     }
   }
 
@@ -1754,23 +1756,293 @@ var_sct * bsc_cls::getdims_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_
       var=ncap_var_var_op(var1,var2,ATAN2);
         break;                
 
-    case PCONVERT:          
-      if(prs_arg->ntl_scn){
-        var=ncap_var_udf("~mth2_cls");  
-       }else{
-
-        /* Change type to int */
-        int c_typ;
-        var2=nco_var_cnf_typ(NC_INT,var2);
-        (void)cast_void_nctype(NC_INT,&var2->val);
-        c_typ=var2->val.ip[0];      
-        (void)cast_nctype_void(NC_INT,&var2->val);
-        var2=nco_var_free(var2);
+      case PCONVERT:          
+        if(prs_arg->ntl_scn){
+          var=ncap_var_udf("~mth2_cls");  
+        }else{
 
-        var=nco_var_cnf_typ( (nc_type)c_typ, var1);
-      } 
+          /* Change type to int */
+          int c_typ;
+          var2=nco_var_cnf_typ(NC_INT,var2);
+          (void)cast_void_nctype(NC_INT,&var2->val);
+          c_typ=var2->val.ip[0];      
+          (void)cast_nctype_void(NC_INT,&var2->val);
+          var2=nco_var_free(var2);
+
+          var=nco_var_cnf_typ( (nc_type)c_typ, var1);
+        } 
         break;
-         
+      
+      case  PXRATIO: 
+	if( var1->type == NC_DOUBLE || var2->type == NC_DOUBLE )
+	{       
+            var1=nco_var_cnf_typ( NC_DOUBLE, var1);
+            var2=nco_var_cnf_typ( NC_DOUBLE, var2);
+        }
+        else if ( var1->type == NC_FLOAT || var2->type == NC_FLOAT )
+	{        
+            var1=nco_var_cnf_typ( NC_FLOAT, var1);
+            var2=nco_var_cnf_typ( NC_FLOAT, var2);
+        }
+        else 
+	{    
+            var1=nco_var_cnf_typ( NC_DOUBLE, var1);
+            var2=nco_var_cnf_typ( NC_DOUBLE, var2);
+        }  
+
+
+        var=nco_var_dpl(var1);      
+
+        if(prs_arg->ntl_scn)
+	{                    
+          var1=nco_var_free(var1);  
+	  var2=nco_var_free(var2);
+
+        }
+        else 
+	{ // start heavy lifting      
+
+	  if(var1->sz != var2->sz)
+          {
+            std::string serr;
+	    serr="For  this function to succeed Operands must have same number of elements \n"+susg;               
+            err_prn(sfnm,serr);
+          }  
+
+          (void)cast_void_nctype(var->type,&var->val);      
+          (void)cast_void_nctype(var1->type,&var1->val);      
+          (void)cast_void_nctype(var2->type,&var2->val);
+
+          // FLOAT      
+          if(var1->type == NC_FLOAT)   
+	  {
+	    nco_bool has_mss;
+            long idx;
+            long sz;         
+            float mss_flt;  
+            float *fp;     
+            float *fp1;
+            float *fp2;
+                          
+            fp=var->val.fp;
+            fp1=var1->val.fp;
+            fp2=var2->val.fp;
+                             
+
+            has_mss=False;         
+            if( var1->has_mss_val)
+	    {       
+	      has_mss=True; 
+              mss_flt=var1->mss_val.fp[0];  
+
+            }   
+            else if(var2->has_mss_val)
+	    { 
+              has_mss=True;       
+              mss_flt=var2->mss_val.fp[0];        
+              nco_mss_val_cp(var2,var);
+
+            }   
+
+            sz=var1->sz;   
+              
+            if( has_mss)      
+	    {   
+              for(idx=0 ; idx<sz ; idx++)   
+                if( fp1[idx] == mss_flt || fp2[idx]== mss_flt ) 
+                  fp[idx]=mss_flt;
+                else       
+		  fp[idx] = ( fp1[idx] - fp2[idx] ) /  ( fp1[idx] + fp2[idx] ) ;     
+
+	    }    
+            else
+	    {  
+              for(idx=0 ; idx<sz ; idx++)   
+		fp[idx]= ( fp1[idx] - fp2[idx] ) /  ( fp1[idx] + fp2[idx] ) ;     
+
+
+
+
+            }
+       
+
+	  }       
+
+
+          // DOUBLE
+          if(var1->type == NC_DOUBLE)   
+	  {
+	    nco_bool has_mss;
+            long idx;
+            long sz;         
+            double mss_dbl;  
+            double *dp;     
+            double *dp1;
+            double *dp2;
+                          
+            
+            dp=var->val.dp;
+            dp1=var1->val.dp;
+            dp2=var2->val.dp;
+                             
+
+            has_mss=False;         
+            if( var1->has_mss_val)
+	    {       
+	      has_mss=True; 
+              mss_dbl=var1->mss_val.dp[0];  
+
+            }   
+            else if(var2->has_mss_val)
+	    { 
+              has_mss=True;       
+              mss_dbl=var2->mss_val.dp[0];        
+              nco_mss_val_cp(var2,var);
+              // var->has_mss_val=True;   
+               
+            }   
+
+            sz=var1->sz;   
+              
+            if( has_mss)      
+	    {   
+              for(idx=0 ; idx<sz ; idx++)   
+                if( dp1[idx] == mss_dbl || dp2[idx]== mss_dbl ) 
+                  dp[idx]=mss_dbl;
+                else       
+		  dp[idx] = ( dp1[idx] - dp2[idx] ) /  ( dp1[idx] + dp2[idx] ) ;     
+
+	    }    
+            else
+	    {  
+              for(idx=0 ; idx<sz ; idx++)   
+		dp[idx]= ( dp1[idx] - dp2[idx] ) /  ( dp1[idx] + dp2[idx] ) ;     
+
+
+
+
+            }
+       
+
+	  }       
+
+            (void)cast_nctype_void(var->type,&var->val);      
+            (void)cast_nctype_void(var1->type,&var1->val);      
+            (void)cast_nctype_void(var2->type,&var2->val);    
+            var1=nco_var_free(var1);  
+	    var2=nco_var_free(var2);
+
+
+
+
+	}  
+        break;
+
+
+       case PSOLARZENITHANGLE:
+	 { 
+           // convert all args to type double              
+           var1=nco_var_cnf_typ( NC_FLOAT, var1);
+           var2=nco_var_cnf_typ( NC_FLOAT, var2);
+
+           var=nco_var_dpl(var1);
+
+           if(!prs_arg->ntl_scn)       
+	   {    
+             long idx;
+             long sz; 
+             float *z_fp; 
+	     float *tm_fp;   // array of times 
+             float  lat_flt; // latitude in degrees
+             float cosSZA;      
+             char units_sng[200]={0};             
+             char units_new_sng[200]={0};
+
+             //grab units atts for var1->nm
+             // fixme:(2017-11-20)   for now not reading calendar type of var1->nm: assume it is cln_std            
+             {  
+
+               var_sct *var_att=NULL_CEWI;
+               NcapVar *Nvar=NULL;
+	       std::string att_nm; 
+               tm_cln_sct lcl_tm_sct;      
+
+	       att_nm=std::string(var1->nm)+ "@units";       
+	       Nvar=prs_arg->var_vtr.find(att_nm);
+
+	       if(Nvar !=NULL)
+		 var_att=nco_var_dpl(Nvar->var);
+	       else    
+		 var_att=ncap_att_init(att_nm,prs_arg);
+
+	       if(var_att == NULL_CEWI )
+		 err_prn(fnc_nm,"Unable to locate attribute " +att_nm+ " in input or output files.");
+	       if(var_att->type != NC_CHAR && var_att->type != NC_STRING)
+		 err_prn(fnc_nm,"The NC type for "+ att_nm+ " must be NC_CHAR or NC_STRING");
+
+	       (void)cast_void_nctype(var_att->type,&var_att->val); 
+  
+	       // copy string - no need for NULL as units_sng is all nulls     
+               if( var_att->type == NC_CHAR) 
+	          strncpy(units_sng,var_att->val.cp,var_att->sz); 
+               else if(var_att->type==NC_STRING)
+		  strcpy(units_sng, var_att->val.sngp[0]);   
+        
+	       (void)cast_nctype_void(var_att->type,&var_att->val);    
+	       var_att=nco_var_free(var_att); 
+
+               // we want the time coord to be "days since start of year" 
+               // need to parse the date string to extract the year
+               if( nco_cln_prs_tm(units_sng, &lcl_tm_sct) != NCO_NOERR)              
+                 err_prn(fnc_nm, "Error trying to parse the units string " + std::string(units_sng) + " \n"); 
+
+               // assemble new units string
+               sprintf(units_new_sng,"days since %d-01-01 00:00:00", lcl_tm_sct.year);           
+ 
+             }   
+                 
+             // convert var1 from units_sng  units_new_sng that is calendar_day_of_year; 
+             // nb calendar is cln_std for now       
+             (void)nco_cln_clc_dbl_var_dff(units_sng,units_new_sng, cln_std, (double*)NULL, var1); 
+
+             (void)cast_void_nctype(var->type,&var->val);      
+             (void)cast_void_nctype(var1->type,&var1->val);      
+             (void)cast_void_nctype(var2->type,&var2->val);
+
+	  
+             z_fp=var->val.fp;    
+             tm_fp=var1->val.fp;    
+
+             lat_flt=var2->val.fp[0];
+        
+             // convert lat_dbl to radians    
+             lat_flt *=  M_PI /180.0f;      
+
+             sz=var1->sz;
+    
+             for(idx=0;idx<sz;idx++)
+	     {                          
+               cosSZA=-1;;
+	       (void)solar_geometry( lat_flt, tm_fp[idx], 1, (float *)NULL, &cosSZA, (float *)NULL);
+               // convert back to degree's 
+               z_fp[idx]=180.0f/ M_PI *  acos( cosSZA);                      
+
+             } 
+
+
+            (void)cast_nctype_void(var->type,&var->val);      
+            (void)cast_nctype_void(var1->type,&var1->val);      
+            (void)cast_nctype_void(var2->type,&var2->val);      
+
+
+
+           }  
+           var1=nco_var_free(var1);   
+           var2=nco_var_free(var2);   
+    
+         } 
+         break; 
+
 
     }
       
@@ -1779,6 +2051,62 @@ var_sct * bsc_cls::getdims_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_
   }
 
 
+
+void mth2_cls::solar_geometry(float latitude_rad, float calendar_day_of_year, int num_long, float *local_time, float *cosSZA, float *eccentricity_factor)
+{
+
+  float cos_lat;
+  float cos_delta;
+  float cphase;
+  float delta;
+  float phi;
+  float sin_lat;
+  float sin_delta;
+  float theta;
+  float eccentricity;
+
+  int ilong;
+
+  int days_per_year=365;
+
+  /* compute eccentricity factor (sun-earth distance factor) */
+  theta=2.0*M_PI*calendar_day_of_year/days_per_year;
+  eccentricity=1.000110+.034221*cos(theta)+0.001280*sin(theta)+ 0.000719*cos(2.*theta)+0.000077*sin(2.*theta);
+
+  /* solar declination in radians: */
+  delta=0.006918-0.399912*cos(theta)+0.070257*sin(theta)- 0.006758*cos(2.*theta)+0.000907*sin(2.*theta)- 0.002697*cos(3.*theta)+0.001480*sin(3.*theta);
+
+  /* compute local cosine solar zenith angle: */
+  sin_lat=sin(latitude_rad);
+  sin_delta=sin(delta);
+  cos_lat=cos(latitude_rad);
+  cos_delta=cos(delta);
+
+  /* calendar_day_of_year is the calender day for greenwich, including fraction
+     of day; the fraction of the day represents a local time at
+     greenwich; to adjust this to produce a true instantaneous time
+     for other longitudes, we must correct for the local time change: */
+
+  for(ilong=1;ilong<=num_long;ilong++)
+  {
+    phi=calendar_day_of_year+((float)(ilong-1)/(float)(num_long));
+    cphase=cos(2.0*M_PI*phi);
+
+    if( cosSZA != NULL)
+      cosSZA[ilong-1]=sin_lat*sin_delta-cos_lat*cos_delta*cphase;
+
+    if( local_time != NULL)   
+      local_time[ilong-1]=12.0*acos(cphase)/M_PI;
+
+    if(eccentricity_factor != NULL)
+      eccentricity_factor[ilong-1]=eccentricity;
+  }
+
+  return;
+}
+
+
+
 //PDQ Functions /******************************************/
   pdq_cls::pdq_cls(bool flg_dbg){
     //Populate only on first constructor call
diff --git a/src/nco++/fmc_all_cls.hh b/src/nco++/fmc_all_cls.hh
index 0bf922a..5338a55 100644
--- a/src/nco++/fmc_all_cls.hh
+++ b/src/nco++/fmc_all_cls.hh
@@ -30,7 +30,8 @@
   /* Basic math: acos, asin, atan, cos, exp, fabs, log, log10, sin, sqrt, tan */
   
   /* GNU g++ barfs at these float declartions -- remove if g++ used */
-#ifndef __GNUG__
+  /* MSVC complains because dllimport is not used */
+#if !defined(__GNUG__) && !defined(_MSC_VER)
   extern float acosf(float);
   extern float asinf(float);
   extern float atanf(float);
@@ -133,11 +134,13 @@ public:
 //Maths2 - Maths functions that take 2 args /*********/
 class mth2_cls: public vtl_cls {
 private:
-   enum {PPOW,PATAN2,PCONVERT};
+  enum {PPOW,PATAN2,PCONVERT, PXRATIO, PSOLARZENITHANGLE};
    bool _flg_dbg;
 public:
   mth2_cls(bool flg_dbg);
   var_sct *fnd(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker);
+  void solar_geometry(float latitude_rad, float calendar_day_of_year, int num_longitudes, float *local_time, float *cosSZA, float *eccentricity_factor);
+
 };
 
 //PDQ Functions /****************************************/
diff --git a/src/nco++/ncap2_utl.cc b/src/nco++/ncap2_utl.cc
index 87d9b62..0e6b1af 100644
--- a/src/nco++/ncap2_utl.cc
+++ b/src/nco++/ncap2_utl.cc
@@ -751,14 +751,14 @@ ncap_var_stretch /* [fnc] Stretch variables */
     char *var_lsr_cp;
     char *var_lsr_out_cp;
     
-    int idx_var_lsr_var_gtr[NC_MAX_DIMS];
+    int idx_var_lsr_var_gtr[NC_MAX_VAR_DIMS];
     int var_lsr_nbr_dim;
     int var_gtr_nbr_dmn_m1;
     
     long *var_gtr_cnt;
-    long dmn_ss[NC_MAX_DIMS];
-    long dmn_var_gtr_map[NC_MAX_DIMS];
-    long dmn_var_lsr_map[NC_MAX_DIMS];
+    long dmn_ss[NC_MAX_VAR_DIMS];
+    long dmn_var_gtr_map[NC_MAX_VAR_DIMS];
+    long dmn_var_lsr_map[NC_MAX_VAR_DIMS];
     long var_gtr_lmn;
     long var_lsr_lmn;
     long var_gtr_sz;
@@ -1021,8 +1021,8 @@ var_sct* var2)
   int sz1=0;
   int sz2=0;
 
-  long cnt1[NC_MAX_DIMS];
-  long cnt2[NC_MAX_DIMS];
+  long cnt1[NC_MAX_VAR_DIMS];
+  long cnt2[NC_MAX_VAR_DIMS];
   
   for(idx=0; idx<var1->nbr_dim; idx++)
     if( var1->cnt[idx]>1 )
diff --git a/src/nco++/ncoGrammer.g b/src/nco++/ncoGrammer.g
index e0449fc..d894e57 100644
--- a/src/nco++/ncoGrammer.g
+++ b/src/nco++/ncoGrammer.g
@@ -3510,7 +3510,7 @@ var_sct *var_nbr;
               int fl_id;
               int nbr_dim=var_rhs->nbr_dim;
               long srt; 
-              long srt1[NC_MAX_DIMS];   
+              long srt1[NC_MAX_VAR_DIMS];   
               long sz_dim=1;
               NcapVar *Nvar;
 
@@ -3721,7 +3721,7 @@ var_sct *var_nbr;
                 // write block
                 { 
                  int nbr_dim=var_lhs->nbr_dim;
-                 long srt1[NC_MAX_DIMS];   
+                 long srt1[NC_MAX_VAR_DIMS];   
                  long sz_dim=1; 
 
                  var_lhs->sz=1;
diff --git a/src/nco++/ncoTree.cpp b/src/nco++/ncoTree.cpp
index 83c0622..9909fc9 100644
--- a/src/nco++/ncoTree.cpp
+++ b/src/nco++/ncoTree.cpp
@@ -5284,7 +5284,7 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			int fl_id;
 			int nbr_dim=var_rhs->nbr_dim;
 			long srt; 
-			long srt1[NC_MAX_DIMS];   
+			long srt1[NC_MAX_VAR_DIMS];   
 			long sz_dim=1;
 			NcapVar *Nvar;
 			
@@ -5539,7 +5539,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			// write block
 			{ 
 			int nbr_dim=var_lhs->nbr_dim;
-			long srt1[NC_MAX_DIMS];   
+			long srt1[NC_MAX_VAR_DIMS];   
 			long sz_dim=1; 
 			
 			var_lhs->sz=1;
diff --git a/src/nco++/prs_cls.cc b/src/nco++/prs_cls.cc
index c944468..34fe728 100644
--- a/src/nco++/prs_cls.cc
+++ b/src/nco++/prs_cls.cc
@@ -467,7 +467,7 @@ prs_cls::ncap_var_write_omp(
       (void)nco_inq_format(out_id,&fl_fmt);
       if( (fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC) && var->nbr_dim > 0)
       {
-        dmn_cmn_sct cmn[NC_MAX_DIMS];
+        dmn_cmn_sct cmn[NC_MAX_VAR_DIMS];
         ncap_pop_dmn_cmn();
         ncap_pop_var_dmn_cmn(var, cmn);
         (void)nco_cnk_sz_set_trv(in_id,out_id,cnk_in, var->nm,cmn);
diff --git a/src/nco/ncap_utl.c b/src/nco/ncap_utl.c
index f48f62c..8f99b68 100644
--- a/src/nco/ncap_utl.c
+++ b/src/nco/ncap_utl.c
@@ -1260,14 +1260,14 @@ ncap_var_stretch /* [fnc] Stretch variables */
     char *var_lsr_cp;
     char *var_lsr_out_cp;
     
-    int idx_var_lsr_var_gtr[NC_MAX_DIMS];
+    int idx_var_lsr_var_gtr[NC_MAX_VAR_DIMS];
     int var_lsr_nbr_dim;
     int var_gtr_nbr_dmn_m1;
     
     long *var_gtr_cnt;
-    long dmn_ss[NC_MAX_DIMS];
-    long dmn_var_gtr_map[NC_MAX_DIMS];
-    long dmn_var_lsr_map[NC_MAX_DIMS];
+    long dmn_ss[NC_MAX_VAR_DIMS];
+    long dmn_var_gtr_map[NC_MAX_VAR_DIMS];
+    long dmn_var_lsr_map[NC_MAX_VAR_DIMS];
     long var_gtr_lmn;
     long var_lsr_lmn;
     long var_gtr_sz;
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index 200d2e7..b741b46 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -334,6 +334,10 @@ main(int argc,char **argv)
     {"mpi_implementation",no_argument,0,0},
     {"msa_usr_rdr",no_argument,0,0}, /* [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
     {"msa_user_order",no_argument,0,0}, /* [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
+    {"no_abc",no_argument,0,0},
+    {"no-abc",no_argument,0,0},
+    {"no_alphabetize",no_argument,0,0},
+    {"no-alphabetize",no_argument,0,0},
     {"no_blank",no_argument,0,0}, /* [flg] Print numeric missing values */
     {"no-blank",no_argument,0,0}, /* [flg] Print numeric missing values */
     {"noblank",no_argument,0,0}, /* [flg] Print numeric missing values */
@@ -673,6 +677,7 @@ main(int argc,char **argv)
       } /* endif "md5_wrt_att" */
       if(!strcmp(opt_crr,"msa_usr_rdr") || !strcmp(opt_crr,"msa_user_order")) MSA_USR_RDR=True; /* [flg] Multi-Slab Algorithm returns hyperslabs in user-specified order */
       if(!strcmp(opt_crr,"mta_dlm") || !strcmp(opt_crr,"dlm_mta")) nco_mta_dlm_set(optarg);
+      if(!strcmp(opt_crr,"no_abc") || !strcmp(opt_crr,"no-abc") || !strcmp(opt_crr,"no_alphabetize") || !strcmp(opt_crr,"no-alphabetize")) ALPHABETIZE_OUTPUT=False;
       if(!strcmp(opt_crr,"no_blank") || !strcmp(opt_crr,"no-blank") || !strcmp(opt_crr,"noblank")) PRN_MSS_VAL_BLANK=!PRN_MSS_VAL_BLANK;
       if(!strcmp(opt_crr,"no_clb") || !strcmp(opt_crr,"no-clobber") || !strcmp(opt_crr,"no_clobber") || !strcmp(opt_crr,"noclobber")) FORCE_NOCLOBBER=!FORCE_NOCLOBBER;
       if(!strcmp(opt_crr,"no_nm_prn") || !strcmp(opt_crr,"no_dmn_var_nm")) PRN_DMN_VAR_NM=False; /* endif "no_nm_prn" */
@@ -794,8 +799,9 @@ main(int argc,char **argv)
     case 'A': /* Toggle FORCE_APPEND */
       FORCE_APPEND=!FORCE_APPEND;
       break;
-    case 'a': /* Toggle ALPHABETIZE_OUTPUT */
-      ALPHABETIZE_OUTPUT=!ALPHABETIZE_OUTPUT;
+    case 'a': /* Do not alphabetize output */
+      ALPHABETIZE_OUTPUT=False;
+      (void)fprintf(stderr,"%s: WARNING the ncks '-a', '--abc', and '--alphabetize' switches are misleadingly named because they turn-off the default alphabetization. These switches are deprecated as of NCO 4.7.1 and will soon be deleted. Instead, please use the new long options --no_abc, --no-abc, --no_alphabetize, or --no-alphabetize, all of which turn-off the default alphabetization.\n",nco_prg_nm_get());
       break;
     case 'b': /* Set file for binary output */
       fl_bnr=(char *)strdup(optarg);
@@ -986,6 +992,14 @@ main(int argc,char **argv)
   /* Construct GTT (Group Traversal Table), check -v and -g input names and create extraction list */
   (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,GRP_XTR_VAR_XCL,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
+  /* 20170914: Workaround CDF5 bug for MPAS MOC */
+  if(var_lst_in_nbr == 2 && (!strcmp(var_lst_in[0],"timeMonthly_avg_normalVelocity") || !strcmp(var_lst_in[1],"timeMonthly_avg_normalVelocity"))){
+    srt_mth=0; // fxm: Set to 1 to activate workaround. Currently broken, seems to produce invalid trv_tbl
+    if(srt_mth == 1) (void)fprintf(stderr,"%s: INFO Activating CDF5 bug workaround: define output in reverse-alphabetical (instead of alphabetical) order when two fields are requested and one is timeMonthly_avg_normalVelocity\n",nco_prg_nm_get());
+  } /* !CDF5 */
+
+  if(ALPHABETIZE_OUTPUT) trv_tbl_srt(srt_mth,trv_tbl);
+
   /* [fnc] Print extraction list and exit */
   if(LST_XTR) nco_xtr_lst(trv_tbl);
 
@@ -1009,14 +1023,6 @@ main(int argc,char **argv)
   (void)fprintf(stdout,"%s: MPI process rank %d reports %d process%s\n",nco_prg_nm,prc_rnk,prc_nbr,(prc_nbr == 1) ? "" : "es");
 #endif /* !ENABLE_MPI */
 
-  /* 20170914: Workaround CDF5 bug for MPAS MOC */
-  if(var_lst_in_nbr == 2 && (!strcmp(var_lst_in[0],"timeMonthly_avg_normalVelocity") || !strcmp(var_lst_in[1],"timeMonthly_avg_normalVelocity"))){
-    srt_mth=0; // fxm: Set to 1 to activate workaround. Currently broken, seems to produce invalid trv_tbl
-    if(srt_mth == 1) (void)fprintf(stderr,"%s: INFO Activating CDF5 bug workaround: define output in reverse-alphabetical (instead of alphabetical) order when two fields are requested and one is timeMonthly_avg_normalVelocity\n",nco_prg_nm_get());
-  } /* !CDF5 */
-
-  if(ALPHABETIZE_OUTPUT) trv_tbl_srt(srt_mth,trv_tbl);
-
   /* We now have final list of variables to extract. Phew. */
 
   if(fl_out){
diff --git a/src/nco/nco.h b/src/nco/nco.h
index cb084ca..19f796e 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -344,17 +344,17 @@ extern "C" {
 # define NCO_VERSION_MINOR 7
 #endif /* !NCO_VERSION_MINOR */
 #ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 0
+# define NCO_VERSION_PATCH 1
 #endif /* !NCO_VERSION_PATCH */
 #ifndef NCO_VERSION_NOTE
-# define NCO_VERSION_NOTE "" /* Blank for final versions, non-blank (e.g., "beta37") for pre-release versions */
+# define NCO_VERSION_NOTE "" /* Blank for final versions, non-blank (e.g., "-beta37") for pre-release versions */
 #endif /* !NCO_VERSION_NOTE */
 #ifndef NCO_LIB_VERSION
   /* Define NC_LIB_VERSION as three-digit number for arithmetic comparisons by CPP */
 # 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.7.0"
+# define NCO_VERSION "4.7.1"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
diff --git a/src/nco/nco_cnf_dmn.c b/src/nco/nco_cnf_dmn.c
index 63bc8bd..9e431ee 100644
--- a/src/nco/nco_cnf_dmn.c
+++ b/src/nco/nco_cnf_dmn.c
@@ -191,14 +191,14 @@ nco_var_cnf_dmn /* [fnc] Stretch second variable to match dimensions of first va
     char * restrict wgt_cp;
     char * restrict wgt_out_cp;
 
-    int idx_wgt_var[NC_MAX_DIMS];
+    int idx_wgt_var[NC_MAX_VAR_DIMS];
     int wgt_nbr_dim;
     int var_nbr_dmn_m1;
 
     long * restrict var_cnt;
-    long dmn_ss[NC_MAX_DIMS];
-    long dmn_var_map[NC_MAX_DIMS];
-    long dmn_wgt_map[NC_MAX_DIMS];
+    long dmn_ss[NC_MAX_VAR_DIMS];
+    long dmn_var_map[NC_MAX_VAR_DIMS];
+    long dmn_wgt_map[NC_MAX_VAR_DIMS];
     long var_lmn;
     long wgt_lmn;
     long var_sz;
@@ -460,12 +460,12 @@ nco_var_dmn_rdr_mtd /* [fnc] Change dimension ordering of variable metadata */
   dmn_sct **dmn_in=NULL; /* [sct] List of dimension structures in input order */
   dmn_sct **dmn_out; /* [sct] List of dimension structures in output order */
   
-  int dmn_idx_in_shr[NC_MAX_DIMS]; /* [idx] Dimension correspondence, input->share Purely diagnostic */
-  int dmn_idx_in_out[NC_MAX_DIMS]; /* [idx] Dimension correspondence, input->output */
-  int dmn_idx_in_rdr[NC_MAX_DIMS]; /* [idx] Dimension correspondence, input->re-order NB: Purely diagnostic */
-  int dmn_idx_shr_rdr[NC_MAX_DIMS]; /* [idx] Dimension correspondence, share->re-order */	  
-  int dmn_idx_shr_in[NC_MAX_DIMS]; /* [idx] Dimension correspondence, share->input */	  
-  int dmn_idx_shr_out[NC_MAX_DIMS]; /* [idx] Dimension correspondence, share->output */	  
+  int dmn_idx_in_shr[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, input->share Purely diagnostic */
+  int dmn_idx_in_out[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, input->output */
+  int dmn_idx_in_rdr[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, input->re-order NB: Purely diagnostic */
+  int dmn_idx_shr_rdr[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, share->re-order */	  
+  int dmn_idx_shr_in[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, share->input */	  
+  int dmn_idx_shr_out[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, share->output */	  
   int dmn_idx_rec_out=NCO_REC_DMN_UNDEFINED; /* [idx] Record dimension index in output variable */
   int dmn_shr_nbr=0; /* [nbr] Number of dimensions dmn_in and dmn_rdr share */
   int dmn_in_idx; /* [idx] Counting index for dmn_in */
@@ -668,9 +668,9 @@ nco_var_dmn_rdr_val /* [fnc] Change dimension ordering of variable values */
   int rcd=0; /* [rcd] Return code */
   int typ_sz; /* [B] Size of data element in memory */
   
-  long dmn_in_map[NC_MAX_DIMS]; /* [idx] Map for each dimension of input variable */
-  long dmn_out_map[NC_MAX_DIMS]; /* [idx] Map for each dimension of output variable */
-  long dmn_in_sbs[NC_MAX_DIMS]; /* [idx] Dimension subscripts into N-D input array */
+  long dmn_in_map[NC_MAX_VAR_DIMS]; /* [idx] Map for each dimension of input variable */
+  long dmn_out_map[NC_MAX_VAR_DIMS]; /* [idx] Map for each dimension of output variable */
+  long dmn_in_sbs[NC_MAX_VAR_DIMS]; /* [idx] Dimension subscripts into N-D input array */
   long var_in_lmn; /* [idx] Offset into 1-D input array */
   long var_out_lmn; /* [idx] Offset into 1-D output array */
   long *var_in_cnt; /* [nbr] Number of valid elements in this dimension (including effects of stride and wrapping) */
@@ -714,7 +714,7 @@ nco_var_dmn_rdr_val /* [fnc] Change dimension ordering of variable values */
   
   /* Report full metadata re-order, if requested */
   if(nco_dbg_lvl_get() > 3){
-    int dmn_idx_in_out[NC_MAX_DIMS]; /* [idx] Dimension correspondence, input->output */
+    int dmn_idx_in_out[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, input->output */
     /* Create reverse correspondence */
     for(dmn_out_idx=0;dmn_out_idx<dmn_out_nbr;dmn_out_idx++)
       dmn_idx_in_out[dmn_idx_out_in[dmn_out_idx]]=dmn_out_idx;
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index 589ee2d..e705f2e 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -850,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: Ta Nehisi\n";
+  return "Mnemonic: Ajudar\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 4916dc0..b5f8530 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -103,7 +103,7 @@ nco_fl_sz_est /* [fnc] Estimate RAM size == uncompressed file size */
 
   size_t ram_sz_crr;
   size_t ram_sz_ttl=0L;
-  size_t dmn_sz[NC_MAX_DIMS]; /* [nbr] Dimension sizes */
+  size_t dmn_sz[NC_MAX_VAR_DIMS]; /* [nbr] Dimension sizes */
   
   for(unsigned idx_tbl=0;idx_tbl<trv_tbl->nbr;idx_tbl++){
     trv_sct var_trv=trv_tbl->lst[idx_tbl]; 
diff --git a/src/nco/nco_grp_trv.c b/src/nco/nco_grp_trv.c
index 5f90b00..30e5197 100644
--- a/src/nco/nco_grp_trv.c
+++ b/src/nco/nco_grp_trv.c
@@ -211,6 +211,10 @@ trv_tbl_inq                          /* [fnc] Find and return global totals of d
   for(unsigned idx_tbl=0;idx_tbl<trv_tbl->nbr_dmn;idx_tbl++)
     if(trv_tbl->lst_dmn[idx_tbl].is_rec_dmn) dmn_rec_lcl++;
 
+  if(var_ntm_lcl > 0){
+    (void)fprintf(stdout,"%s: WARNING File contains %d non-atomic (e.g., compound, enum_t, opaque, vlen_t, and user-defined) variable types. NCO currently ignores non-atomic variables. %s will process and copy to output only the atomic variables.\n",nco_prg_nm_get(),var_ntm_lcl,nco_prg_nm_get());
+  } /* !var_ntm_lcl */
+
   if(att_glb_all) *att_glb_all=att_glb_lcl;
   if(att_grp_all) *att_grp_all=att_grp_lcl;
   if(att_var_all) *att_var_all=att_var_lcl;
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 187f8c0..b3841ea 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -4333,7 +4333,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
   char dmn_nm_grp[NC_MAX_NAME+1];        /* [sng] Dimension name for group */  
   char var_nm[NC_MAX_NAME+1];            /* [sng] Variable name (local copy of object name) */ 
 
-  dmn_cmn_sct dmn_cmn[NC_MAX_DIMS];      /* [sct] Dimension information on output (for a variable) */
+  dmn_cmn_sct dmn_cmn[NC_MAX_VAR_DIMS];      /* [sct] Dimension information on output (for a variable) */
 
   dmn_trv_sct *dmn_trv;                  /* [sct] Unique dimension object */
   
@@ -4343,7 +4343,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
   int *dmn_out_id_tmp;                   /* [idx] Copy of dmn_out_id (ncpdq) */
   int *udm_out_id_grp; /* [enm] Unlimited dimension IDs */
   int dmn_id_out;                        /* [id] Dimension ID defined in outout group */  
-  int dmn_out_id[NC_MAX_DIMS];           /* [id] Dimension IDs array for output variable */
+  int dmn_out_id[NC_MAX_VAR_DIMS];           /* [id] Dimension IDs array for output variable */
   int fl_fmt;                            /* [enm] Output file format */
   int grp_dmn_out_id;                    /* [id] Group ID where dimension visible to specified group is defined */
   int grp_in_id;                         /* [id] Group ID */
@@ -4800,7 +4800,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
        ...variable is processing type */
 
     /* Temporary store for old IDs */
-    int dmn_tmp_id[NC_MAX_DIMS];
+    int dmn_tmp_id[NC_MAX_VAR_DIMS];
     for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++) dmn_tmp_id[idx_dmn]=dmn_out_id[idx_dmn];
 
     /* Increment number of dimensions for this variable */
@@ -4846,7 +4846,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
 
   /* Special case for ncwa */
   if(nco_prg_id == ncwa){
-    int dmn_ids_out[NC_MAX_DIMS];  /* [id] Dimension IDs array for output variable (ncwa can skip some dimensions, rearrange) */
+    int dmn_ids_out[NC_MAX_VAR_DIMS];  /* [id] Dimension IDs array for output variable (ncwa can skip some dimensions, rearrange) */
     int idx_dmn_def=0;
     for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++){
       if(DEFINE_DIM[idx_dmn]){
@@ -4936,7 +4936,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
     /* Define extra dimension on output (e.g., ncecat adds "record" dimension) */
     if(nco_prg_id == ncecat && rec_dmn_nm && var_trv->enm_prc_typ == prc_typ){ 
       /* Temporary store for old dimensions */
-      dmn_cmn_sct dmn_cmn_tmp[NC_MAX_DIMS];
+      dmn_cmn_sct dmn_cmn_tmp[NC_MAX_VAR_DIMS];
       for(int idx_dmn=0;idx_dmn<nbr_dmn_var_out;idx_dmn++) dmn_cmn_tmp[idx_dmn]=dmn_cmn[idx_dmn];
       /* Define record dimension made for ncecat */
       dmn_cmn[0].sz=NC_UNLIMITED;
@@ -5520,9 +5520,9 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
   int dmn_out_nbr;                 /* [nbr] Number of dimensions in output variable */
   int typ_sz;                      /* [B] Size of data element in memory */
 
-  long dmn_in_map[NC_MAX_DIMS];    /* [idx] Map for each dimension of input variable */
-  long dmn_out_map[NC_MAX_DIMS];   /* [idx] Map for each dimension of output variable */
-  long dmn_in_sbs[NC_MAX_DIMS];    /* [idx] Dimension subscripts into N-D input array */
+  long dmn_in_map[NC_MAX_VAR_DIMS];    /* [idx] Map for each dimension of input variable */
+  long dmn_out_map[NC_MAX_VAR_DIMS];   /* [idx] Map for each dimension of output variable */
+  long dmn_in_sbs[NC_MAX_VAR_DIMS];    /* [idx] Dimension subscripts into N-D input array */
   long var_in_lmn;                 /* [idx] Offset into 1-D input array */
   long var_out_lmn;                /* [idx] Offset into 1-D output array */
   long *var_in_cnt;                /* [nbr] Number of valid elements in this dimension (including effects of stride and wrapping) */
@@ -5589,7 +5589,7 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
 
       /* Report full metadata re-order, if requested */
       if(nco_dbg_lvl_get() > 3){
-        int dmn_idx_in_out[NC_MAX_DIMS]; /* [idx] Dimension correspondence, input->output */
+        int dmn_idx_in_out[NC_MAX_VAR_DIMS]; /* [idx] Dimension correspondence, input->output */
         /* Create reverse correspondence */
         for(dmn_out_idx=0;dmn_out_idx<dmn_out_nbr;dmn_out_idx++)
           dmn_idx_in_out[dmn_idx_out_in[dmn_out_idx]]=dmn_out_idx;
diff --git a/src/nco/nco_netcdf.c b/src/nco/nco_netcdf.c
index 15be183..58e7a7a 100644
--- a/src/nco/nco_netcdf.c
+++ b/src/nco/nco_netcdf.c
@@ -88,7 +88,7 @@ nco_err_exit /* [fnc] Print netCDF error message, routine name, then exit */
 #ifdef ENABLE_NETCDF4 
   case NC_ENOTBUILT: (void)fprintf(stdout,"ERROR NC_ENOTBUILT Attempt to use feature that was not turned on when netCDF was built\nHINT: NC_ENOTBUILT errors occur only, in our experience, when NCO attempts to access an HDF4 (including HDF-EOS2) file. It is only possible to access HDF4 files from NCO if NCO is first re-linked to a version of netCDF configured with the --enable-hdf4 option, which itself must be linked to a version of HDF4 configured with the --disable-netcdf option. These  [...]
 #endif /* !ENABLE_NETCDF4 */
-  case NC_ENOTNC: (void)fprintf(stdout,"ERROR NC_ENOTNC Not a netCDF file\nHINT: NC_ENOTNC errors can occur for many reasons. If your use-case matches one of the four listed below, take the corrective action indicated:\n1. An NCO operator linked only to the classic netCDF3 library attempts to read netCDF4 (or HDF4 or HDF5) files. "); 
+  case NC_ENOTNC: (void)fprintf(stdout,"ERROR NC_ENOTNC Not a netCDF file\nHINT: NC_ENOTNC errors can occur for many reasons. If your use-case matches one of the four listed below, take the corrective action indicated:\n1. An NCO operator linked only to the classic netCDF3 library attempts to read netCDF4 (or HDF5) files. "); 
 #ifdef ENABLE_NETCDF4 
      (void)fprintf(stdout,"However, this executable seems to have been built with the capability to manipulate netCDF4 files, so it is unlikely that this command failed only because the input datasets are netCDF4 format. Something else is going wrong. \n"); 
 #else /* !ENABLE_NETCDF4 */ 
@@ -726,7 +726,8 @@ nco_open_flg(const char * const fl_nm,const int mode,int * const nc_id)
   return rcd;
 } /* end nco_open */
 
-#if NC_LIB_VERSION < 440
+/* #if NC_LIB_VERSION < 440 */
+#ifndef HAVE_NETCDF_MEM_H
 int
 nc_open_mem(const char * const fl_nm,const int mode,const size_t sz,void * const void_ptr,int * const nc_id)
 {
@@ -910,7 +911,7 @@ nco_close(const int nc_id)
   if(fl_fmt == NC_FORMAT_CDF5){
     char *path=NULL;
     char var_nm[NC_MAX_NAME+1L];
-    int dmn_id[NC_MAX_DIMS];
+    int dmn_id[NC_MAX_VAR_DIMS];
     int var_id[NC_MAX_VARS];
     int bug_idx=-1;
     int bug_nbr=0;
@@ -920,7 +921,7 @@ nco_close(const int nc_id)
     int var_idx;
     int var_nbr;
     nc_type var_typ;
-    size_t dmn_sz[NC_MAX_DIMS];
+    size_t dmn_sz[NC_MAX_VAR_DIMS];
     size_t pathlen;
     size_t var_sz;
     rcd=nc_inq_path(nc_id,&pathlen,NULL);
@@ -1396,7 +1397,10 @@ nco_inq_dim(const int nc_id,const int dmn_id,char *dmn_nm,long *dmn_sz)
   /* Purpose: Wrapper for nc_inq_dim() */
   const char fnc_nm[]="nco_inq_dim()";
   int rcd;
-  rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,(size_t *)dmn_sz);
+  size_t dmn_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(dmn_sz) dmn_sz_t=*dmn_sz;
+  rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,&dmn_sz_t);
+  if(dmn_sz) *dmn_sz=(long)dmn_sz_t;
   if(rcd == NC_EBADDIM){
     (void)fprintf(stdout,"ERROR: %s reports requested dimension \"%s\" is not in input file\n",fnc_nm,dmn_nm);
     nco_err_exit(rcd,fnc_nm);
@@ -1410,7 +1414,10 @@ nco_inq_dim_flg(const int nc_id,const int dmn_id,char *dmn_nm,long *dmn_sz)
 {
   /* Purpose: Error-tolerant wrapper for nc_inq_dim_flg(). Tolerates NC_EBADDIM. */
   int rcd;
-  rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,(size_t *)dmn_sz);
+  size_t dmn_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(dmn_sz) dmn_sz_t=*dmn_sz;
+  rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,&dmn_sz_t);
+  if(dmn_sz) *dmn_sz=(long)dmn_sz_t;
   if(rcd == NC_EBADDIM) return rcd;
   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dim_flg()");
   return rcd;
@@ -1431,7 +1438,10 @@ nco_inq_dimlen(const int nc_id,const int dmn_id,long *dmn_sz)
 {
   /* Purpose: Wrapper for nc_inq_dimlen() */
   int rcd;
-  rcd=nc_inq_dimlen(nc_id,dmn_id,(size_t *)dmn_sz);
+  size_t dmn_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(dmn_sz) dmn_sz_t=*dmn_sz;
+  rcd=nc_inq_dimlen(nc_id,dmn_id,&dmn_sz_t);
+  if(dmn_sz) *dmn_sz=(long)dmn_sz_t;
   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dimlen()");
   return rcd;
 } /* end nco_inq_dimlen */
@@ -1899,20 +1909,24 @@ nco_get_var1(const int nc_id,const int var_id,const long * const srt,void * cons
   /* Purpose: Wrapper for nc_get_var1_*() */
   const char fnc_nm[]="nco_get_var1()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++) srt_sz_t[dmn_idx]=srt[dmn_idx];
   switch(var_typ){
-  case NC_FLOAT: rcd=nc_get_var1_float(nc_id,var_id,(const size_t *)srt,(float *)vp); break;
-  case NC_DOUBLE: rcd=nc_get_var1_double(nc_id,var_id,(const size_t *)srt,(double *)vp); break;
-  case NC_INT: rcd=NCO_GET_VAR1_INT(nc_id,var_id,(const size_t *)srt,(nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_get_var1_short(nc_id,var_id,(const size_t *)srt,(nco_short *)vp); break;
-  case NC_CHAR: rcd=NCO_GET_VAR1_CHAR(nc_id,var_id,(const size_t *)srt,(nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_GET_VAR1_BYTE(nc_id,var_id,(const size_t *)srt,(nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_get_var1_float(nc_id,var_id,srt_sz_t,(float *)vp); break;
+  case NC_DOUBLE: rcd=nc_get_var1_double(nc_id,var_id,srt_sz_t,(double *)vp); break;
+  case NC_INT: rcd=NCO_GET_VAR1_INT(nc_id,var_id,srt_sz_t,(nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_get_var1_short(nc_id,var_id,srt_sz_t,(nco_short *)vp); break;
+  case NC_CHAR: rcd=NCO_GET_VAR1_CHAR(nc_id,var_id,srt_sz_t,(nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_GET_VAR1_BYTE(nc_id,var_id,srt_sz_t,(nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_GET_VAR1_UBYTE(nc_id,var_id,(const size_t *)srt,(nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_GET_VAR1_USHORT(nc_id,var_id,(const size_t *)srt,(nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_GET_VAR1_UINT(nc_id,var_id,(const size_t *)srt,(nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_GET_VAR1_INT64(nc_id,var_id,(const size_t *)srt,(nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_GET_VAR1_UINT64(nc_id,var_id,(const size_t *)srt,(nco_uint64 *)vp); break;
-  case NC_STRING: rcd=NCO_GET_VAR1_STRING(nc_id,var_id,(const size_t *)srt,(nco_string *)vp); break;
+  case NC_UBYTE: rcd=NCO_GET_VAR1_UBYTE(nc_id,var_id,srt_sz_t,(nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_GET_VAR1_USHORT(nc_id,var_id,srt_sz_t,(nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_GET_VAR1_UINT(nc_id,var_id,srt_sz_t,(nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_GET_VAR1_INT64(nc_id,var_id,srt_sz_t,(nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_GET_VAR1_UINT64(nc_id,var_id,srt_sz_t,(nco_uint64 *)vp); break;
+  case NC_STRING: rcd=NCO_GET_VAR1_STRING(nc_id,var_id,srt_sz_t,(nco_string *)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -1931,19 +1945,23 @@ nco_put_var1(const int nc_id,const int var_id,const long * const srt,const void
   /* Purpose: Wrapper for nc_put_var1_*() */
   const char fnc_nm[]="nco_put_var1()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++) srt_sz_t[dmn_idx]=srt[dmn_idx];
   switch(type){
-  case NC_FLOAT: rcd=nc_put_var1_float(nc_id,var_id,(const size_t *)srt,(const float *)vp); break;
-  case NC_DOUBLE: rcd=nc_put_var1_double(nc_id,var_id,(const size_t *)srt,(const double *)vp); break;
-  case NC_INT: rcd=NCO_PUT_VAR1_INT(nc_id,var_id,(const size_t *)srt,(const nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_put_var1_short(nc_id,var_id,(const size_t *)srt,(const short *)vp); break;
-  case NC_CHAR: rcd=NCO_PUT_VAR1_CHAR(nc_id,var_id,(const size_t *)srt,(const nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_PUT_VAR1_BYTE(nc_id,var_id,(const size_t *)srt,(const nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_put_var1_float(nc_id,var_id,srt_sz_t,(const float *)vp); break;
+  case NC_DOUBLE: rcd=nc_put_var1_double(nc_id,var_id,srt_sz_t,(const double *)vp); break;
+  case NC_INT: rcd=NCO_PUT_VAR1_INT(nc_id,var_id,srt_sz_t,(const nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_put_var1_short(nc_id,var_id,srt_sz_t,(const short *)vp); break;
+  case NC_CHAR: rcd=NCO_PUT_VAR1_CHAR(nc_id,var_id,srt_sz_t,(const nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_PUT_VAR1_BYTE(nc_id,var_id,srt_sz_t,(const nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_PUT_VAR1_UBYTE(nc_id,var_id,(const size_t *)srt,(const nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_PUT_VAR1_USHORT(nc_id,var_id,(const size_t *)srt,(const nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_PUT_VAR1_UINT(nc_id,var_id,(const size_t *)srt,(const nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_PUT_VAR1_INT64(nc_id,var_id,(const size_t *)srt,(const nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_PUT_VAR1_UINT64(nc_id,var_id,(const size_t *)srt,(const nco_uint64 *)vp); break;
+  case NC_UBYTE: rcd=NCO_PUT_VAR1_UBYTE(nc_id,var_id,srt_sz_t,(const nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_PUT_VAR1_USHORT(nc_id,var_id,srt_sz_t,(const nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_PUT_VAR1_UINT(nc_id,var_id,srt_sz_t,(const nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_PUT_VAR1_INT64(nc_id,var_id,srt_sz_t,(const nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_PUT_VAR1_UINT64(nc_id,var_id,srt_sz_t,(const nco_uint64 *)vp); break;
     /* Next line produces GCC warning:
        attention : passing argument 4 of ‘nc_put_var1_string’ from incompatible pointer type 
        I think this warning occurs because this routine receives input vp 
@@ -1956,13 +1974,13 @@ nco_put_var1(const int nc_id,const int var_id,const long * const srt,const void
        Choose solution that allows trouble-free g++ compilation */
     /* Next line produces gcc and g++ warning:
        attention : le transtypage annule des qualificateurs du type pointeur ciblé */
-  case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,(const size_t *)srt,(const char **)vp); break;
+  case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,srt_sz_t,(const char **)vp); break;
       /* Next line produces g++ warning:
        erreur: invalid conversion from ‘char* const* const’ to ‘const char** */
-    /* case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,(const size_t *)srt,(const nco_string * const)vp); break;*/
+    /* case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,srt_sz_t,(const nco_string * const)vp); break;*/
     /* Next line produces g++ warning:
         erreur: invalid conversion from ‘char* const*’ to ‘const char** */
-    /*  case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,(const size_t *)srt,(const nco_string *)vp); break;*/
+    /*  case NC_STRING: rcd=NCO_PUT_VAR1_STRING(nc_id,var_id,srt_sz_t,(const nco_string *)vp); break;*/
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -1981,6 +1999,32 @@ nco_get_vara(const int nc_id,const int var_id,const long * const srt,const long
   /* Purpose: Wrapper for nc_get_vara_*() */
   const char fnc_nm[]="nco_get_vara()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
+  switch(type){
+  case NC_FLOAT: rcd=nc_get_vara_float(nc_id,var_id,srt_sz_t,cnt_sz_t,(float *)vp); break;
+  case NC_DOUBLE: rcd=nc_get_vara_double(nc_id,var_id,srt_sz_t,cnt_sz_t,(double *)vp); break;
+  case NC_INT: rcd=NCO_GET_VARA_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_get_vara_short(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_short *)vp); break;
+  case NC_CHAR: rcd=NCO_GET_VARA_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_GET_VARA_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_byte *)vp); break;
+#ifdef ENABLE_NETCDF4
+  case NC_UBYTE: rcd=NCO_GET_VARA_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_GET_VARA_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_GET_VARA_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_GET_VARA_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_GET_VARA_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_uint64 *)vp); break;
+  case NC_STRING: rcd=NCO_GET_VARA_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,(nco_string *)vp); break;
+#endif /* !ENABLE_NETCDF4 */
+  default: nco_dfl_case_nc_type_err(); break;
+  } /* end switch */
+#if 0
   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;
   case NC_DOUBLE: rcd=nc_get_vara_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(double *)vp); break;
@@ -1998,6 +2042,7 @@ 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 */
+#endif /* !0 */
   if(rcd != NC_NOERR){
     char var_nm[NC_MAX_NAME+1L];
     (void)nco_inq_varname(nc_id,var_id,var_nm);
@@ -2013,21 +2058,29 @@ nco_put_vara(const int nc_id,const int var_id,const long * const srt,const long
   /* Purpose: Wrapper for nc_put_vara_*() */
   const char fnc_nm[]="nco_put_vara()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
   switch(type){
-  case NC_FLOAT: rcd=nc_put_vara_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const float *)vp); break;
-  case NC_DOUBLE: rcd=nc_put_vara_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const double *)vp); break;
-  case NC_INT: rcd=NCO_PUT_VARA_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_put_vara_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const short *)vp); break;
-  case NC_CHAR: rcd=NCO_PUT_VARA_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_PUT_VARA_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_put_vara_float(nc_id,var_id,srt_sz_t,cnt_sz_t,(const float *)vp); break;
+  case NC_DOUBLE: rcd=nc_put_vara_double(nc_id,var_id,srt_sz_t,cnt_sz_t,(const double *)vp); break;
+  case NC_INT: rcd=NCO_PUT_VARA_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_put_vara_short(nc_id,var_id,srt_sz_t,cnt_sz_t,(const short *)vp); break;
+  case NC_CHAR: rcd=NCO_PUT_VARA_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_PUT_VARA_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_PUT_VARA_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_PUT_VARA_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_PUT_VARA_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_PUT_VARA_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_PUT_VARA_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_uint64 *)vp); break;
+  case NC_UBYTE: rcd=NCO_PUT_VARA_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_PUT_VARA_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_PUT_VARA_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_PUT_VARA_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_PUT_VARA_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,(const nco_uint64 *)vp); break;
     /* NC_STRING prototype next causes same compiler warnings described in nco_put_var1() above */
-  case NC_STRING: rcd=NCO_PUT_VARA_STRING(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const char **)vp); break;
+  case NC_STRING: rcd=NCO_PUT_VARA_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,(const char **)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -2046,20 +2099,30 @@ nco_get_vars(const int nc_id,const int var_id,const long * const srt,const long
   /* Purpose: Wrapper for nc_get_vars_*() */
   const char fnc_nm[]="nco_get_vars()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  ptrdiff_t srd_pd_t[NC_MAX_VAR_DIMS];
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    srd_pd_t[dmn_idx]=srd[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
   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;
-  case NC_DOUBLE: rcd=nc_get_vars_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(double *)vp); break;
-  case NC_INT: rcd=NCO_GET_VARS_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_get_vars_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_short *)vp); break;
-  case NC_CHAR: rcd=NCO_GET_VARS_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_GET_VARS_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_get_vars_float(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(float *)vp); break;
+  case NC_DOUBLE: rcd=nc_get_vars_double(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(double *)vp); break;
+  case NC_INT: rcd=NCO_GET_VARS_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_get_vars_short(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_short *)vp); break;
+  case NC_CHAR: rcd=NCO_GET_VARS_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_GET_VARS_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_GET_VARS_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_GET_VARS_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_GET_VARS_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_GET_VARS_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_GET_VARS_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_uint64 *)vp); break;
-  case NC_STRING: rcd=NCO_GET_VARS_STRING(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(nco_string *)vp); break;
+  case NC_UBYTE: rcd=NCO_GET_VARS_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_GET_VARS_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_GET_VARS_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_GET_VARS_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_GET_VARS_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_uint64 *)vp); break;
+  case NC_STRING: rcd=NCO_GET_VARS_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(nco_string *)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -2078,21 +2141,31 @@ nco_put_vars(const int nc_id,const int var_id,const long * const srt,const long
   /* Purpose: Wrapper for nc_put_vars_*() */
   const char fnc_nm[]="nco_put_vars()";
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  ptrdiff_t srd_pd_t[NC_MAX_VAR_DIMS];
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    srd_pd_t[dmn_idx]=srd[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
   switch(type){
-  case NC_FLOAT: rcd=nc_put_vars_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const float *)vp); break;
-  case NC_DOUBLE: rcd=nc_put_vars_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const double *)vp); break;
-  case NC_INT: rcd=NCO_PUT_VARS_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_put_vars_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const short *)vp); break;
-  case NC_CHAR: rcd=NCO_PUT_VARS_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_PUT_VARS_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_put_vars_float(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const float *)vp); break;
+  case NC_DOUBLE: rcd=nc_put_vars_double(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const double *)vp); break;
+  case NC_INT: rcd=NCO_PUT_VARS_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_put_vars_short(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const short *)vp); break;
+  case NC_CHAR: rcd=NCO_PUT_VARS_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_PUT_VARS_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_PUT_VARS_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_PUT_VARS_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_PUT_VARS_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_PUT_VARS_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd, (const nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_PUT_VARS_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const nco_uint64 *)vp); break;
+  case NC_UBYTE: rcd=NCO_PUT_VARS_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_PUT_VARS_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_PUT_VARS_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_PUT_VARS_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t, (const nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_PUT_VARS_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const nco_uint64 *)vp); break;
     /* NC_STRING prototype next causes same compiler warnings described in nco_put_var1() above */
-  case NC_STRING: rcd=NCO_PUT_VARS_STRING(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const char **)vp); break;
+  case NC_STRING: rcd=NCO_PUT_VARS_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,(const char **)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -2110,21 +2183,32 @@ nco_get_varm(const int nc_id,const int var_id,const long * const srt,const long
 {
   /* Purpose: Wrapper for nc_get_varm_*() */
   int rcd=NC_NOERR;
-
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  ptrdiff_t map_pd_t[NC_MAX_VAR_DIMS];
+  ptrdiff_t srd_pd_t[NC_MAX_VAR_DIMS];
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    map_pd_t[dmn_idx]=map[dmn_idx];
+    srd_pd_t[dmn_idx]=srd[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
   switch(type){
-  case NC_FLOAT: rcd=nc_get_varm_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(float *)vp); break;
-  case NC_DOUBLE: rcd=nc_get_varm_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(double *)vp); break;
-  case NC_INT: rcd=NCO_GET_VARM_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_get_varm_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_short *)vp); break;
-  case NC_CHAR: rcd=NCO_GET_VARM_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_GET_VARM_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_get_varm_float(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(float *)vp); break;
+  case NC_DOUBLE: rcd=nc_get_varm_double(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(double *)vp); break;
+  case NC_INT: rcd=NCO_GET_VARM_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_get_varm_short(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_short *)vp); break;
+  case NC_CHAR: rcd=NCO_GET_VARM_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_GET_VARM_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_GET_VARM_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_GET_VARM_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_GET_VARM_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_GET_VARM_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_GET_VARM_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_uint64 *)vp); break;
-  case NC_STRING: rcd=NCO_GET_VARM_STRING(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_string *)vp); break;
+  case NC_UBYTE: rcd=NCO_GET_VARM_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_GET_VARM_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_GET_VARM_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_GET_VARM_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_GET_VARM_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_uint64 *)vp); break;
+  case NC_STRING: rcd=NCO_GET_VARM_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(nco_string *)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -2137,21 +2221,33 @@ nco_put_varm(const int nc_id,const int var_id,const long * const srt,const long
 {
   /* Purpose: Wrapper for nc_put_varm_*() */
   int rcd=NC_NOERR;
+  int dmn_nbr; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  ptrdiff_t map_pd_t[NC_MAX_VAR_DIMS];
+  ptrdiff_t srd_pd_t[NC_MAX_VAR_DIMS];
+  size_t cnt_sz_t[NC_MAX_VAR_DIMS];
+  size_t srt_sz_t[NC_MAX_VAR_DIMS];
+  rcd=nc_inq_varndims(nc_id,var_id,&dmn_nbr);
+  for(int dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
+    cnt_sz_t[dmn_idx]=cnt[dmn_idx];
+    map_pd_t[dmn_idx]=map[dmn_idx];
+    srd_pd_t[dmn_idx]=srd[dmn_idx];
+    srt_sz_t[dmn_idx]=srt[dmn_idx];
+  } /* !dmn_idx */
   switch(type){
-  case NC_FLOAT: rcd=nc_put_varm_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const float *)vp); break;
-  case NC_DOUBLE: rcd=nc_put_varm_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const double *)vp); break;
-  case NC_INT: rcd=NCO_PUT_VARM_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_int *)vp); break;
-  case NC_SHORT: rcd=nc_put_varm_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const short *)vp); break;
-  case NC_CHAR: rcd=NCO_PUT_VARM_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_char *)vp); break;
-  case NC_BYTE: rcd=NCO_PUT_VARM_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_byte *)vp); break;
+  case NC_FLOAT: rcd=nc_put_varm_float(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const float *)vp); break;
+  case NC_DOUBLE: rcd=nc_put_varm_double(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const double *)vp); break;
+  case NC_INT: rcd=NCO_PUT_VARM_INT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_int *)vp); break;
+  case NC_SHORT: rcd=nc_put_varm_short(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const short *)vp); break;
+  case NC_CHAR: rcd=NCO_PUT_VARM_CHAR(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_char *)vp); break;
+  case NC_BYTE: rcd=NCO_PUT_VARM_BYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_byte *)vp); break;
 #ifdef ENABLE_NETCDF4
-  case NC_UBYTE: rcd=NCO_PUT_VARM_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_ubyte *)vp); break;
-  case NC_USHORT: rcd=NCO_PUT_VARM_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_ushort *)vp); break;
-  case NC_UINT: rcd=NCO_PUT_VARM_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_uint *)vp); break;
-  case NC_INT64: rcd=NCO_PUT_VARM_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_int64 *)vp); break;
-  case NC_UINT64: rcd=NCO_PUT_VARM_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_uint64 *)vp); break;
+  case NC_UBYTE: rcd=NCO_PUT_VARM_UBYTE(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_ubyte *)vp); break;
+  case NC_USHORT: rcd=NCO_PUT_VARM_USHORT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_ushort *)vp); break;
+  case NC_UINT: rcd=NCO_PUT_VARM_UINT(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_uint *)vp); break;
+  case NC_INT64: rcd=NCO_PUT_VARM_INT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_int64 *)vp); break;
+  case NC_UINT64: rcd=NCO_PUT_VARM_UINT64(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const nco_uint64 *)vp); break;
     /* NC_STRING prototype next causes same compiler warnings described in nco_put_var1() above */
-  case NC_STRING: rcd=NCO_PUT_VARM_STRING(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const char **)vp); break;
+  case NC_STRING: rcd=NCO_PUT_VARM_STRING(nc_id,var_id,srt_sz_t,cnt_sz_t,srd_pd_t,map_pd_t,(const char **)vp); break;
 #endif /* !ENABLE_NETCDF4 */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
@@ -2167,7 +2263,10 @@ nco_inq_att(const int nc_id,const int var_id,const char * const att_nm,nc_type *
   /* Purpose: Wrapper for nc_inq_att() */
   const char fnc_nm[]="nco_inq_att()";
   int rcd;
-  rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,(size_t *)att_sz);
+  size_t att_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(att_sz) att_sz_t=*att_sz;
+  rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,&att_sz_t);
+  if(att_sz) *att_sz=(long)att_sz_t;
   if(rcd != NC_NOERR){
     (void)fprintf(stderr,"ERROR: %s unable to inquire attribute var_id: %d, att_nm: %s\n",fnc_nm,var_id,att_nm);
     nco_err_exit(rcd,fnc_nm);
@@ -2181,7 +2280,10 @@ nco_inq_att_flg(const int nc_id,const int var_id,const char * const att_nm,nc_ty
   /* Purpose: Error-tolerant wrapper for nc_inq_att(). Tolerates ENOTATT. */
   const char fnc_nm[]="nco_inq_att_flg()";
   int rcd;
-  rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,(size_t *)att_sz);
+  size_t att_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(att_sz) att_sz_t=*att_sz;
+  rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,&att_sz_t);
+  if(att_sz) *att_sz=(long)att_sz_t;
   if(rcd == NC_ENOTATT) return rcd;
   if(rcd != NC_NOERR){
     (void)fprintf(stderr,"ERROR: %s unable to inquire attribute var_id: %d, att_nm: %s\n",fnc_nm,var_id,att_nm);
@@ -2230,7 +2332,10 @@ nco_inq_attlen(const int nc_id,const int var_id,const char * const att_nm,long *
 {
   /* Purpose: Wrapper for nc_inq_attlen() */
   int rcd;
-  rcd=nc_inq_attlen(nc_id,var_id,att_nm,(size_t *)att_sz);
+  size_t att_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(att_sz) att_sz_t=*att_sz;
+  rcd=nc_inq_attlen(nc_id,var_id,att_nm,&att_sz_t);
+  if(att_sz) *att_sz=(long)att_sz_t;
   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_attlen()");
   return rcd;
 } /* end nco_inq_attlen */
@@ -2241,7 +2346,10 @@ nco_inq_attlen_flg(const int nc_id,const int var_id,const char * const att_nm,lo
   /* Purpose: Error-tolerant wrapper for nc_inq_attlen(). Tolerates NC_ENOTATT. */
   const char fnc_nm[]="nco_inq_attlen_flg()";
   int rcd;
-  rcd=nc_inq_attlen(nc_id,var_id,att_nm,(size_t *)att_sz);
+  size_t att_sz_t; /* 20171115: WIN64 workaround: sizeof(long) = 4 != 8 = sizeof(size_t) */
+  if(att_sz) att_sz_t=*att_sz;
+  rcd=nc_inq_attlen(nc_id,var_id,att_nm,&att_sz_t);
+  if(att_sz) *att_sz=(long)att_sz_t;
   if(rcd == NC_ENOTATT) return rcd;
   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
   return rcd;
diff --git a/src/nco/nco_netcdf.h b/src/nco/nco_netcdf.h
index 1e4c2cb..a27326f 100644
--- a/src/nco/nco_netcdf.h
+++ b/src/nco/nco_netcdf.h
@@ -344,7 +344,7 @@ int nco_sync(const int nc_id);
 int nco_abort(const int nc_id);
 int nco_close(const int nc_id);
 int nco_inq(const int nc_id,int * const dmn_nbr_fl,int * const var_nbr_fl,int * const att_glb_nbr,int * const rec_dmn_id);
-  /* NB: nc_inq_path() introduced in netCDF 4.3.2, but NC_LIB_VERSION does not work until netCDF 4.4.0 */
+  /* NB: nc_inq_path() introduced in netCDF 4.3.2, but   NC_LIB_VERSION does not work until netCDF 4.4.0 */
 #ifndef HAVE_NC_INQ_PATH
   int nc_inq_path(const int nc_id,size_t * const pathlen,char * const path);
 #endif /* !HAVE_NC_INQ_PATH */
@@ -457,8 +457,19 @@ int nco_get_att(const int nc_id,const int var_id,const char * const att_nm,void
 #ifndef NC_HAVE_RENAME_GRP
   int nc_rename_grp(int grp_id,const char * const grp_nm);
 #endif /* NC_HAVE_RENAME_GRP */
-#if NC_LIB_VERSION >= 440
-# include <netcdf_mem.h> /* nc_open_mem() */	 
+  /* nc_open_mem() is defined in netCDF >= 4.4.0, however ...
+     Ubuntu (Xenial at least) used broken netCDF CMake (not autoconf) to package 4.4.0 (it does not install netcdf_mem.h):
+     https://github.com/nco/nco/issues/44
+     Symptom of "missing netcdf_mem.h" and/or "unresolved nc_open_mem()" occurs with NCO 4.6.2+
+     Until 20171112 we used (Option 1): 
+     #if NC_LIB_VERSION >= 440 
+     which forces Ubuntu netCDF 4.4.0 users to build netCDF with autoconf and install, e.g., into /usr/local, or
+     to manually copy netcdf_mem.h into /usr/include (has anyone tested whether that really solves the problem?)
+     Option 2 is to add test/symbol in build-engine, e.g., 
+     #if defined(HAVE_NETCDF_MEM_H)
+     which requires additional build tests in Autoconf/CMake/Makefile */
+#ifdef HAVE_NETCDF_MEM_H
+# include <netcdf_mem.h> /* nc_open_mem() defined in netCDF >= 4.4.0 */
 #else /* 4.4.0 */
   int nc_open_mem(const char * const fl_nm,const int mode,const size_t sz,void * const void_ptr,int * const nc_id);
 #endif /* 4.4.0 */
diff --git a/src/nco/nco_prn.c b/src/nco/nco_prn.c
index 114aefe..8e8c762 100644
--- a/src/nco/nco_prn.c
+++ b/src/nco/nco_prn.c
@@ -136,7 +136,7 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
     int fll_nil; /* [flg] NO_FILL */
     int shuffle; /* [flg] Shuffling is on */
     int srg_typ; /* [enm] Storage type */
-    size_t cnk_sz[NC_MAX_DIMS]; /* [nbr] Chunk sizes */
+    size_t cnk_sz[NC_MAX_VAR_DIMS]; /* [nbr] Chunk sizes */
     if(var_id == NC_GLOBAL){
       /* _Format */
       if(!XML){
@@ -1376,8 +1376,8 @@ nco_prn_var_dfn                     /* [fnc] Print variable metadata */
 
   nco_bool CRR_DMN_IS_REC_IN_INPUT[NC_MAX_DIMS]; /* [flg] Is record dimension */
 
-  size_t cnk_sz[NC_MAX_DIMS]; /* [nbr] Chunk sizes */
-  size_t dmn_sz[NC_MAX_DIMS]; /* [nbr] Dimension sizes */
+  size_t cnk_sz[NC_MAX_VAR_DIMS]; /* [nbr] Chunk sizes */
+  size_t dmn_sz[NC_MAX_VAR_DIMS]; /* [nbr] Dimension sizes */
 
   size_t ram_sz_crr;
   static size_t ram_sz_ttl=0L;
@@ -1622,7 +1622,6 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
   const nco_bool TRD=prn_flg->trd; /* [flg] Traditional output */
   const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
 
-  nco_bool JSN_BRK=False;    /* [flg] JSON output - data bracketed */
   nco_bool is_mss_val=False; /* [flg] Current value is missing value */
   nco_bool flg_malloc_unit_crd=False; /* [flg] Allocated memory for coordinate units string */
   nco_bool flg_malloc_unit_var=False; /* [flg] Allocated memory for variable units string */
@@ -1851,10 +1850,20 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
     if(JSN){
       chr2sng_sf=chr2sng_jsn;
       (void)sprintf(fmt_sng,"%s",nco_typ_fmt_sng_att_xml(var->type));
-      /* If var is size=1 (scalar?) then no array brackets */   
-      if(var->sz == 1) (void)fprintf(stdout,"%*s\"data\": ",prn_ndn,spc_sng); else (void)fprintf(stdout,"%*s\"data\": [",prn_ndn,spc_sng);
-      /* use bracketing array if needed */ 
-      if(prn_flg->jsn_data_brk && var->nbr_dim >=2) JSN_BRK=True;
+   
+      (void)fprintf(stdout,"%*s\"data\": ",prn_ndn,spc_sng);
+
+      /* if  false then this means  only one set of braces for nbr_dim>1 */
+      if( prn_flg->jsn_data_brk == False)
+        for(dmn_idx=1;dmn_idx<var->nbr_dim;dmn_idx++) 
+           mod_map_rv_cnt[dmn_idx]=0L;
+
+
+      /* switch   off final level braces for NC_CHAR as string is already quoted */      
+      if(var->nbr_dim >=1 && var->type==NC_CHAR)  
+           mod_map_rv_cnt[var->nbr_dim-1]=0L;
+
+
     } /* !JSN */
 
     nm_cdl=nm2sng_cdl(var_nm);
@@ -1906,17 +1915,14 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
     nm_cdl=(char *)nco_free(nm_cdl);
     var_szm1=var->sz-1L;
 
-    is_compound=False;
     /* Pre-compute elements that need brace punctuation */
-    if(CDL && var->nbr_dim>1){
+    if(CDL && var->nbr_dim>=1){
       mod_map_rv_cnt[0]=0L;
       /* Create brace list - here we simply modify mod_map_rv_cnt[idx] -
        * if the dim is NOT unlimited we set mod_map_rv_cnt[idx] to zero  */
       for(dmn_idx=1;dmn_idx<var->nbr_dim;dmn_idx++) { /* NB: dimension index starts at 1 */
         dmn_trv = nco_dmn_trv_sct(var_trv->var_dmn[dmn_idx].dmn_id, trv_tbl);
-        if(dmn_trv->is_rec_dmn)
-          is_compound=True;
-        else
+        if(dmn_trv->is_rec_dmn == False)
           mod_map_rv_cnt[dmn_idx]=0L;
       }
     }
@@ -1924,10 +1930,10 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
     for(lmn=0;lmn<var->sz;lmn++){
 
       /* do bracketing of data if specified */
-      if(JSN_BRK || is_compound)
-        for(int bdz=1; bdz<var->nbr_dim ; bdz++)
+      if(JSN || CDL)
+        for(int bdz=0; bdz<var->nbr_dim ; bdz++)
           if(mod_map_rv_cnt[bdz]  && lmn % mod_map_rv_cnt[bdz] == 0)
-	        (void)fprintf(stdout,"%c", (JSN_BRK ? '[' : '{' ) );
+	    (void)fprintf(stdout,"%c", (JSN ? '[' : '{' ) );
 
       is_mss_val=False;
       if(prn_flg->PRN_MSS_VAL_BLANK && var->has_mss_val){
@@ -1968,9 +1974,11 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
           chr_val=var->val.cp[lmn];
           if(var->nbr_dim == 0){
             if(CDL||TRD||JSN) (void)fprintf(stdout,"\"");
-            if(chr_val != '\0') (void)fprintf(stdout,"%s",(*chr2sng_sf)(chr_val,val_sng));
+	    /* the NetCDF standard is to print nul as "0" but  we shall  print "" for all formats */    
+            if(chr_val != '0' )
+	       (void)fprintf(stdout,"%s",(*chr2sng_sf)(chr_val,val_sng));
             if(CDL||TRD||JSN) (void)fprintf(stdout,"\"");
-            val_sng[0]='\0';
+            val_sng[0]='\0'; /* Re-initialize with NUL byte to be safe */
           }else{ /* var.nbr_dim > 0 */
             /* Multi-dimensional string arrays of NC_CHAR */
             val_sng[0]='\0';
@@ -2027,10 +2035,10 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
         (void)fprintf(stdout,"%s",val_sng);
 
       /* Bracket data if specified */
-      if(JSN_BRK || is_compound)
-        for(int bdz=1; bdz<var->nbr_dim ; bdz++)
+      if(JSN || CDL)
+        for(int bdz=0; bdz<var->nbr_dim ; bdz++)
           if(mod_map_rv_cnt[bdz]  && (lmn+1) % mod_map_rv_cnt[bdz] == 0)
-	        (void)fprintf(stdout,"%c",  (JSN_BRK ? ']' : '}' ));
+	        (void)fprintf(stdout,"%c",  (JSN ? ']' : '}' ));
 
       if(lmn != var_szm1)
         if((var->type == NC_CHAR && lmn%sng_lng == sng_lngm1) || var->type != NC_CHAR)
@@ -2040,31 +2048,29 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
       if(CDL && var->nbr_dim && lmn< var_szm1 && (lmn+1) % lmt_msa[var->nbr_dim-1]->dmn_cnt  ==0)
         (void)fprintf(stdout,"\n%*s",prn_ndn,spc_sng);
 
-      /* if(var.type != NC_CHAR && var.type != NC_STRING ) (void)fprintf(stdout,"%s%s",val_sng,(lmn != var_szm1) ? spr_sng : ""); */
 
     } /* end loop over element */
     rcd_prn+=0; /* CEWI */
 
     if(CDL){
-      char tmp_sng[100] = {0};
+      char tmp_sng[100]={0};
       if(nco_dbg_lvl_get() >= nco_dbg_std && flg_malloc_unit_var)
-        (void) sprintf(tmp_sng, "units=\"%s\"", unit_sng_var);
+	(void)sprintf(tmp_sng,"units=\"%s\"",unit_sng_var);
 
       if(nco_dbg_lvl_get() == nco_dbg_std && var_aux){
-        fprintf(stdout, "; // %s  ", tmp_sng);
+        fprintf(stdout, "; // %s  ",tmp_sng);
         // Print values as CDL text comment
-        nco_prn_var_val_cmt(var_aux, prn_flg);
+        nco_prn_var_val_cmt(var_aux,prn_flg);
       }else if(tmp_sng[0]){
-        (void)fprintf(stdout, " ; // %s\n", tmp_sng);
+        (void)fprintf(stdout, " ; // %s\n",tmp_sng);
       }else{
         (void) fprintf(stdout, " ; \n");
-      }
-    }
+      } /* !dbg */
+    } /* !CDL */
 
     if(XML) (void)fprintf(stdout,"</values>\n");
-    /* close out array bracket if sz>1 */ 
-    if(JSN && var->sz > 1 ) (void)fprintf(stdout,"]");
 
+    
   } /* end if CDL_OR_JSN_OR_XML */
 
   if(var->nbr_dim == 0 && !dlm_sng && TRD){
@@ -2085,7 +2091,7 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
           if(var->val.cp[lmn] != '\0'){
             (void)sprintf(var_sng,"%*s%%s = '%s' %%s\n",prn_ndn,spc_sng,nco_typ_fmt_sng(var->type));
             (void)fprintf(stdout,var_sng,var_nm,var->val.cp[lmn],unit_sng_var);
-          }else{ /* Deal with NUL character here */
+          }else{ /* 20171220 Deal with NUL character here, otherwise NUL will print as '0' (which ncdump does, though we think that is a bug) */
             (void)fprintf(stdout,"%*s%s = \"\" %s\n",prn_ndn,spc_sng,var_nm,unit_sng_var);
           } /* end if */
           break;
@@ -2108,7 +2114,7 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
           if(var->val.cp[lmn] != '\0'){
             (void)sprintf(var_sng,"'%s'\n",nco_typ_fmt_sng(var->type));
             (void)fprintf(stdout,var_sng,var->val.cp[lmn]);
-          }else{ /* Deal with NUL character here */
+          }else{ /* 20171220 Deal with NUL character here, otherwise NUL will print as '0' (which ncdump does, though we think that is a bug) */
             (void)fprintf(stdout, "\"\"\n");
           } /* end if */
           break;
@@ -3498,18 +3504,18 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
     if(var_idx == 0){ 
       if(JSN_BLOCK) (void)fprintf(stdout,",\n"); else JSN_BLOCK=True;              
       (void)fprintf(stdout,"%*s\"variables\": {\n",prn_ndn+prn_flg->spc_per_lvl,spc_sng);   
-    } 
+    } /* !var_idx */
         
     /* DOES NOT include a return as we may wanna add a COMMA */
     prn_flg->ndn=prn_ndn+2*prn_flg->spc_per_lvl; 
     (void)nco_prn_var_dfn(nc_id,prn_flg,&var_trv);
 
-    /* nco_prn_att() prints the final brace but no return - as we may need to add a comma */ 
+    /* nco_prn_att() prints final brace without carriage return since we may need to add a comma */
     if(prn_flg->PRN_VAR_METADATA && nco_att_nbr(grp_id,var_id) > 0){     
       (void)fprintf(stdout,",\n");            
       //prn_flg->ndn=prn_ndn+2*prn_flg->spc_per_lvl;  
       (void)nco_prn_att(grp_id,prn_flg,var_id);
-    } 
+    } /* !prn_flg */
         
     if( prn_flg->PRN_VAR_DATA){  
       (void)fprintf(stdout,",\n");  
@@ -3518,12 +3524,12 @@ nco_prn_jsn /* [fnc] Recursively print group contents */
     }else{
       (void)fprintf(stdout,"\n");        
     }
-    /* Close json tag -but dont add return as we may need to add comma later*/
-    (void)fprintf(stdout,"%*s}%s",prn_flg->ndn,spc_sng, (var_idx<var_nbr_xtr-1 ?",\n":"\n")  );   
+    /* Close JSON tag without carriage return since we may need to add comma later */
+    (void)fprintf(stdout,"%*s}%s",prn_flg->ndn,spc_sng, (var_idx<var_nbr_xtr-1 ?",\n":"\n"));
     
   } /* end loop over var_idx */
 
-  /* close out json variable tag */
+  /* Close-out JSON variable tag */
   if(var_nbr_xtr>0) (void)fprintf(stdout,"%*s}",prn_ndn+prn_flg->spc_per_lvl,spc_sng);   
 
   if((nbr_att > 0 || (prn_flg->hdn && grp_dpt == 0)) && prn_flg->PRN_GLB_METADATA){
diff --git a/src/nco/nco_sng_utl.c b/src/nco/nco_sng_utl.c
index 9f5d82d..8e30e19 100644
--- a/src/nco/nco_sng_utl.c
+++ b/src/nco/nco_sng_utl.c
@@ -319,7 +319,7 @@ nm2sng_cdl /* [fnc] Turn variable/dimension/attribute name into legal CDL */
 } /* end nm2sng_cdl() */
 
 char * /* O [sng] JSON-compatible name */
-nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal CDL */
+nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal JSON */
 (const char * const nm_sng) /* I [sng] Name to CDL-ize */
 {
   /* Valid JSON strings can be any selected set of control chars, any non-conrol chars from ASCII and Unicode 
@@ -552,8 +552,9 @@ chr2sng_jsn /* [fnc] Translate C language character to printable, visible ASCII
   case '\0':	
     break;
   default: 
-    /* json is quite strict about control-chars - only the above are allowed */
-    if(iscntrl(chr_val)) *val_sng=0; else sprintf(val_sng,"%c",chr_val);
+    /* JSON is quite strict about control-chars - only the above are allowed */
+    // if(iscntrl(chr_val)) *val_sng=0; else sprintf(val_sng,"%c",chr_val);
+    if(iscntrl(chr_val)) *val_sng='\0'; else sprintf(val_sng,"%c",chr_val);
     break;
   } /* end switch */
 
diff --git a/src/nco/nco_sng_utl.h b/src/nco/nco_sng_utl.h
index 00fab35..829f5e7 100644
--- a/src/nco/nco_sng_utl.h
+++ b/src/nco/nco_sng_utl.h
@@ -26,7 +26,8 @@
 
 #ifdef _MSC_VER
 # define NEED_STRSEP
-# define NEED_STRCASECMP
+//# define NEED_STRCASECMP (netcdf defines strcasecmp for MSVC)
+# define strncasecmp _strnicmp // (but not strncasecmp)
 # define NEED_STRCASESTR
 #endif /* !_MSC_VER */
 
@@ -113,7 +114,6 @@ extern "C" {
   char * /* O [sng] JSON -compatible name */
   nm2sng_jsn /* [fnc] Turn variable/dimension/attribute name into legal JSON */
   (const char * const nm_sng); /* I [sng] Name to CDL-ize */
-
   
   char * /* O [sng] CDL-compatible name */
   nm2sng_fl /* [fnc] Turn file name into legal string for shell commands */
diff --git a/src/nco/nco_var_avg.c b/src/nco/nco_var_avg.c
index e76747b..dc04429 100644
--- a/src/nco/nco_var_avg.c
+++ b/src/nco/nco_var_avg.c
@@ -49,10 +49,10 @@ nco_var_avg /* [fnc] Reduce given variable over specified dimensions */
   dmn_sct **dmn_avg;
   dmn_sct **dmn_fix;
 
-  int idx_avg_var[NC_MAX_DIMS];
-  /*  int idx_var_avg[NC_MAX_DIMS];*/ /* Variable is unused but instructive anyway */
-  int idx_fix_var[NC_MAX_DIMS];
-  /*  int idx_var_fix[NC_MAX_DIMS];*/ /* Variable is unused but instructive anyway */
+  int idx_avg_var[NC_MAX_VAR_DIMS];
+  /*  int idx_var_avg[NC_MAX_VAR_DIMS];*/ /* Variable is unused but instructive anyway */
+  int idx_fix_var[NC_MAX_VAR_DIMS];
+  /*  int idx_var_fix[NC_MAX_VAR_DIMS];*/ /* Variable is unused but instructive anyway */
   int idx;
   int idx_dmn;
   int dmn_avg_nbr;
@@ -249,10 +249,10 @@ nco_var_avg /* [fnc] Reduce given variable over specified dimensions */
       long avg_lmn;
       long fix_lmn;
       long var_lmn;
-      long dmn_ss[NC_MAX_DIMS];
-      long dmn_var_map[NC_MAX_DIMS];
-      long dmn_avg_map[NC_MAX_DIMS];
-      long dmn_fix_map[NC_MAX_DIMS];
+      long dmn_ss[NC_MAX_VAR_DIMS];
+      long dmn_var_map[NC_MAX_VAR_DIMS];
+      long dmn_avg_map[NC_MAX_VAR_DIMS];
+      long dmn_fix_map[NC_MAX_VAR_DIMS];
 
       dmn_var_nbr_m1=dmn_var_nbr-1;
       typ_sz=nco_typ_lng(fix->type);
diff --git a/src/nco/nco_var_utl.c b/src/nco/nco_var_utl.c
index 3558dc0..cdf8cfe 100644
--- a/src/nco/nco_var_utl.c
+++ b/src/nco/nco_var_utl.c
@@ -1155,7 +1155,7 @@ nco_var_dfn /* [fnc] Define variables and write their attributes to output file
   const char fnc_nm[]="nco_var_dfn()"; /* [sng] Function name */
 
   int dmn_nbr=0;
-  int dmn_id_vec[NC_MAX_DIMS];
+  int dmn_id_vec[NC_MAX_VAR_DIMS];
   int idx;
   int dmn_idx;
   int fl_fmt; /* [enm] Output file format */
diff --git a/src/nco_c++/nco_utl.cc b/src/nco_c++/nco_utl.cc
index 1fdb968..c529cef 100644
--- a/src/nco_c++/nco_utl.cc
+++ b/src/nco_c++/nco_utl.cc
@@ -141,7 +141,7 @@ nco_inq_varsz // [fnc] Compute size of variable
 {
   // Purpose: Compute size (number of elements) in specified variable
   int dmn_nbr; // [nbr] Number of dimensions
-  //  int dmn_id[NC_MAX_DIMS]; // [id] Dimension IDs
+  //  int dmn_id[NC_MAX_VAR_DIMS]; // [id] Dimension IDs
   size_t dmn_sz; // [nbr] Dimension size
   int rcd=nco_inq_varndims(nc_id,var_id,dmn_nbr);
   int *dmn_id=new int[dmn_nbr]; // [id] Dimension IDs

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