[nco] 03/09: Imported Upstream version 4.5.5

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat Feb 27 18:14:35 UTC 2016


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

sebastic pushed a commit to branch master
in repository nco.

commit 371661d0884167d76c7842ec64886a4b5aa0ba41
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Feb 27 18:11:46 2016 +0100

    Imported Upstream version 4.5.5
---
 bld/Makefile                      |   2 +-
 bld/nco.spec                      |  11 +-
 bld/nco_dst.pl                    |  30 +-
 bm/NCO_rgr.pm                     | 141 +++++-
 configure                         |  27 +-
 configure.ac                      |   6 +-
 configure.eg                      |  28 +-
 data/in.cdl                       |  13 +
 data/in_grp_8.cdl                 |  44 ++
 data/mdl_1.cdl                    |  52 ++-
 data/mdl_2.cdl                    |  24 +-
 data/ncremap                      | 507 ++++++++++++++++------
 debian/changelog                  |   6 +
 doc/ANNOUNCE                      | 172 ++++----
 doc/ChangeLog                     | 191 +++++++-
 doc/TODO                          |   3 +-
 doc/VERSION                       |   2 +-
 doc/debian.txt                    | 162 +++----
 doc/index.shtml                   | 107 +++--
 doc/milestones_old.shtml          |  30 +-
 doc/nco.texi                      | 628 +++++++++++++++++++--------
 man/ncremap.1                     |   4 +
 src/nco++/Makefile.am             |   3 +
 src/nco++/Makefile.in             |   3 +
 src/nco++/fmc_all_cls.cc          | 230 +++++++++-
 src/nco++/fmc_all_cls.hh          |   3 +-
 src/nco++/ncap2_utl.cc            |  25 +-
 src/nco++/ncap2_utl.hh            |   1 +
 src/nco++/ncoEnumTokenTypes.hpp   |   9 +-
 src/nco++/ncoGrammer.g            | 288 +++++++++++-
 src/nco++/ncoLexer.cpp            |  20 +-
 src/nco++/ncoLexer.hpp            |   4 +-
 src/nco++/ncoParser.cpp           |   3 +-
 src/nco++/ncoParser.hpp           |   6 +-
 src/nco++/ncoParserTokenTypes.hpp |  13 +-
 src/nco++/ncoTree.cpp             | 892 +++++++++++++++++++++++++-------------
 src/nco++/ncoTree.hpp             |   6 +-
 src/nco++/nco_antlr_pst_prc.pl    |   3 +-
 src/nco/ESMC_CoordSys.h           |  37 --
 src/nco/ncatted.c                 |   6 +-
 src/nco/ncks.c                    |  19 +-
 src/nco/nco.h                     |  39 +-
 src/nco/nco_att_utl.c             |  20 +-
 src/nco/nco_att_utl.h             |   1 +
 src/nco/nco_cnf_typ.c             |   4 +-
 src/nco/nco_ctl.c                 |   8 +-
 src/nco/nco_fl_utl.c              |  24 +-
 src/nco/nco_grp_utl.c             | 281 +++++++-----
 src/nco/nco_grp_utl.h             |  24 +-
 src/nco/nco_lst_utl.c             |   6 +-
 src/nco/nco_msa.c                 |  24 +-
 src/nco/nco_mss_val.c             |   8 +-
 src/nco/nco_netcdf.c              |  64 ++-
 src/nco/nco_netcdf.h              |  30 +-
 src/nco/nco_ppc.c                 |  94 ++--
 src/nco/nco_ppc.h                 |   8 -
 src/nco/nco_prn.c                 |   2 +-
 src/nco/nco_prn.h                 |   1 +
 src/nco/nco_rgr.c                 | 482 +++++++++++++++++---
 src/nco/nco_rgr.h                 |  20 +
 src/nco/nco_rth_utl.c             |  36 +-
 src/nco/nco_sng_utl.c             |   4 +-
 src/nco/nco_var_avg.h             |   1 +
 src/nco/nco_var_utl.c             |   7 +-
 src/nco/ncpdq.c                   |   7 -
 src/nco/ncra.c                    |  13 +-
 src/nco/ncrename.c                |   2 +
 src/nco/ncwa.c                    |  16 +-
 68 files changed, 3621 insertions(+), 1366 deletions(-)

diff --git a/bld/Makefile b/bld/Makefile
index c7e212d..d7dc64c 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -401,7 +401,7 @@ else
   ESMF_INC_FLG := -I/usr/local/include
 endif # endif ESMF_ROOT
 endif # endif ESMF_INC
-# 20150319: For some reaseon, ESMC.h #includes ESMC_VM.h which #includes mpi.h
+# 20150319: For some reason, ESMC.h #includes ESMC_VM.h which #includes mpi.h
 ifeq (${PVM_ARCH},MACOSX)
 # Use stub header for uniprocessor MPI emulation provided by ESMF
  ESMF_INC_FLG += -I/Users/zender/data/esmf/src/Infrastructure/stubs/mpiuni
diff --git a/bld/nco.spec b/bld/nco.spec
index 4463201..3ae4ee2 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.5.4
+Version:        4.5.5
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.5.4-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.5.5-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.5.4-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-4.5.4/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.5.5-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.5.5/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 Feb 07 2016 Charlie Zender <zender at uci.edu> - 4.5.5-1
+- new upstream 4.5.5
+
 * Thu Jan 07 2016 Charlie Zender <zender at uci.edu> - 4.5.4-1
 - new upstream 4.5.4
 
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index 8dba517..230e050 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.5.4.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.5.4 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.5.4 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.5.4 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.5.4 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.5.4
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.5.4
+# /usr/bin/scp ${DATA}/nco-4.5.5.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.5.5 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.5.5 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.5.5 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.5.5 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.5.5
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.5.5
 
 # 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.5.4/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.5.5/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
     cmd_prc("$rsh_cmd $www_mch $rm_cmd $www_drc/src/$dst_fl"); # Remove any distribution with same name
     if($dly_snp){cmd_prc("$rsh_cmd $www_mch $rm_cmd -r $www_drc/src/nco-????????.tar.gz");} # Remove previous daily snapshots from WWW server
     cmd_prc("$rcp_cmd $dst_fl $www_mch:$www_drc/src"); # Copy local tarfile to WWW server
diff --git a/bm/NCO_rgr.pm b/bm/NCO_rgr.pm
index c5ebf01..3078a2c 100644
--- a/bm/NCO_rgr.pm
+++ b/bm/NCO_rgr.pm
@@ -109,6 +109,7 @@ sub tst_rgr {
   if($exit_value == 432){print "netCDF version 4.3.2 detected\n";}
   if($exit_value == 433){print "netCDF version 4.3.3 detected\n";}
   if($exit_value == 440){print "netCDF version 4.4.0 detected\n";}
+  if($exit_value == 441){print "netCDF version 4.4.1 detected\n";}
 
   if($exit_value >= 400){$RUN_NETCDF4_TESTS=1;}
   if($exit_value >= 431){$RUN_NETCDF4_TESTS_VERSION_GE_431=1;}
@@ -232,6 +233,17 @@ print "\n";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
+    $dsc_sng="Run script to to test gsl functions -FAILS IF NOT linked to gsl lib";
+    $tst_cmd[0]="ncap2 -h -O $fl_fmt $nco_D_flg -v -S '../data/gsl_sf.in' $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v nbr_err_ttl -s '%d' %tmp_fl_00%";
+    $tst_cmd[2]="0";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+
+
+
     $USER=$ENV{'USER'};
     if($USER eq 'zender'){
 	# Regridding regression tests
@@ -784,7 +796,7 @@ print "\n";
 # 544.4 = (file 1 tas1) 272.1 + (file 2 tas1) 272.3
     $dsc_sng="(Groups) Process ensembles in both files mdl_1.nc mdl_2.nc";
     $tst_cmd[0]="ncbo -O --op_typ=add $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc mdl_2.nc %tmp_fl_00%";
-	$tst_cmd[1]="ncks -C -g cesm_01 -v tas1 %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -g cesm_01 -v tas1 %tmp_fl_00%";
     $tst_cmd[2]="time[3]=4 tas1[3]=544.4";
     $tst_cmd[3]="SS_OK";   
     NCO_bm::tst_run(\@tst_cmd);
@@ -795,7 +807,7 @@ print "\n";
 #ncks -g cesm_01 -v time ~/foo.nc
     $dsc_sng="(Groups) Process ensembles in both files mdl_1.nc mdl_2.nc (check fixed variables)";
     $tst_cmd[0]="ncbo -O $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc mdl_2.nc %tmp_fl_00%";
-	$tst_cmd[1]="ncks -g cesm_01 -v time %tmp_fl_00%";
+    $tst_cmd[1]="ncks -g cesm_01 -v time %tmp_fl_00%";
     $tst_cmd[2]="time[3]=4";
     $tst_cmd[3]="SS_OK";   
     NCO_bm::tst_run(\@tst_cmd);
@@ -807,7 +819,7 @@ print "\n";
 # 544.1 = (file 1 tas1) 272.1 + (file 2 tas1) 273.0
     $dsc_sng="(Groups) Process ensembles in file 1 with common variable at root in file 2";
     $tst_cmd[0]="ncbo -O --op_typ=add $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc obs.nc %tmp_fl_00%";
-	$tst_cmd[1]="ncks -C -g cesm_01 -v tas1 %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -g cesm_01 -v tas1 %tmp_fl_00%";
     $tst_cmd[2]="time[3]=4 tas1[3]=545.1";
     $tst_cmd[3]="SS_OK";   
     NCO_bm::tst_run(\@tst_cmd);
@@ -818,12 +830,11 @@ print "\n";
 #ncks -g ecmwf_01 -v time
     $dsc_sng="(Groups) Process ensembles in file 1 with common variable at root in file 2 (check fixed variables)";
     $tst_cmd[0]="ncbo -O $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc obs.nc %tmp_fl_00%";
-	$tst_cmd[1]="ncks -g ecmwf_01 -v time %tmp_fl_00%";
+    $tst_cmd[1]="ncks -g ecmwf_01 -v time %tmp_fl_00%";
     $tst_cmd[2]="time[3]=4";
     $tst_cmd[3]="SS_OK";   
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array 	
-
 	
 # ncbo 
 #ncbo -O --op_typ=add  obs.nc mdl_1.nc ~/foo.nc
@@ -881,9 +892,9 @@ print "\n";
 #result =
 # 544.25 = 272.15 + 272.1
     $dsc_sng="(Groups) Ensemble with 1 member (mdl_3.nc)";
-	$tst_cmd[0]="ncra -Y ncge -O $fl_fmt $nco_D_flg $in_pth_arg mdl_3.nc %tmp_fl_00%";
+    $tst_cmd[0]="ncra -Y ncge -O $fl_fmt $nco_D_flg $in_pth_arg mdl_3.nc %tmp_fl_00%";
     $tst_cmd[1]="ncbo --op_typ=add -O $fl_fmt $nco_D_flg %tmp_fl_00% $in_pth/mdl_3.nc %tmp_fl_01%";
-	$tst_cmd[2]="ncks -H -C -g cesm_01 -v tas1 %tmp_fl_01%";
+    $tst_cmd[2]="ncks -H -C -g cesm_01 -v tas1 %tmp_fl_01%";
     $tst_cmd[3]="time[3] tas1[3]=544.25";
     $tst_cmd[4]="SS_OK";   
     NCO_bm::tst_run(\@tst_cmd);
@@ -1112,7 +1123,6 @@ print "\n";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# NEW NCO 4.4.2
 #nces #19 (check coordinate variables)
 # ncra -Y ncge -h -O mdl_1.nc ~/foo.nc
 # ncks -g cesm -v time ~/foo.nc
@@ -1125,7 +1135,6 @@ print "\n";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# NEW NCO 4.4.3
 #nces #20 (error checking of ensemble variable dimensions)
 #  ncra -Y ncge -O in_grp_4.nc in_grp_5.nc ~/foo.nc
 	
@@ -1136,7 +1145,6 @@ print "\n";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# NEW NCO 4.4.3
 #nces #21 
 # ncra -Y ncge -h -O mdl_1.nc ~/foo.nc
 	
@@ -1147,9 +1155,55 @@ print "\n";
     $tst_cmd[3]="SS_OK";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
+	
+#nces #22 
+# ncks mdl_1.nc -v /cesm/cesm_02/time | grep 'time attribute 0: long_name'
+# ncra -Y ncge -O --nsm_grp -p ~/nco/data mdl_1.nc ~/foo.nc
+# ncks -v /cesm/time ~/foo.nc | grep 'time attribute 0: long_name'
+
+    $dsc_sng="(Groups) Test copy of attributes for coordinate variables (time)";
+    $tst_cmd[0]="ncra -Y ncge $omp_flg -O --nsm_grp $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -v /cesm/time %tmp_fl_00% | grep 'time attribute 0: long_name'";
+    $tst_cmd[2]="time attribute 0: long_name, size = 4 NC_CHAR, value = time";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
 
    } # #### Group Ensemble tests	
     
+#nces #23
+# nces -O -y mebs -v one -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v one ~/foo.nc
+    $dsc_sng="Test mebs normalization";
+    $tst_cmd[0]="ncra -Y ncfe -y mebs -v one $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v one %tmp_fl_00%";
+    $tst_cmd[2]="one = 1";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+#nces #24
+# nces -O -y tabs -v one -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v one ~/foo.nc
+    $dsc_sng="Test tabs (total absolute value)";
+    $tst_cmd[0]="ncra -Y ncfe -y tabs -v one $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v one %tmp_fl_00%";
+    $tst_cmd[2]="one = 2";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+#nces #25
+# nces -O -y tabs -v lond -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v lon -d lon,3 ~/foo.nc
+    $dsc_sng="Test tabs on coordinate";
+    $tst_cmd[0]="ncra -Y ncfe -y tabs -v lond $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v lon -d lon,3 %tmp_fl_00%";
+    $tst_cmd[2]="lon[3] = 270";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
 # print "paused - hit return to continue"; my $wait=<STDIN>;
     
 ####################
@@ -2650,7 +2704,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     
 if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 
-#ncks #93
+#ncks #107
 #ncks -O -D 5 -C -d lat,0 -v one,four --cnk_plc=xst --cnk_map=xst ~/nco/data/hdn.nc ~/foo.nc
     $dsc_sng="Chunking multiple variables while hyperslabbing";
     $tst_cmd[0]="ncks -O $nco_D_flg -C -d lat,0 -v one,four --cnk_plc=xst --cnk_map=xst $in_pth_arg hdn.nc %tmp_fl_00%";
@@ -2660,7 +2714,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-#ncks #107
+#ncks #108
 #ncks -O -D 5 -C -d lat,0 -v var_shf --cnk_plc=uck ~/nco/data/hdn.nc ~/foo.nc
     $dsc_sng="Unchunking variable with Shuffle flag set";
     $tst_cmd[0]="ncks -O $nco_D_flg -C -v var_shf --cnk_plc=uck $in_pth_arg hdn.nc %tmp_fl_00%";
@@ -2670,7 +2724,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# ncks #108
+# ncks #109
 # ncks -h -O --gaa script=nco_climo.sh ~/nco/data/in.nc ~/foo.nc
 # ncks -M ~/foo.nc | grep script | cut -d ' ' -f 11    
     $dsc_sng="Add single global attribute";
@@ -2681,7 +2735,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# ncks #109
+# ncks #110
 # ncks -h -O --gaa foo=bar --gaa foo2,foo3=bar2 --gaa script='created by nco_climo.sh' ~/nco/data/in.nc ~/foo.nc
 # ncks -M ~/foo.nc | grep script | cut -d ' ' -f 11-13    
     $dsc_sng="Add multiple global attributes";
@@ -2692,7 +2746,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
-# ncks #110
+# ncks #111
 # NB: This tests whether the output file has global metadata, and that provides (circumstantial) evidence that there were no major problems in the intervening routines of grid generation
 # ncks -O -v one -D 5 -t 1 --rgr grd_ttl='FV-scalar grid' --rgr grid=~/65x128_SCRIP.nc --rgr lat_nbr=65 --rgr lon_nbr=128 --rgr lat_typ=FV --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
 # ncks -M ~/foo.nc | grep "julian" | cut -d ' ' -f 4
@@ -2706,6 +2760,26 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 
 } # RUN_NETCDF4_TESTS_VERSION_GE_431
 	
+# ncks #112 wrapped limit with an additional limit (no --msa)
+# ncks -O -C -g g19 -v time -d time,9,0 -d time,1,2 ~/nco/data/in_grp_3.nc ~/foo.nc
+    $dsc_sng="(Groups) Test wrapped limit with addtional limit (no --msa)";
+    $tst_cmd[0]="ncks -O $nco_D_flg -C -g g19 -v time -d time,9,0 -d time,1,2 $in_pth_arg in_grp_3.nc %tmp_fl_00";
+    $tst_cmd[1]="ncks -H %tmp_fl_00 | grep '=10'";
+    $tst_cmd[2]="time[3]=10"; 
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+	
+#ncks #113 wrapped limit with an additional limit (with --msa) pvn20160211 -- bug found that happens in nco 4.2.0 also
+# ncks -O -C --msa -g g19 -v time -d time,9,0 -d time,1,2 ~/nco/data/in_grp_3.nc ~/foo.nc
+    $dsc_sng="(Groups) Test wrapped limit with additonal limit and msa user order (expect failure TODO)";
+    $tst_cmd[0]="ncks -O $nco_D_flg -C --msa -g g19 -v time -d time,9,0 -d time,1,2 $in_pth_arg in_grp_3.nc %tmp_fl_00";
+    $tst_cmd[1]="ncks -H %tmp_fl_00 | grep '=3'";
+    $tst_cmd[2]="time[3]=3"; 
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+	
 #####################
 #### ncpdq tests #### -OK !
 #####################
@@ -3242,7 +3316,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 
 #ncpdq #41
 #ncpdq -O -a -lat -g g23,g24 ~/nco/data/in_grp_3.nc ~/foo.nc
-   $dsc_sng="(Groups) Reverse -a lat -g g24 several groups";
+   $dsc_sng="(Groups) Reverse -a lat -g g24 several groups (expect failure TODO)";
    $tst_cmd[0]="ncpdq $omp_flg $fl_fmt $nco_D_flg -O -a -lat -g g23,g24 $in_pth_arg in_grp_3.nc %tmp_fl_00%";
    $tst_cmd[1]="ncks -v lat -g g24 %tmp_fl_00%";
    $tst_cmd[2]="lat[1]=-60 degrees_north";
@@ -4954,6 +5028,39 @@ if(0){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 
+#ncwa #67
+# ncwa -O -y mebs -v one_dmn_rec_var_flt -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v one_dmn_rec_var_flt ~/foo.nc
+    $dsc_sng="Test mebs normalization";
+    $tst_cmd[0]="ncwa -y mebs -v one_dmn_rec_var_flt $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v one_dmn_rec_var_flt %tmp_fl_00%";
+    $tst_cmd[2]="one_dmn_rec_var_flt = 5.5";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+#ncwa #68
+# ncwa -O -y tabs -v one_dmn_rec_var -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v one_dmn_rec_var ~/foo.nc
+    $dsc_sng="Test tabs (total absolute value)";
+    $tst_cmd[0]="ncwa -y tabs -v one_dmn_rec_var $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v one_dmn_rec_var %tmp_fl_00%";
+    $tst_cmd[2]="one_dmn_rec_var = 55";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
+#ncwa #69
+# ncwa -O -y tabs -v lon -p ~/nco/data in.nc in.nc ~/foo.nc
+# ncks -C -H -v lon ~/foo.nc
+    $dsc_sng="Test tabs on coordinate";
+    $tst_cmd[0]="ncwa -y tabs -v lon $omp_flg -O $fl_fmt $nco_D_flg $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -v lon %tmp_fl_00%";
+    $tst_cmd[2]="lon = 135";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array	
+
 ####################
 #### ncrename tests #### OK!
 ####################
@@ -5409,7 +5516,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 #ncrename -O -d lev,z -d lat,y -d lon,x ~/nco/data/in_grp.nc ~/foo.nc
 #ncks -H -s %d -v one ~/foo.nc
 # Check for corruption after simultaneously renaming multiple dimensions in netCDF4 file
-    $dsc_sng="netCDF4: Simultaneously rename multiple dimensions (requires netCDF 4.4.0)";
+    $dsc_sng="netCDF4: Simultaneously rename multiple dimensions (requires netCDF 4.4.1)";
     $tst_cmd[0]="ncrename -O $fl_fmt $nco_D_flg -d lev,z -d lat,y -d lon,x $in_pth_arg in_grp.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -H -s %d -v one %tmp_fl_00%";
     $tst_cmd[2]="1";
diff --git a/configure b/configure
index 02c7b3a..01a07c4 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.5.4.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.5.5.
 #
 # 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.5.4'
-PACKAGE_STRING='NCO netCDF Operators 4.5.4'
+PACKAGE_VERSION='4.5.5'
+PACKAGE_STRING='NCO netCDF Operators 4.5.5'
 PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1393,7 +1393,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.5.4 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.5.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1464,7 +1464,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of NCO netCDF Operators 4.5.4:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.5.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1505,7 +1505,10 @@ Optional Features:
   --enable-i18n           Internationalization (i18n) support (WARNING:
                           Experimental, for future use) [[default=no]]
   --enable-nco_cplusplus  Build NCO C++ interface library [[default=yes]]
-  --enable-esmf           Build-in ESMF support if possible [[default=yes]]
+  --enable-esmf           Build-in ESMF support for integrated (instead of
+                          off-line) regridding. WARNING: Development code =
+                          Unsupported (and not necessary for regridding!
+                          Dragons lurk here.) [[default=yes]]
   --enable-gsl            Build-in GSL support if possible [[default=yes]]
   --enable-regex          Allow extended regular expressions [[default=yes]]
   --enable-udunits        Build-in UDUnits support if possible [[default=no]]
@@ -1629,7 +1632,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NCO netCDF Operators configure 4.5.4
+NCO netCDF Operators configure 4.5.5
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2495,7 +2498,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.5.4, which was
+It was created by NCO netCDF Operators $as_me 4.5.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3744,7 +3747,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nco'
- VERSION='4.5.4'
+ VERSION='4.5.5'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -19012,7 +19015,7 @@ if test "${C_INC}"; then
 # C_INC is useful on AIX platforms that have alternative C-compilers (e.g., gcc) installed in a directory (e.g., /usr/local) searched for other software (e.g., antlr)
 # Specifying both C_INC and ANTLR_INC would cause the pre-processor to grab
 # C-headers from C_INC and antlr headers from ANTLR_INC
-# Using C_INC is required on UCI's ESMF
+# Using C_INC was required on UCI's old ESMF
     CPPFLAGS="-I${C_INC} ${CPPFLAGS}"
 fi
 ac_ext=cpp
@@ -21467,7 +21470,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.5.4, which was
+This file was extended by NCO netCDF Operators $as_me 4.5.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21533,7 +21536,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.5.4
+NCO netCDF Operators config.status 4.5.5
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 54a3b05..db98a5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@
 
 # Process configure input with autoconf to produce configure script
 # (package name,version,bug-report-address,tarball name)
-AC_INIT([NCO netCDF Operators],[4.5.4],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[4.5.5],[nco-bugs at lists.sourceforge.net],[nco])
 
 # Print GNU copyright in configure script
 AC_COPYRIGHT
@@ -401,7 +401,7 @@ if test "${C_INC}"; then
 # C_INC is useful on AIX platforms that have alternative C-compilers (e.g., gcc) installed in a directory (e.g., /usr/local) searched for other software (e.g., antlr)
 # Specifying both C_INC and ANTLR_INC would cause the pre-processor to grab 
 # C-headers from C_INC and antlr headers from ANTLR_INC
-# Using C_INC is required on UCI's ESMF
+# Using C_INC was required on UCI's old ESMF
     CPPFLAGS="-I${C_INC} ${CPPFLAGS}"
 fi
 AC_LANG_PUSH([C++])
@@ -531,7 +531,7 @@ AC_ARG_VAR(ESMF_LIB,Location of ESMF library (compile-time))
 # Store pre-ESMF LIBS value to restore from later
 nco_LIBS_no_ESMF="${LIBS}"
 nco_CPPFLAGS_no_ESMF="${CPPFLAGS}"
-AC_ARG_ENABLE(esmf,AS_HELP_STRING([--enable-esmf],[Build-in ESMF support if possible [[default=yes]]]),enable_esmf=${enableval},enable_esmf=yes)
+AC_ARG_ENABLE(esmf,AS_HELP_STRING([--enable-esmf],[Build-in ESMF support for integrated (instead of off-line) regridding. WARNING: Development code = Unsupported (and not necessary for regridding! Dragons lurk here.) [[default=yes]]]),enable_esmf=${enableval},enable_esmf=yes)
 if test "${enable_esmf}" != 'yes'; then
     enable_esmf='no'
 fi
diff --git a/configure.eg b/configure.eg
index 3e7e3cd..d871c60 100644
--- a/configure.eg
+++ b/configure.eg
@@ -332,6 +332,17 @@ 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:/var/www/html/nco/rgr
 
+# gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on aims4:
+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
+/bin/cp -f config.log nco.config.log.${GNU_TRP}.foo
+/bin/cp -f libtool nco.libtool.${GNU_TRP}.foo
+make clean;make > nco.make.${GNU_TRP}.foo 2>&1
+make check >> nco.make.${GNU_TRP}.foo 2>&1
+make install >> nco.make.${GNU_TRP}.foo 2>&1
+scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:/var/www/html/nco/rgr
+
 # gcc/g++ Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on pileus:
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
@@ -343,10 +354,19 @@ 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:/var/www/html/nco/rgr
 
-# Commands used for Configure builds with gcc/++ on rhea
-fxm
+# gcc/g++ 20160107 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
+export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE'
+export LINUX_CXX='g++ -std=c++11'
+export LINUX_FC='gfortran'
+module unload PE-intel # CSZ 
+module load PE-gnu # CSZ 
+module add gsl hdf5
+export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib':${LD_LIBRARY_PATH}
+export NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' 
+export PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/bin':${PATH}
+cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' SZ=Y SZ_LIB='/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
 
-# icc/icpc Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
+# icc/icpc 20160107 Zender tried and failed to use this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
 export GNU_TRP=`~/nco/autobld/config.guess`
 # Commands used for Makefile builds
 module avail
@@ -359,7 +379,7 @@ export NETCDF_ROOT='/ccs/proj/cli900/sw/redhat/netcdf/4.3.3.1/rhel6.6_intel-14.0
 cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/ccs/proj/cli900/sw/redhat/netcdf/4.3.3.1/rhel6.6_intel-14.0.4--with-dap+hdf4' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
 cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/ccs/proj/cli900/sw/redhat/netcdf/4.3.3.1/rhel6.6_intel-14.0.4--with-dap+hdf4' SZ=Y SZ_LIB='/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
 
-# Commands used for Configure builds with icc/icpc on rhea
+# 20160107 Zender tried and failed these Commands used for Configure builds with icc/icpc on rhea
 module add intel gsl udunits climate/netcdf/4.3.3.1
 export LDFLAGS="${NETCDF_CLIB} ${GSL_LIB} ${SZIP_POST_LINK_OPTS}"
 export CPPFLAGS="-I${NETCDF_DIR}/include ${GSL_INCLUDE_OPTS} ${SZIP_INCLUDE_OPTS}"
diff --git a/data/in.cdl b/data/in.cdl
index 717c9b9..cdb6574 100644
--- a/data/in.cdl
+++ b/data/in.cdl
@@ -1152,6 +1152,12 @@ variables:
 	float txyz(time,lon,lat,lev);
 	txyz:long_name = "four dimensional record variable stored in txyz (time,lon,lat,lev) order";
 
+	float xyz(lon,lat,lev);
+	xyz:long_name = "three dimensional variable stored in xyz (lon,lat,lev) order";
+	
+	float tyz(time,lat,lev);
+	tyz:long_name = "three dimensional record variable stored in tyz (time,lat,lev) order";
+	
 	float four_dmn_rec_var(time,lat,lev,lon);
 	four_dmn_rec_var:long_name = "four dimensional record variable";
 	four_dmn_rec_var:units = "watt meter-2";
@@ -1725,6 +1731,13 @@ data:
 	tz=		1,2,3,4,5,6,7,8,9,10,
 			11,12,13,14,15,16,17,18,19,20,
 			21,22,23,24,25,26,27,28,29,30;
+	tyz=		1,2,3,4,5,6,7,8,9,10,
+			11,12,13,14,15,16,17,18,19,20,
+			21,22,23,24,25,26,27,28,29,30,
+	                31,32,33,34,35,36,37,38,39,40,
+                        41,42,43,44,45,46,47,48,49,50,
+			51,52,53,54,55,56,57,58,59,60;
+	xyz=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23;
 	txyz=		 	  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,
 				 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
 				 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
diff --git a/data/in_grp_8.cdl b/data/in_grp_8.cdl
new file mode 100644
index 0000000..43cd57d
--- /dev/null
+++ b/data/in_grp_8.cdl
@@ -0,0 +1,44 @@
+// -*-C++-*-
+// Purpose: 
+// Generate netCDF files with:
+// ncgen -k 4 -b -o ~/nco/data/in_grp_8.nc ~/nco/data/in_grp_8.cdl
+
+netcdf in_grp_8 {
+ dimensions:
+  lat=2;
+  lon=4;
+  time=unlimited; 
+ variables:
+  float two_dmn_rec_var(time,lat);
+  float three_dmn_rec_var1(time,lat,lon);
+  float three_dmn_rec_var2(time,lat,lon);
+  double time(time); 
+  float lat(lat);
+  float lon(lon);
+ data:
+  lat=-90,90;
+  lon=0,90,180,270;
+  time=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.;
+  two_dmn_rec_var=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20;
+  three_dmn_rec_var1=1, 2, 3, 4, 5, 6, 7, 8,
+      9,10,11,12,13,14,15,16,
+      17,18,19,20,21,22,23,24,
+      25,26,27,28,29,30,31,32,
+      33,34,35,36,37,38,39,40,
+      41,42,43,44,45,46,47,48,
+      49,50,51,52,53,54,55,56,
+      57,58,59,60,61,62,63,64,
+      65,66,67,68,69,70,71,72,
+      73,74,75,76,77,78,79,80;
+  three_dmn_rec_var2=1, 2, 3, 4, 5, 6, 7, 8,
+      9,10,11,12,13,14,15,16,
+      17,18,19,20,21,22,23,24,
+      25,26,27,28,29,30,31,32,
+      33,34,35,36,37,38,39,40,
+      41,42,43,44,45,46,47,48,
+      49,50,51,52,53,54,55,56,
+      57,58,59,60,61,62,63,64,
+      65,66,67,68,69,70,71,72,
+      73,74,75,76,77,78,79,80;	  
+ 
+} // root group
diff --git a/data/mdl_1.cdl b/data/mdl_1.cdl
index cdce24d..72d5875 100644
--- a/data/mdl_1.cdl
+++ b/data/mdl_1.cdl
@@ -19,14 +19,17 @@ netcdf mdl_1 {
       time=unlimited;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
-	  float gw(time); //test CF fixed variables (using time as dimension, usually dimension is lat)
+    tas1:long_name = "surface air temperature";
+      float tas2(time);
+      double time(time);
+    time:long_name = "time";
+    time:units = "days since 1964-03-12 12:09:00 -9:00"; 
+      float gw(time); //test CF fixed variables (using time as dimension, usually dimension is lat)
     data:
       tas1=272.1,272.1,272.1,272.1;
-	  tas2=272.1,272.1,272.1,272.1;
-	  time=1.,2.,3.,4.;
-	  gw=1.,1.,1.,1.;
+      tas2=272.1,272.1,272.1,272.1;
+      time=1.,2.,3.,4.;
+      gw=1.,1.,1.,1.;
  
     } // cesm_01
 
@@ -41,14 +44,17 @@ netcdf mdl_1 {
       time=unlimited;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
-	  float gw(time);
+    tas1:long_name = "surface air temperature";
+      float tas2(time);
+      double time(time);
+    time:long_name = "time";
+    time:units = "days since 1964-03-12 12:09:00 -9:00"; 
+      float gw(time);
     data:
       tas1=272.2,272.2,272.2,272.2;
-	  tas2=272.2,272.2,272.2,272.2;
-	  time=1.,2.,3.,4.;
-	  gw=2.,2.,2.,2.;
+      tas2=272.2,272.2,272.2,272.2;
+      time=1.,2.,3.,4.;
+      gw=2.,2.,2.,2.;
       
     } // cesm_02
     
@@ -67,12 +73,15 @@ netcdf mdl_1 {
       time=unlimited;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
+    tas1:long_name = "surface air temperature";
+      float tas2(time);
+      double time(time);
+    time:long_name = "time";
+    time:units = "days since 1964-03-12 12:09:00 -9:00"; 
     data:
       tas1=273.1,273.1,273.1,273.1;
-	  tas2=273.1,273.1,273.1,273.1;
-	  time=1.,2.,3.,4.;
+      tas2=273.1,273.1,273.1,273.1;
+      time=1.,2.,3.,4.;
       
     } // ecmwf_01
     
@@ -87,12 +96,15 @@ netcdf mdl_1 {
       time=unlimited;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
+    tas1:long_name = "surface air temperature";
+      float tas2(time);
+      double time(time);
+    time:long_name = "time";
+    time:units = "days since 1964-03-12 12:09:00 -9:00"; 
     data:
       tas1=273.2,273.2,273.2,273.2;
-	  tas2=273.2,273.2,273.2,273.2;
-	  time=1.,2.,3.,4.;
+      tas2=273.2,273.2,273.2,273.2;
+      time=1.,2.,3.,4.;
       
     } // ecmwf_02
 
diff --git a/data/mdl_2.cdl b/data/mdl_2.cdl
index 32bb1ae..abefa9e 100644
--- a/data/mdl_2.cdl
+++ b/data/mdl_2.cdl
@@ -17,12 +17,12 @@ netcdf mdl_2 {
       time=4;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
+      float tas2(time);
+      double time(time);
     data:
       tas1=272.3,272.3,272.3,272.3;
-	  tas2=272.3,272.3,272.3,272.3;
-	  time=1.,2.,3.,4.;
+      tas2=272.3,272.3,272.3,272.3;
+      time=1.,2.,3.,4.;
  
     } // cesm_03
 
@@ -42,12 +42,12 @@ netcdf mdl_2 {
       time=4;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
+      float tas2(time);
+      double time(time);
     data:
       tas1=273.3,273.3,273.3,273.3;
-	  tas2=273.3,273.3,273.3,273.3;
-	  time=1.,2.,3.,4.;
+      tas2=273.3,273.3,273.3,273.3;
+      time=1.,2.,3.,4.;
       
     } // ecmwf_03
     
@@ -62,12 +62,12 @@ netcdf mdl_2 {
       time=4;
     variables:
       float tas1(time);
-	  float tas2(time);
-	  double time(time);
+      float tas2(time);
+      double time(time);
     data:
       tas1=273.4,273.4,273.4,273.4;
-	  tas2=273.4,273.4,273.4,273.4;
-	  time=1.,2.,3.,4.;
+      tas2=273.4,273.4,273.4,273.4;
+      time=1.,2.,3.,4.;
       
     } // ecmwf_04
 
diff --git a/data/ncremap b/data/ncremap
index fa93744..5ef29b3 100755
--- a/data/ncremap
+++ b/data/ncremap
@@ -1,7 +1,6 @@
 #!/bin/bash
 
-# Purpose: Regrid (subsets of) variables from netCDF files
-# Regrids all input files (possibly on different grids) to a single specified output grid
+# Purpose: Regrid (subsets of) netCDF files, possibly on different grids
 
 # Copyright (C) 2015-2016 Charlie Zender
 # This file is part of NCO, the netCDF Operators. NCO is free software.
@@ -28,10 +27,11 @@
 # Irvine, CA 92697-3100
 
 # Source: https://github.com/nco/nco/tree/master/data/ncremap
+# Documentation: http://nco.sf.net/nco.html#ncremap
 
-# Prerequisites: Bash, NCO, ESMF_RegridWeightGen
+# Prerequisites: Bash and NCO
+# For full functionality also install ESMF_RegridWeightGen and/or TempestRemap
 # Script could use other shells, e.g., dash (Debian default) after re-writing function definition and looping constructs
-# Script could use other weight-generators, e.g., TempestRemap by re-writing map-file command
 
 # Script runs in one of four modes:
 # 1. Free-will: Infer source and destination grids to generate map-file, then regrid
@@ -42,8 +42,6 @@
 # Use Free-Will, Old-Grid, or New-Grid mode to process Swath-Like-Data (SLD) where each input may be a granule on a new grid, yet all inputs are to be regridded to the same output grid
 # Use Pre-Destination mode to post-process models or analyses where all files are converted from the same source grid to the same destination grid so the map-file can be pre-generated and never change
 
-# Additional Documentation:
-
 # Configure paths at High-Performance Computer Centers (HPCCs) based on ${HOSTNAME}
 if [ -z "${HOSTNAME}" ]; then
     if [ -f /bin/hostname ] && [ -x /bin/hostname ] ; then
@@ -55,19 +53,46 @@ fi # HOSTNAME
 # Default input and output directory is ${DATA}
 if [ -z "${DATA}" ]; then
     case "${HOSTNAME}" in 
-	cooley* | cc* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN
-	edison* | hopper* | nid* ) DATA="${SCRATCH}" ; ;; # NERSC edison compute nodes named nidNNNNN
-	pileus* ) DATA="/lustre/atlas/proj-shared/cli115/${USER}" ; ;; # OLCF CADES
-	rhea* ) DATA="/lustre/atlas/proj-shared/cli115/${USER}" ; ;; # OLCF rhea compute nodes named rheaNNN
+	cooley* | cc* | mira* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN, 384 GB/node 
+	cori* | edison* | nid* ) DATA="${SCRATCH}" ; ;; # NERSC edison compute nodes named nidNNNNN, 24|64 cores|GB/node; cori 32|128 cores|GB/node
+	pileus* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF CADES
+	rhea* | titan* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF rhea compute nodes named rheaNNN, 128 GB/node
+	ys* ) DATA="/glade/p/work/${USER}" ; ;; # NCAR yellowstone compute nodes named ysNNN, 32 GB/node
 	* ) DATA='/tmp' ; ;; # Other
     esac # !HOSTNAME
 fi # DATA
+# Ensure batch jobs access correct 'mpirun' (or, on edison, 'aprun') command, netCDF library, and NCO executables and library:
+case "${HOSTNAME}" in 
+    cooley* | cc* | mira* )
+	# http://www.mcs.anl.gov/hs/software/systems/softenv/softenv-intro.html
+	soft add +mvapich2 
+        export PBS_NUM_PPN=12 # Spoof PBS on Soft (which knows nothing about node capabilities)
+	export PATH='/home/zender/bin'\:${PATH}
+	export LD_LIBRARY_PATH='/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
+    cori* | edison* | hopper* | nid* )
+	export PATH='/global/homes/z/zender/bin'\:${PATH}
+        export LD_LIBRARY_PATH='/global/homes/z/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
+    pileus* )
+	export PATH='/home/zender/bin'\:${PATH}
+	export LD_LIBRARY_PATH='/opt/ACME/uvcdat-2.2-build/install/Externals/lib:/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
+    rhea* | titan* )
+	# 20151017: CSZ next three lines guarantee finding mpirun
+	source ${MODULESHOME}/init/sh # 20150607: PMC added to find module command
+	module unload PE-intel # CSZ 
+	module load PE-gnu # CSZ 
+        export PATH='/ccs/home/zender/bin'\:${PATH}
+	export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib:/ccs/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
+    ys* )
+	# 20151018: Yellowstone support not yet tested in batch mode
+        export PATH='/glade/u/home/zender/bin'\:${PATH}
+        export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
+esac # !HOSTNAME
 
 # Test cases (examples for Charlie's machines):
 # ls ${DATA}/sld/raw/*.nc | ncremap -a conserve -D 0 -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
 # ncremap -a conserve -v FSNT -I ${DATA}/ne30/raw -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
 # ls ${DATA}/essgcm14/essgcm14*cam*0007*.nc | ncremap -a conserve -M -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
-# ncremap -a conserve -v FSNT -I ${DATA}/ -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
+# ncremap -a conserve -v FSNT -I ${DATA}/ne30/raw -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
 # ncremap -i AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
 # ncremap -v TSurfAir -i ${DATA}/hdf/AIRS.2015.01.15.001.L2.RetStd.v6.0.11.0.G15015142014.hdf -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
 # ncremap -v CloudFrc_A -i ${DATA}/hdf/AIRS.2002.08.01.L3.RetStd_H031.v4.0.21.0.G06104133732.hdf -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
@@ -85,9 +110,12 @@ fi # DATA
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.cice.h.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.pop.h.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.rtm.h0.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
+# MPAS:
+# ncremap -P mpas -i ${DATA}/mpas/raw/hist.ocn.0003-12-01_00.00.00.nc -m ${DATA}/maps/map_mpas120_TO_T62_aave.121116.nc -O ~/rgr
+# ncremap -P mpas -i ${DATA}/mpas/raw/hist.ocn.0003-12-01_00.00.00.nc -s ${DATA}/grids/fxm -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr
 # ACME benchmarks:
-# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m map_ne30np4_to_fv129x256_aave.150418.nc   -O ~/rgr
-# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m 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 -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.150418.nc   -O ~/rgr
+# ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
 # ncremap -v FSNT,AODVIS -w esmf    -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 -w 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
 
@@ -98,7 +126,6 @@ fi # DATA
 #          1 = Print configuration, full commands, and status to output during evaluation
 #          2 = As in dbg_lvl=1, but _do not evaluate commands_
 #          3 = As in dbg_lvl=1, and pass debug level through to NCO/ncks
-# thr_nbr: Thread number to use in NCO regridder, '-t 1' for one thread, '-t 2' for two threads...
 
 # Set script name and run directory
 drc_pwd=${PWD}
@@ -112,7 +139,7 @@ fnt_rvr=`tput smso` # Reverse
 
 # Defaults for command-line options and some derived variables
 # Modify these defaults to save typing later
-alg_typ='conserve' # [nbr] Algorithm for ESMF interpolation (bilinear|patch|neareststod|nearestdtos|conserve)
+alg_typ='bilinear' # [nbr] Algorithm for ESMF interpolation (bilinear|patch|neareststod|nearestdtos|conserve)
 dbg_lvl=0 # [nbr] Debugging level
 #drc_in="${drc_pwd}" # [sng] Input file directory
 drc_in='' # [sng] Input file directory
@@ -123,7 +150,6 @@ dst_fl='' # [sng] Destination file
 dst_xmp='dst.nc' # [sng] Destination file for examples
 #esmf_opt='--src_regional --dst_regional --ignore_unmapped' # [sng] ESMF_RegridWeightGen options
 esmf_opt='--ignore_unmapped' # [sng] ESMF_RegridWeightGen options
-#fml_nm='' # [sng] Family name (e.g., 'amip', 'control', 'experiment')
 fl_nbr=0 # [nbr] Number of files to remap
 gaa_sng="--gaa rgr_script=${spt_nm} --gaa rgr_hostname=${HOSTNAME} --gaa rgr_version=${nco_version}" # [sng] Global attributes to add
 grd_dst='' # [sng] Destination grid-file
@@ -136,6 +162,7 @@ hdr_pad='1000' # [B] Pad at end of header section
 in_fl='' # [sng] Input file
 #in_fl='AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc' # [sng] Input file
 in_xmp='in.nc' # [sng] Input file for examples
+job_nbr=2 # [nbr] Job simultaneity for parallelism
 map_fl='' # [sng] Map-file
 map_xmp='map.nc' # [sng] Map-file for examples
 mlt_map_flg='Yes' # [sng] Multi-map flag
@@ -143,14 +170,18 @@ mpi_flg='No' # [sng] Parallelize over nodes
 msh_fl='' # [sng] Mesh-file (for Tempest)
 nco_opt='-O --no_tmp_fl' # [sng] NCO defaults (e.g., '-O -6 -t 1')
 nco_usr='' # [sng] NCO user-configurable options (e.g., '-D 1')
+nd_nbr=1 # [nbr] Number of nodes
 out_fl='' # [sng] Output file
 out_xmp='out.nc' # [sng] Output file for examples
 par_typ='' # [sng] Parallelism type
-rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon' # [sng] Regridding options (e.g., '--rgr col_nm=lndgrid')
-tps_opt='' # [sng] TempestRemap options
+pdq_typ='' # [sng] Permutation type
+#rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon --rnr=0.0' # [sng] Regridding options
+rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon' # [sng] Regridding options
 thr_nbr=2 # [nbr] Thread number for regridder
-#var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
 tmp_out_fl='ncremap_grd_tmp.nc' # [sng] Temporary output file
+#tps_opt='--mono' # [sng] TempestRemap options
+tps_opt='' # [sng] TempestRemap options
+#var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
 var_lst='' # [sng] Variables to process (empty means all)
 var_xmp='FSNT' # [sng] Variable list for examples
 wgt_gnr='esmf' # [sng] Weight-generator program
@@ -158,23 +189,24 @@ xtn_var='' # [sng] Extensive variables (e.g., 'TSurfStd_ct')
 
 function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_nm{} syntax
     # Print usage
-    printf "\nQuick documentation for ${fnt_bld}${spt_nm}${fnt_nrm} (more at http://nco.sf.net/nco.html#ncremap)\n\n"
+    printf "\nComplete documentation for ${fnt_bld}${spt_nm}${fnt_nrm} at http://nco.sf.net/nco.html#ncremap\n\n"
     printf "${fnt_rvr}Basic usage:${fnt_nrm} ${fnt_bld}$spt_nm -i in_fl -d dst_fl -o out_fl${fnt_nrm}\n\n"
     echo "Command-line options:"
     echo "${fnt_rvr}-a${fnt_nrm} ${fnt_bld}alg_typ${fnt_nrm}  Algorithm for ESMF weight generation (default ${fnt_bld}${alg_typ}${fnt_nrm})"
     echo "${fnt_rvr}-d${fnt_nrm} ${fnt_bld}dst_fl${fnt_nrm}   Data file to infer destination grid from (empty means none, i.e., use grd_fl, grd_sng or map_fl)) (default ${fnt_bld}${dst_fl}${fnt_nrm})"
     echo "${fnt_rvr}-D${fnt_nrm} ${fnt_bld}dbg_lvl${fnt_nrm}  Debugging level (default ${fnt_bld}${dbg_lvl}${fnt_nrm})"
     echo "${fnt_rvr}-E${fnt_nrm} ${fnt_bld}esmf_opt${fnt_nrm} ESMF ESMF_RegridWeightGen options (default ${fnt_bld}${esmf_opt}${fnt_nrm})"
-#    echo "${fnt_rvr}-f${fnt_nrm} ${fnt_bld}fml_nm${fnt_nrm}   Family name (empty means none) (default ${fnt_bld}${fml_nm}${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})"
     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})"
     echo "${fnt_rvr}-I${fnt_nrm} ${fnt_bld}drc_in${fnt_nrm}   Input directory (empty means none) (default ${fnt_bld}${drc_in}${fnt_nrm})"
     echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}in_fl${fnt_nrm}    Input file (empty means use stdin or drc_in) (default ${fnt_bld}${in_fl}${fnt_nrm})"
+    echo "${fnt_rvr}-b${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm}  Job simultaneity for parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm})"
     echo "${fnt_rvr}-M${fnt_nrm}          Multi-map-file toggle (unset means generate one map-file per input file)"
     echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm}   Map-file (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm})"
     echo "${fnt_rvr}-n${fnt_nrm} ${fnt_bld}nco_opt${fnt_nrm}  NCO options (empty means none) (default ${fnt_bld}${nco_opt}${fnt_nrm})"
     echo "${fnt_rvr}-O${fnt_nrm} ${fnt_bld}drc_out${fnt_nrm}  Output directory (default ${fnt_bld}${drc_out}${fnt_nrm})"
     echo "${fnt_rvr}-o${fnt_nrm} ${fnt_bld}out_fl${fnt_nrm}   Output-file (regridded file) (empty copies Input filename) (default ${fnt_bld}${out_fl}${fnt_nrm})"
+    echo "${fnt_rvr}-P${fnt_nrm} ${fnt_bld}pdq_typ${fnt_nrm}  Permutation type (empty means none) (default ${fnt_bld}${pdq_typ}${fnt_nrm})"
     echo "${fnt_rvr}-p${fnt_nrm} ${fnt_bld}par_typ${fnt_nrm}  Parallelism type (default ${fnt_bld}${par_typ}${fnt_nrm})"
     echo "${fnt_rvr}-R${fnt_nrm} ${fnt_bld}rgr_opt${fnt_nrm}  Regridding options (empty means none) (default ${fnt_bld}${rgr_opt}${fnt_nrm})"
     echo "${fnt_rvr}-s${fnt_nrm} ${fnt_bld}grd_src${fnt_nrm}  Grid-file (source) (empty means infer or use map_fl) (default ${fnt_bld}${grd_src}${fnt_nrm})"
@@ -204,7 +236,10 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
 } # end fnc_usg_prn()
 
 function dst_is_grd {
-    # Is destination grid specified as SCRIP grid-file?
+    # Purpose: Is destination grid specified as SCRIP grid-file?
+    # fxm: Not working yet
+    # Figure-out whether data-file or grid-file and proceed accordingly
+    # Will allow ncremap to combine -d and -g switches
     # Usage: dst_is_grd ${fl}
     fl=${1}
     flg='Yes'
@@ -213,7 +248,6 @@ function dst_is_grd {
 
 # Check argument number and complain accordingly
 arg_nbr=$#
-#printf "\ndbg: Number of arguments: ${arg_nbr}"
 if [ ${arg_nbr} -eq 0 ]; then
   fnc_usg_prn
 fi # !arg_nbr
@@ -221,23 +255,24 @@ fi # !arg_nbr
 # Parse command-line options:
 # http://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options
 # http://tuxtweaks.com/2014/05/bash-getopts
-cmd_ln="${@}"
-while getopts :a:D:d:E:f:g:G:h:I:i:Mm:n:O:o:p:R:s:T:t:v:w:x: OPT; do
+cmd_ln="${spt_nm} ${@}"
+while getopts :a:D:d:E:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:s:T:t:v:w:x: OPT; do
     case ${OPT} in
 	a) alg_typ=${OPTARG} ;; # Algorithm
 	D) dbg_lvl=${OPTARG} ;; # Debugging level
 	d) dst_fl=${OPTARG} ;; # Destination file
 	E) esmf_opt=${OPTARG} ;; # ESMF options
-#	f) fml_nm=${OPTARG} ;; # Family name
 	g) grd_dst=${OPTARG} ;; # Destination grid-file
 	G) grd_sng=${OPTARG} ;; # Grid generation string
 	I) drc_in=${OPTARG} ;; # Input directory
 	i) in_fl=${OPTARG} ;; # Input file
+	j) job_usr=${OPTARG} ;; # Job simultaneity
 	M) mlt_map_flg='No' ;; # Multi-map flag
 	m) map_fl=${OPTARG} ;; # Map-file
 	n) nco_usr=${OPTARG} ;; # NCO options
-	O) drc_out=${OPTARG} ;; # Output directory
+	O) drc_usr=${OPTARG} ;; # Output directory
 	o) out_fl=${OPTARG} ;; # Output file
+	P) pdq_typ=${OPTARG} ;; # Permutation type
 	p) par_typ=${OPTARG} ;; # Parallelism type
 	R) rgr_opt=${OPTARG} ;; # Regridding options
 	s) grd_src=${OPTARG} ;; # Source grid-file
@@ -254,9 +289,15 @@ done
 shift $((OPTIND-1)) # Advance one argument
 
 # Derived variables
+if [ -n "${drc_usr}" ]; then
+    drc_out="${drc_usr}"
+fi # !drc_usr
 grd_dst_dfl="${drc_out}/ncremap_tmp_grd_dst.nc" # [sng] Grid-file (destination) default
 grd_src_dfl="${drc_out}/ncremap_tmp_grd_src.nc" # [sng] Grid-file (source) default
+pdq_fl="${drc_out}/ncremap_tmp_pdq.nc" # [sng] Permuted data default
 tmp_out_fl="${drc_out}/${tmp_out_fl}" # [sng] Temporary output file
+ncwa_fl="${drc_out}/ncremap_tmp_ncwa.nc" # [sng] ncwa workflow (HIRDLS, MLS) default
+znl_fl="${drc_out}/ncremap_tmp_znl.nc" # [sng] Zonal workflow (HIRDLS, MLS) default
 if [ ${alg_typ} = 'bilinear' ] || [ ${alg_typ} = 'bln' ] ; then 
     # ESMF algorithms are bilinear|patch|neareststod|nearestdtos|conserve
     alg_opt='bilinear'
@@ -274,6 +315,9 @@ if [ -z "${drc_in}" ]; then
 else # !drc_in
     drc_in_usr_flg='Yes'
 fi # !drc_in
+if [ -n "${job_usr}" ]; then 
+    job_nbr="${job_usr}"
+fi # !job_usr
 if [ ${dbg_lvl} -ge 2 ]; then
     nco_opt="-D ${dbg_lvl} ${nco_opt}"
 fi # !dbg_lvl
@@ -292,6 +336,9 @@ fi # !var_lst
 if [ -n "${xtn_var}" ]; then 
     rgr_opt="${rgr_opt} --xtn=${xtn_var}"
 fi # !var_lst
+if [ -n "${out_fl}" ]; then 
+    out_usr_flg='Yes'
+fi # !out_fl
 if [ -n "${par_typ}" ]; then
     if [ "${par_typ}" != 'bck' ] && [ "${par_typ}" != 'mpi' ] && [ "${par_typ}" != 'nil' ]; then 
 	    echo "ERROR: Invalid -p par_typ option = ${par_typ}"
@@ -305,9 +352,25 @@ elif [ "${par_typ}" = 'mpi' ]; then
     mpi_flg='Yes'
     par_opt=' &'
 fi # !par_typ
-if [ -n "${out_fl}" ]; then 
-    out_usr_flg='Yes'
-fi # !out_fl
+if [ -n "${pdq_typ}" ]; then
+    if [ "${pdq_typ}" != 'airs' ] && [ "${pdq_typ}" != 'hirdls' ] && [ "${pdq_typ}" != 'mls' ] && [ "${pdq_typ}" != 'mpas' ] && [ "${pdq_typ}" != 'nil' ]; then 
+	    echo "ERROR: Invalid -P pdq_typ option = ${pdq_typ}"
+	    echo "HINT: Valid pdq_typ arguments are 'airs', 'hirdls', 'mls', 'mpas', and 'nil'"
+	    exit 1
+    fi # !pdq_typ
+fi # !pdq_typ
+if [ "${pdq_typ}" = 'airs' ]; then 
+    pdq_opt='-a StdPressureLev,GeoTrack,GeoXTrack'
+fi # !airs
+if [ "${pdq_typ}" = 'hirdls' ]; then 
+    pdq_opt='-a Pressure,Latitude,lon'
+fi # !hirdls
+if [ "${pdq_typ}" = 'mls' ]; then 
+    pdq_opt='-a CO_Pressure,CO_Latitude,lon'
+fi # !mls
+if [ "${pdq_typ}" = 'mpas' ]; then 
+    pdq_opt='-a Time,nVertLevels,maxEdges,MaxEdges2,nEdges,nCells'
+fi # !mpas
 if [ -n "${thr_usr}" ]; then 
     thr_nbr="${thr_usr}"
 fi # !thr_usr
@@ -320,35 +383,6 @@ if [ "${wgt_gnr}" != 'esmf' ] && [ "${wgt_gnr}" != 'tempest' ] ; then
 	    exit 1
 fi # !wgt_gnr
 
-if [ -n "${in_fl}" ]; then
-    # Single file argument
-    fl_in[${fl_nbr}]=${in_fl}
-    let fl_nbr=${fl_nbr}+1
-else # !in_fl
-    # Detecting input on stdin:
-    # http://stackoverflow.com/questions/2456750/detect-presence-of-stdin-contents-in-shell-script
-    # ls ${DATA}/ne30/raw/famipc5*1979*.nc | ncremap -D 1 -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
-    if [ -t 0 ]; then 
-	if [ "${drc_in_usr_flg}" = 'Yes' ]; then
-	    for fl in "${drc_in}"/*.nc "${drc_in}"/*.nc3 "${drc_in}"/*.nc4 "${drc_in}"/*.cdf "${drc_in}"/*.hdf "${drc_in}"/*.he5 "${drc_in}"/*.h5 ; do
-		if [ -f "${fl}" ]; then
-		    fl_in[${fl_nbr}]=${fl}
-		    let fl_nbr=${fl_nbr}+1
-		fi # !file
-	    done
-	else # !drc_in
-	    echo "ERROR: Must specify input file with -i or with stdin"
-	    echo "HINT: Pipe file list to script via stdin with, e.g., 'ls *.nc | ${spt_nm}'"
-	    exit 1
-	fi # !drc_in
-    else
-	# Input awaits on unit 0, i.e., on stdin
-	while read -r line; do # NeR05 p. 179
-	    fl_in[${fl_nbr}]=${line}
-	    let fl_nbr=${fl_nbr}+1
-	done < /dev/stdin
-    fi # stdin
-fi # !in_fl
 if [ -n "${dst_fl}" ]; then 
     if [ ! -e "${dst_fl}" ]; then
 	echo "ERROR: Unable to find specified destination-file ${dst_fl}"
@@ -382,24 +416,129 @@ if [ -z "${grd_sng}" ]; then
 else
     grd_sng_usr_flg='Yes'
 fi # !grd_sng
+if [ "${dst_usr_flg}" = 'Yes' ] || [ "${grd_sng_usr_flg}" = 'Yes' ] || [ "${grd_dst_usr_flg}" = 'Yes' ] || [ "${grd_src_usr_flg}" = 'Yes' ]; then
+    # Specified map-file will be created if -d, -G, -g, or -s was specified
+    map_mk='Yes'
+fi # !map_mk
 if [ -n "${map_fl}" ]; then 
-    if [ ! -e "${map_fl}" ]; then
-	echo "ERROR: Unable to find specified regrid map ${map_fl}"
-	echo "HINT: Supply the full path-name for the regridding map"
-	exit 1
-    fi # ! -e
     map_usr_flg='Yes'
-else
+    if [ "${map_mk}" = 'Yes' ]; then
+        if [ -e "${map_fl}" ]; then
+	    rsp_kbd_nbr=0
+	    while [ ${rsp_kbd_nbr} -lt 10 ] ; do
+		echo "WARNING: The file ${map_fl} already exists and will be over-written by the newly generated map-file."
+		read -p "Continue (y/n)? " rsp_kbd
+		let rsp_kbd_nbr+=1
+		case "${rsp_kbd}" in
+		    N*|n*) exit 1 ;;
+		    Y*|y*) break ;;
+		    *) continue ;;
+		esac
+	    done # !rsp_kbd_nbr
+	    if [ ${rsp_kbd_nbr} -ge 10 ]; then
+		echo "ERROR: Too many invalid responses, exiting"
+		exit 1
+	    fi # !rsp_kbd_nbr
+	fi # ! -e
+    else # !map_mk
+        if [ ! -e "${map_fl}" ]; then
+	    echo "ERROR: Unable to find specified regrid map ${map_fl}"
+	    echo "HINT: Supply a valid map-file (weight-file) name or supply the grid files or data files and let ncremap create a mapfile for you"
+	    exit 1
+	fi # ! -e
+    fi # !map_mk
+else # !map_fl
     if [ "${wgt_gnr}" = 'esmf' ]; then 
 	map_fl_dfl="${drc_out}/ncremap_tmp_map_${wgt_gnr}_${alg_opt}.nc" # [sng] Map-file default
     fi # !esmf
     if [ "${wgt_gnr}" = 'tempest' ]; then 
 	map_fl_dfl="${drc_out}/ncremap_tmp_map_${wgt_gnr}.nc" # [sng] Map-file default
-	msh_fl_dfl="${drc_out}/ncremap_tmp_msh_ovr_${wgt_gnr}.g" # [sng] Mesh-file default
-	msh_fl=${msh_fl_dfl}
     fi # !tempest
     map_fl=${map_fl_dfl}
 fi # !map_fl
+if [ "${map_mk}" = 'Yes' ] && [ "${wgt_gnr}" = 'tempest' ]; then 
+    msh_fl_dfl="${drc_out}/ncremap_tmp_msh_ovr_${wgt_gnr}.g" # [sng] Mesh-file default
+    msh_fl=${msh_fl_dfl}
+fi # !tempest
+
+# Parse grid/map arguments before in_fl arguments so we know whether this could be a map-only invocation
+if [ -n "${in_fl}" ]; then
+    # Single file argument
+    fl_in[${fl_nbr}]=${in_fl}
+    let fl_nbr=${fl_nbr}+1
+else # !in_fl
+    # Detecting input on stdin:
+    # http://stackoverflow.com/questions/2456750/detect-presence-of-stdin-contents-in-shell-script
+    # ls ${DATA}/ne30/raw/famipc5*1979*.nc | ncremap -D 1 -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
+    if [ -t 0 ]; then 
+	if [ "${drc_in_usr_flg}" = 'Yes' ]; then
+	    for fl in "${drc_in}"/*.nc "${drc_in}"/*.nc3 "${drc_in}"/*.nc4 "${drc_in}"/*.cdf "${drc_in}"/*.hdf "${drc_in}"/*.he5 "${drc_in}"/*.h5 ; do
+		if [ -f "${fl}" ]; then
+		    fl_in[${fl_nbr}]=${fl}
+		    let fl_nbr=${fl_nbr}+1
+		fi # !file
+	    done
+	else # !drc_in
+	    if [ "${map_mk}" != 'Yes' ]; then 
+		echo "ERROR: Must specify input file with -i or with stdin"
+		echo "HINT: Pipe file list to script via stdin with, e.g., 'ls *.nc | ${spt_nm}'"
+		exit 1
+	    fi # !map_mk
+	fi # !drc_in
+    else
+	# Input awaits on unit 0, i.e., on stdin
+	while read -r line; do # NeR05 p. 179
+	    fl_in[${fl_nbr}]=${line}
+	    let fl_nbr=${fl_nbr}+1
+	done < /dev/stdin
+    fi # stdin
+fi # !in_fl
+
+if [ "${mpi_flg}" = 'Yes' ]; then
+    if [ -n "${COBALT_NODEFILE}" ]; then 
+	nd_fl="${COBALT_NODEFILE}"
+    elif [ -n "${PBS_NODEFILE}" ]; then 
+	nd_fl="${PBS_NODEFILE}"
+    elif [ -n "${SLURM_NODELIST}" ]; then 
+	nd_fl="${SLURM_NODELIST}"
+    fi # !PBS
+    if [ -n "${nd_fl}" ]; then 
+	# NB: nodes are 0-based, e.g., [0..11]
+	nd_idx=0
+	for nd in `cat ${nd_fl} | uniq` ; do
+	    nd_nm[${nd_idx}]=${nd}
+	    let nd_idx=${nd_idx}+1
+	done # !nd
+	nd_nbr=${#nd_nm[@]}
+	for ((fl_idx=0;fl_idx<fl_nbr;fl_idx++)); do
+	    case "${HOSTNAME}" in 
+		cori* | edison* | nid* )
+		    # NB: NERSC staff says srun automatically assigns to unique nodes even without "-L $node" argument?
+		    cmd_mpi[${fl_idx}]="srun -L ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -n 1" ; ;; # NERSC
+		hopper* )
+		    # NB: NERSC migrated from aprun to srun in 201601. Hopper commands will soon be deprecated.
+		    cmd_mpi[${fl_idx}]="aprun -L ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -n 1" ; ;; # NERSC
+		* )
+		    cmd_mpi[${fl_idx}]="mpirun -H ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -npernode 1 -n 1" ; ;; # Other
+	    esac # !HOSTNAME
+	done # !fl_idx
+    else # ! pbs
+	mpi_flg='No'
+	for ((fl_idx=0;fl_idx<fl_nbr;fl_idx++)); do
+	    cmd_mpi[${fl_idx}]=""
+	done # !fl_idx
+    fi # !pbs
+    if [ -z "${job_usr}" ]; then 
+	job_nbr=${nd_nbr}
+    fi # !job_usr
+    if [ -z "${thr_usr}" ]; then 
+	if [ -n "${PBS_NUM_PPN}" ]; then
+#	NB: use export OMP_NUM_THREADS when thr_nbr > 8
+#	thr_nbr=${PBS_NUM_PPN}
+	    thr_nbr=$((PBS_NUM_PPN > 8 ? 8 : PBS_NUM_PPN))
+	fi # !pbs
+    fi # !thr_usr
+fi # !mpi
 
 # Print initial state
 if [ ${dbg_lvl} -ge 2 ]; then
@@ -408,14 +547,15 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: drc_in   = ${drc_in}\n"
     printf "dbg: drc_out  = ${drc_out}\n"
     printf "dbg: dst_fl   = ${dst_fl}\n"
-#    printf "dbg: fml_nm   = ${fml_nm}\n"
     printf "dbg: gaa_sng  = ${gaa_sng}\n"
     printf "dbg: grd_dst  = ${grd_dst}\n"
     printf "dbg: grd_sng  = ${grd_sng}\n"
     printf "dbg: grd_src  = ${grd_src}\n"
     printf "dbg: hdr_pad  = ${hdr_pad}\n"
+    printf "dbg: job_nbr  = ${job_nbr}\n"
     printf "dbg: in_fl    = ${in_fl}\n"
     printf "dbg: map_fl   = ${map_fl}\n"
+    printf "dbg: map_mk   = ${map_mk}\n"
     printf "dbg: mlt_map  = ${mlt_map_flg}\n"
     printf "dbg: mpi_flg  = ${mpi_flg}\n"
     printf "dbg: nco_opt  = ${nco_opt}\n"
@@ -443,7 +583,7 @@ mkdir -p ${drc_out}
 # Human-readable summary
 if [ ${dbg_lvl} -ge 1 ]; then
     printf "NCO regridder invoked with command:\n"
-    echo "${spt_nm} ${cmd_ln}"
+    echo "${cmd_ln}"
 fi # !dbg
 date_srt=$(date +"%s")
 
@@ -453,58 +593,45 @@ if [ -f 'PET0.RegridWeightGen.Log' ]; then
 fi # !PETO
 printf "Started processing at `date`.\n"
 printf "NCO version is ${nco_version}\n"
-if [ "${map_usr_flg}" = 'Yes' ] && [ -n "${wgt_usr}" ] ; then
-    printf "${spt_nm}: ERROR Specifying both '-m map_fl' and '-w wgt_gnr' is not allowed (the weight-generator is unnecessary)\n"
+if [ "${map_mk}" != 'Yes' ] && [ "${map_usr_flg}" = 'Yes' ] && [ -n "${wgt_usr}" ] ; then
+    printf "${spt_nm}: ERROR Specifying both '-m map_fl' and '-w wgt_gnr' is only allowed when creating a map (weight generator is superfluous when map is supplied)\n"
     exit 1
 fi # wgt_usr
-if [ "${grd_src_usr_flg}" = 'Yes' ]; then
-    if [ "${map_usr_flg}" = 'Yes' ]; then 
-	printf "${spt_nm}: ERROR Specifying both '-s grd_src' and '-m map_fl' is ambiguous and forbidden\n"
-	exit 1
-    fi # !map_usr_flg
-fi # !grd_src_usr_flg
     
 if [ "${dst_usr_flg}" = 'Yes' ]; then 
-    if [ "${map_usr_flg}" = 'Yes' ]; then 
-	printf "${spt_nm}: ERROR Specify either '-d dst_fl' or '-m map_fl' not both\n"
-	exit 1
-    fi # !map_usr_flg
     if [ "${grd_dst_usr_flg}" = 'Yes' ]; then 
 	printf "${spt_nm}: ERROR Specify either '-d dst_fl' or '-g grd_dst' not both\n"
 	exit 1
     fi # !grd_dst_usr_flg
-else # !dst_usr_flg
-    if [ "${grd_dst_usr_flg}" = 'Yes' ]; then 
-	if [ "${map_usr_flg}" = 'Yes' ]; then 
-	    printf "${spt_nm}: ERROR Specify either '-g grd_dst' or '-m map_fl' not both\n"
-	    exit 1
-	fi # !map_usr_flg
-    else
-	if [ "${map_usr_flg}" != 'Yes' ] && [ "${grd_sng_usr_flg}" != 'Yes' ] ; then 
-	    printf "${spt_nm}: ERROR Must use one of '-d dst_fl', '-g grd_dst', '-G grd_sng', or '-m map_fl'\n"
-	    exit 1
-	fi # !map_usr_flg
-    fi # !grd_dst_usr_flg
+fi # !dst_usr_flg
+if [ "${dst_usr_flg}" != 'Yes' ] && [ "${grd_dst_usr_flg}" != 'Yes' ] && [ "${map_usr_flg}" != 'Yes' ] && [ "${grd_sng_usr_flg}" != 'Yes' ] ; then 
+    printf "${spt_nm}: ERROR Must use one of '-d dst_fl', '-g grd_dst', '-G grd_sng', or '-m map_fl'\n"
+    exit 1
 fi # !dst_usr_flg
 
 # Generate destination grid, if necessary, once (only) before loop over input files
 # Block 1: Destination grid
-# Unlike source grid, same destination grid is used for all files
-# Generate destination grid at most one-time
+# Generate destination grid at most one-time (unlike source grid)
 # Eventually we will allow destination grid to be provided as grid-file, map-file, or data-file
 # Currently we require user to know (and specify) means by which destination grid is provided
-if [ "${map_usr_flg}" = 'Yes' ]; then 
-    printf "Source and destination grids will both be read from supplied map-file ${map_fl}\n"
+if [ ${fl_nbr} -eq 0 ]; then
+    printf "Map-only run: no input data detected therefore will exit after generating map\n"
+fi # !fl_nbr
+if [ -n "${pdq_opt}" ]; then 
+    printf "Input data obey \"${pdq_typ}\"-ordering and will be permuted with \"ncpdq ${pdq_opt}\"\n"
+fi # !pdq_opt
+if [ "${map_mk}" != 'Yes' ] && [ "${map_usr_flg}" = 'Yes' ]; then 
+    printf "Source and destination grids will both be read from supplied map-file\n"
 else # !map_usr_flg
     fl_idx=0 # [idx] Current file index
     if [ "${dst_usr_flg}" = 'Yes' ]; then 
 	# Block 1 Loop 1: Generate, check, and store (but do not yet execute) commands
 	# Infer destination grid-file from data file
-	printf "Destination grid will be inferred from data-file ${dst_fl} and stored as ${grd_dst}\n"
+	printf "Destination grid will be inferred from data-file\n"
 	cmd_dst[${fl_idx}]="ncks ${nco_opt} --rgr nfr=y --rgr grid=${grd_dst} ${dst_fl} ${tmp_out_fl}"
     else # !dst_usr_flg
 	if [ "${grd_dst_usr_flg}" = 'Yes' ]; then 
-	    printf "Destination grid supplied by user as ${grd_dst}\n"
+	    printf "Destination grid supplied by user\n"
 	else
 	    if [ "${grd_sng_usr_flg}" = 'Yes' ]; then 
 		printf "Destination grid will be generated from NCO grid string ${grd_sng}\n"
@@ -533,17 +660,17 @@ else # !map_usr_flg
     fi # !dst_usr_flg || grd_dst_usr_flg
     printf "Weight-generation type: ${wgt_gnr}\n"
     if [ "${wgt_gnr}" = 'esmf' ]; then 
-	printf "ESMF's ESMF_RegridWeightGen will generate map-file internally and store it as ${map_fl}\n"
+	printf "ESMF's ESMF_RegridWeightGen will generate map-file\n"
 	printf "Algorithm used to generate weights in map-file is: ${alg_opt}\n"
     fi # !esmf
     if [ "${wgt_gnr}" = 'tempest' ]; then 
-	printf "TempestRemap's GenerateOverlapMesh and GenerateOfflineMap will generate map-file internally and store it as ${map_fl}\n"
+	printf "TempestRemap's GenerateOverlapMesh and GenerateOfflineMap will generate map-file\n"
     fi # !tempest
     if [ ${fl_nbr} -ge 2 ]; then 
 	if [ "${mlt_map_flg}" = 'Yes' ]; then 
-	    printf "Input files assumed to use unique input grids, one map-file will be generated per input file\n"
+	    printf "Input files assumed to use unique input grids\nOne source grid-file will be inferred and one map-file generated per input file\n"
 	else # !mlt_map_flg
-	    printf "Input files assumed to use same input grid, only one map-file will be generated\n"
+	    printf "Input files assumed to use same input grid\nOnly one source grid-file and one map-file will be generated\n"
 	fi # !mlt_map_flg
     fi # !fl_nbr
 fi # !map_usr
@@ -560,14 +687,12 @@ if [ "${grd_src_usr_flg}" = 'Yes' ]; then
     if [ "${wgt_gnr}" = 'tempest' ]; then 
 	cmd_msh[${fl_idx}]="GenerateOverlapMesh --a ${grd_src} --b ${grd_dst} --out ${msh_fl} > /dev/null"
 	cmd_map[${fl_idx}]="GenerateOfflineMap --in_mesh ${grd_src} --out_mesh ${grd_dst} --ov_mesh ${msh_fl} --out_map ${map_fl} ${tps_opt} > /dev/null"
-	# 20160101: TempestRemap programs have false positive error returns (failures reported as successes) so remove old map/mesh before generating new
-	/bin/rm -f ${msh_fl} ${map_fl}
 	if [ ${dbg_lvl} -ge 1 ]; then
 	    echo ${cmd_msh[${fl_idx}]}
 	fi # !dbg
 	if [ ${dbg_lvl} -ne 2 ]; then
 	    eval ${cmd_msh[${fl_idx}]}
-	    if [ $? -ne 0 ] || [ ! -f ${msh_fl} ] ; then
+	    if [ $? -ne 0 ] || [ ! -f ${msh_fl} ]; then
 		printf "${spt_nm}: ERROR Failed to generate mesh-file. Debug this:\n${cmd_msh[${fl_idx}]}\n"
 		exit 1
 	    fi # !err
@@ -578,32 +703,48 @@ if [ "${grd_src_usr_flg}" = 'Yes' ]; then
     fi # !dbg
     if [ ${dbg_lvl} -ne 2 ]; then
 	eval ${cmd_map[${fl_idx}]}
-	if [ $? -ne 0 ] || [ ! -f ${map_fl} ] ; then
+	if [ $? -ne 0 ] || [ ! -f ${map_fl} ]; then
 	    printf "${spt_nm}: ERROR Failed to generate map-file. Debug this:\n${cmd_map[${fl_idx}]}\n"
 	    if [ "${wgt_gnr}" = 'esmf' ]; then 
 		printf "${spt_nm}: HINT When ESMF fails to generate map-files, it often puts additional debugging information in the file named PET0.RegridWeightGen.Log in the invocation directory (${drc_pwd})\n"
 	    fi # !esmf
 	    exit 1
 	fi # !err
+	if [ "${map_usr_flg}" = 'Yes' ] ; then
+	    hst_att="`date`: ${cmd_ln};${cmd_map[${fl_idx}]}"
+	    cmd_att[${fl_idx}]="ncatted -O ${gaa_sng} --gaa history='${hst_att}' ${map_fl}"
+	    eval ${cmd_att[${fl_idx}]}
+	    if [ $? -ne 0 ]; then
+		printf "${spt_nm}: ERROR Failed to annotate map-file. Debug this:\n${cmd_att[${fl_idx}]}\n"
+		exit 1
+	    fi # !err
+	fi # !map_usr_flg
     fi # !dbg
-    # Set map_usr_flg to 'Yes' here to avoid re-generating map within file loop
-    map_usr_flg='Yes'
+    # Set map_mk to something besides 'Yes' to avoid re-generating map within file loop
+    map_mk='Already made map once. Never again.'
 fi # !grd_src_usr_flg
 
 # Begin loop over input files
+idx_srt=0
+let idx_end=$((job_nbr-1))
 for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
     in_fl=${fl_in[${fl_idx}]}
     if [ "$(basename ${in_fl})" = "${in_fl}" ]; then
 	in_fl="${drc_pwd}/${in_fl}"
     fi # !basename
+    idx_prn=`printf "%02d" ${fl_idx}`
+    printf "Input #${idx_prn}: ${in_fl}\n"
     if [ "${out_usr_flg}" = 'Yes' ]; then 
 	if [ ${fl_nbr} -ge 2 ]; then 
 	    echo "ERROR: Single output filename specified with -o for multiple input files"
 	    echo "HINT: For multiple input files use -O option to specify output directory and do not use -o option. Output files will have same name as input files, but will be in different directory."
 	    exit 1
 	fi # !fl_nbr
+	if [ -n "${drc_usr}" ]; then
+	    out_fl="${drc_out}/${out_fl}"
+	fi # !drc_usr
     else # !out_usr_flg
-	out_fl="${drc_out}/$(basename ${in_fl})" # [sng] Output-file default
+	out_fl="${drc_out}/$(basename ${in_fl})"
     fi # !out_fl
     if [ "${in_fl}" = "${out_fl}" ]; then
 	echo "ERROR: Input file = Output file = ${in_fl}"
@@ -611,8 +752,27 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 	exit 1
     fi # !basename
 
-    # Generate new map unless map-file was supplied or already-generated (as indicated by map_usr_flg)
-    if [ "${map_usr_flg}" != 'Yes' ]; then
+    # Generate new map unless map-file was supplied or already-generated
+    if [ "${map_mk}" = 'Yes' ]; then
+
+	# Block 1: Special cases
+	if [ "${pdq_typ}" = 'hirdls' ] || [ "${pdq_typ}" = 'mls' ]; then
+	    # Pre-process zonal input files so grid inferral works
+	    # 20160214: fix record variable to work around ncpdq problem
+	    cmd_znl[${fl_idx}]="ncecat -u lon ${nco_opt} ${nco_var_lst} ${in_fl} ${in_fl} ${in_fl} ${in_fl} ${znl_fl/znl/znl1};ncap2 ${nco_opt} -s 'lon[\$lon]={0.0,90.0,180.0,270.0}' ${znl_fl/znl/znl1} ${znl_fl/znl/znl2};ncks --fix_rec_dmn lon ${nco_opt} ${nco_var_lst} ${znl_fl/znl/znl2} ${znl_fl/znl/znl3};"
+	    in_fl="${znl_fl/znl/znl3}"
+	    if [ ${dbg_lvl} -ge 1 ]; then
+		echo ${cmd_znl[${fl_idx}]}
+	    fi # !dbg
+	    if [ ${dbg_lvl} -ne 2 ]; then
+		eval ${cmd_znl[${fl_idx}]}
+		if [ $? -ne 0 ] || [ ! -f "${znl_fl/znl/znl3}" ] ; then
+		    printf "${spt_nm}: ERROR Failed to generate lat-lon file from zonal file. Debug this:\n${cmd_znl[${fl_idx}]}\n"
+		    exit 1
+		fi # !err
+	    fi # !dbg
+	fi # !znl
+	
 	# Block 2: Source grid
 	# Block 2 Loop 1: Source gridfile command
 	if [ ! -e "${in_fl}" ]; then
@@ -639,16 +799,13 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 	# Block 3 Loop 1: Map-file commands
 	printf "Grid(src): ${grd_src}\n"
 	printf "Grid(dst): ${grd_dst}\n"
-	printf "Map-File : ${map_fl}\n"
 	if [ "${wgt_gnr}" = 'esmf' ]; then 
 	    cmd_map[${fl_idx}]="ESMF_RegridWeightGen -s ${grd_src} -d ${grd_dst} -w ${map_fl} --method ${alg_opt} ${esmf_opt} > /dev/null"
 	fi # !esmf
 	if [ "${wgt_gnr}" = 'tempest' ]; then 
 	    printf "Mesh-File: ${msh_fl}\n"
-	    cmd_msh[${fl_idx}]="GenerateOverlapMesh --a ${grd_src} --b ${grd_dst} --out ${msh_fl} ${tps_opt} > /dev/null"
+	    cmd_msh[${fl_idx}]="GenerateOverlapMesh --a ${grd_src} --b ${grd_dst} --out ${msh_fl} > /dev/null"
 	    cmd_map[${fl_idx}]="GenerateOfflineMap --in_mesh ${grd_src} --out_mesh ${grd_dst} --ov_mesh ${msh_fl} --out_map ${map_fl} ${tps_opt} > /dev/null"
-	    # 20160101: TempestRemap programs have false negative error returns (failures reported as successes) so remove old map/mesh before generating new
-	    /bin/rm -f ${msh_fl} ${map_fl}
 	    if [ ${dbg_lvl} -ge 1 ]; then
 		echo ${cmd_msh[${fl_idx}]}
 	    fi # !dbg
@@ -674,26 +831,55 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 		fi # !esmf
 		exit 1
 	    fi # !err
+	    if [ "${map_usr_flg}" = 'Yes' ] ; then
+		hst_att="`date`: ${cmd_ln};${cmd_map[${fl_idx}]}"
+		cmd_att[${fl_idx}]="ncatted -O ${gaa_sng} --gaa history='${hst_att}' ${map_fl}"
+		eval ${cmd_att[${fl_idx}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR Failed to annotate map-file. Debug this:\n${cmd_att[${fl_idx}]}\n"
+		    exit 1
+		fi # !err
+	    fi # !map_usr_flg
 	fi # !dbg
 
 	# Prevent creating new source gridfile and map-file after first iteration
 	if [ "${mlt_map_flg}" = 'No' ] && [ ${fl_idx} -eq 0 ] ; then 
-	    map_usr_flg='Yes'
+	    map_mk='Already made map once. Never again.'
 	fi # !mlt_map_flg
 
-    fi # !map_usr_flg
+    fi # !map_mk
     
-    # Block 4: Regrid
-    printf "Input : ${in_fl}\n"
-    printf "Output: ${out_fl}\n"
-    cmd_rgr[${fl_idx}]="ncks -t ${thr_nbr} ${nco_opt} ${nco_var_lst} ${rgr_opt} --map=${map_fl} ${in_fl} ${out_fl}"
+    # Block 4: Generic Permutation (AIRS, HIRDLS, MLS, MPAS)
+    if [ -n "${pdq_opt}" ]; then
+	printf "PDQ(in)  : ${in_fl}\n"
+	printf "PDQ(out) : ${pdq_fl}\n"
+	cmd_pdq[${fl_idx}]="ncpdq ${nco_opt} ${nco_var_lst} ${pdq_opt} ${in_fl} ${pdq_fl}"
+	# Cause next block (regridding) to operate on PDQ file
+	in_fl=${pdq_fl}
+	
+	# Block 4 Loop 2: Execute and/or echo commands
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_pdq[${fl_idx}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -ne 2 ]; then
+	    eval ${cmd_pdq[${fl_idx}]}
+	    if [ $? -ne 0 ] || [ ! -f ${pdq_fl} ] ; then
+		printf "${spt_nm}: ERROR Failed to generate pdq-file. Debug this:\n${cmd_pdq[${fl_idx}]}\n"
+		exit 1
+	    fi # !err
+	fi # !dbg
+    fi # !pdq_opt
+
+    # Block 5: Regrid
+    printf "Map/Wgt  : ${map_fl}\n"
+    printf "Regridded: ${out_fl}\n"
+    cmd_rgr[${fl_idx}]="${cmd_mpi[${fl_idx}]} ncks -t ${thr_nbr} ${nco_opt} ${nco_var_lst} ${rgr_opt} --map=${map_fl} ${in_fl} ${out_fl}"
     
-    # Block 4 Loop 2: Execute and/or echo commands
+    # Block 5 Loop 2: Execute and/or echo commands
     if [ ${dbg_lvl} -ge 1 ]; then
 	echo ${cmd_rgr[${fl_idx}]}
     fi # !dbg
     if [ ${dbg_lvl} -ne 2 ]; then
-	eval ${cmd_rgr[${fl_idx}]}
 	if [ -z "${par_opt}" ]; then
 	    eval ${cmd_rgr[${fl_idx}]}
 	    if [ $? -ne 0 ]; then
@@ -705,25 +891,74 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 	    rgr_pid[${fl_idx}]=$!
 	fi # !par_typ
     fi # !dbg
+
+    # Block 6: Wait
+    # Parallel regridding (both Background and MPI) spawn simultaneous processes in batches of ${job_nbr}
+    # Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
+    if [ -n "${par_opt}" ]; then
+	let bch_idx=$((fl_idx / job_nbr))
+	let bch_flg=$(((fl_idx+1) % job_nbr))
+	#printf "${spt_nm}: fl_idx = ${fl_idx}, bch_idx = ${bch_idx}, bch_flg = ${bch_flg}\n"
+	if [ ${bch_flg} -eq 0 ] ; then
+	    if [ ${dbg_lvl} -ge 1 ]; then
+		printf "${spt_nm}: Waiting for batch ${bch_idx} to finish at fl_idx = ${fl_idx}...\n"
+	    fi # !dbg
+	    for ((pid_idx=${idx_srt};pid_idx<=${idx_end};pid_idx++)); do
+		wait ${rgr_pid[${pid_idx}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+		    exit 1
+		fi # !err
+	    done # !pid_idx
+	    let idx_srt=$((idx_srt + job_nbr))
+	    let idx_end=$((idx_end + job_nbr))
+	fi # !bch_flg
+    fi # !par_typ
+    
+    # Block 7: Special case post-processing
+    if [ "${pdq_typ}" = 'hirdls' ] || [ "${pdq_typ}" = 'mls' ]; then
+	# NB: Move file to avert problem with --no_tmp_fl causing self-overwrite
+	cmd_znl[${fl_idx}]="/bin/mv ${out_fl} ${ncwa_fl};ncwa -a lon ${nco_opt} ${nco_var_lst} ${ncwa_fl} ${out_fl}"
+	# Block 7 Loop 2: Execute and/or echo commands
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_znl[${fl_idx}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -ne 2 ]; then
+	    eval ${cmd_znl[${fl_idx}]}
+	    if [ $? -ne 0 ] || [ ! -f "${out_fl}" ] ; then
+		printf "${spt_nm}: ERROR Failed to generate zonal file from lat-lon file. Debug this:\n${cmd_znl[${fl_idx}]}\n"
+		exit 1
+	    fi # !err
+	fi # !dbg
+    fi # !znl
+
 done # !fl_idx
 
-# wait() for parallel regridding, if any, to finish
+# Parallel mode will often exit loop after a partial batch, wait() for remaining jobs to finish
 if [ -n "${par_opt}" ]; then
-    for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
-	wait ${rgr_pid[${fl_idx}]}
-	if [ $? -ne 0 ]; then
-	    printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${fl_idx}] failed. Debug this:\n${cmd_rgr[${fl_idx}]}\n"
-	    exit 1
-	fi # !err
-    done # !fl_idx
+    let bch_flg=$((fl_nbr % job_nbr))
+    if [ ${bch_flg} -ne 0 ] ; then
+	let bch_idx=$((bch_idx+1))
+	printf "${spt_nm}: Waiting for (partial) batch ${bch_idx} to finish...\n"
+	for ((pid_idx=${idx_srt};pid_idx<${fl_nbr};pid_idx++)); do
+	    wait ${rgr_pid[${pid_idx}]}
+	    if [ $? -ne 0 ]; then
+		printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+		exit 1
+	    fi # !err
+	done # !pid_idx
+    fi # !bch_flg
 fi # !par_typ
 
 date_end=$(date +"%s")
-printf "Completed processing of ${fl_nbr} file(s) at `date`.\n"
+if [ ${fl_nbr} -eq 0 ]; then
+    printf "Completed generating map-file(s) at `date`.\n"
+else # !fl_nbr
+    echo "Quick plots of results from last regridded file:"
+    echo "ncview  ${out_fl} &"
+    echo "panoply ${out_fl} &"
+fi # !fl_nbr
 date_dff=$((date_end-date_srt))
-echo "Quick plots of results from last regridded file:"
-echo "ncview  ${out_fl} &"
-echo "panoply ${out_fl} &"
 echo "Elapsed time $((date_dff/60))m$((date_dff % 60))s"
 
 exit 0
diff --git a/debian/changelog b/debian/changelog
index e66cf82..767810c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nco (4.5.5-1) unstable; urgency=low
+
+  * new upstream version crv brnch-cut
+
+ -- Charlie Zender <zender at uci.edu>  Thu, 07 Feb 2016 12:25:13 -0700
+
 nco (4.5.4-1) unstable; urgency=low
 
   * new upstream version ncremap fix ncpdq nfr cap, XML _Unsigned, crv dateline, GSL2
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index e51bfb6..da4c24f 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,117 +1,109 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.5.4 are ready. 
+The netCDF Operators NCO version 4.5.5 are ready. 
 
 http://nco.sf.net (Homepage, Mailing lists)
 http://github.com/nco (Source Code, Releases, Developers)
 
-We are pleased to introduce ncremap, a new operator for regridding. 
-ncremap is a shell script that wraps ncks to produce a friendly
-interface to regridding features. Without any external dependencies,
-ncremap applies weights from a pre-exisiting mapfile to a source
-data file to produce a regridded dataset. Source and destination
-datasets may be on any Curvilinear, Rectangular, or Unstructured
-Data (CRUD) grid. When necessary ncremap calls ESMF_RegridWeightGen
-or TempestRemap to generate weights and uses those to regrid. ncremap
-hides the complexity of regridding from the user, who can know
-next-to-nothing about regridding.
-
-Work on NCO 4.5.5 has commenced and will better support eliciting
+What's new?
+NCO fully supports CDF5-format datasets, ncremap continues to
+accrue useful features, and some corner case bugs were fixed.
+
+Work on NCO 4.5.6 has commenced and will better support eliciting
 latitude/longitude coordinates using the CF "coordinates" convention
 and regridding variables whose horizontal dimensions are not the
-most-rapidly-varying, and ncremap support for calling TempestRemap.  
+most-rapidly-varying.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-A. ncremap: A new netCDF operator for regridding.
-   ncremap is a shell script that wraps ncks to produce a friendly
-   interface to regridding features. Without any external dependencies,
-   ncremap applies weights from a pre-exisiting mapfile to input data
-   file(s) to produce a regrided dataset(s). Source and destination 
-   datasets may be on any Curvilinear, Rectangular, or Unstructured
-   Data (CRUD) grid. ncremap will also, when necessary, use external
-   programs (ESMF's ESMF_RegridWeightGen (ERWG), or TempestRemap's
-   GenerateOverlapMesh/GenerateOfflineMap) to generate weights and
-   mapfiles and use those to regrid. ERWG is distributed in binary
-   format with NCL, which many (most?) users already have on their
-   system. Or ERWG and TempestRemap may be installed from source. 
-   Please try ncremap and send us your feedback and suggestions.
-   Examples:
-   ncremap -i src.nc -d dst.nc -o out.nc
-   ls gcm14*cam*0007*.nc | ncremap -a conserve -M -d dst_1x1.nc -O ~/rgr
-   http://dust.ess.uci.edu/smn/pst_nco_agu_201512.pdf # AGU Poster
+A. NCO supports the CDF5 file type first introduced by pnetCDF and now  
+   supported in Unidata netCDF as of version 4.4.0.
+   CDF5 uses 64-bit offsets for a large address space (like the netCDF
+   64BIT type) AND arrays may have more than 2^32 elements.
+   Use '-5', '--5', '--fl_fmt=[cdf5|64bit_data|pnetcdf]'.
+   Conversion to and between all netCDF filetypes is supported:
+   ncks -5 in_3.nc out_5.nc
+   ncks -5 in_7.nc out_5.nc
+   ncks -7 in_5.nc out_7.nc
+   http://nco.sf.net/nco.html#cdf5
+
+B. ncremap: -P option triggers filetype-specific workflow procedures
+   (such as automatic permutation). Currently filetype-specific
+   handling is defined for AIRS, HIRDLS, MLS, and MPAS files:
+   ncremap -P airs   -i airs.nc -m map.nc -o out.nc
+   ncremap -P hirdls -i airs.nc -m map.nc -o out.nc
+   ncremap -P mls    -i airs.nc -m map.nc -o out.nc
+   ncremap -P mpas   -i mpas.nc -m map.nc -o out.nc
+   One aspect of this handling is to rearrange dimension ordering
+   from the way NASA/MPAS distributes generates these datasets so 
+   that horizontal spatial dimensions (lat, lon) come last.
+   This is friendlier for regridding applications.
+
+C. ncremap: -m map_fl supplies names to generated mapfiles and ncremap 
+   annotates map-files it creates with full history. This helps retain
+   provenance in generated mapfiles. And ncremap has a friendlier
+   mode, "map-only" mode, to generate mapfiles for later use.
+   To use this mode, call ncremap without any input files to remap.  
+   ncremap will then generate the mapfile then exit.
+   ncremap -i in.nc -d dst.nc -m map.nc -o out.nc # Named mapfile
+   ncremap -s grd_in.nc -g grd_out.nc -m map.nc # Map-only mode
+   http://nco.sf.net/nco.html#ncremap
+
+D. ncremap -j job_nbr option for MPI parallelism
    http://nco.sf.net/nco.html#ncremap
 
-B. ncks prints XML "_Unsigned" attribute for unsigned attribute types.
-   Formerly, ncks did not preserve the signedness of attributes.
-   Thanks to Aleksandar Jelenak and Ed Armstrong for this suggestion.
-   % ncks -v att_var --xml ~/nco/data/in_4.nc | grep Unsigned
-    <attribute name="ubyte_att" type="byte" isUnsigned="true" value="0 1 2 127 128 254 255 0" />
-    <attribute name="ushort_att" type="short" isUnsigned="true" value="37" />
-    <attribute name="uint64_att" type="long" isUnsigned="true" value="0" />
-   http://nco.sf.net/nco.html#xml
-
-C. ncap2 now accepts [] and () syntax interchangeably.
-   Expressions which formerly had to use one or the other can now
-   use either. Brought to you by Henry.
-
-D. ncap2 now conforms arrays by hyperslabbed dimension size rather
-   than by dimension name. This mean, e.g., that hyperslabs from
-   one dimension can be used to fill-in other dimensions.
-   A prototypical example is determining pressure thickness of layers
-   as the difference between interface pressure levels.
-   For hybrid coordinate system models like CAM, this is now a
-   (relatively) simple two-step command with a mixture of different
-   dimensions on the LHS and RHS:
-   prs_ntf[time,lat,lon,ilev]=P0*hyai+PS*hybi; // Interface pressures
-   prs_dlt[time,lat,lon,lev]=prs_ntf(:,:,:,1:$ilev.size-1)-prs_ntf(:,:,:,0:$ilev.size-2);
-   http://nco.sf.net/nco.html#pdel
-   Thanks to Philip Cameron-Smith for suggesting and to Henry Butowsky
-   for implementing this new feature.
-
-E. NCO now treats variables named wgt_* as weights and avoids
-   performing math on them when possible. E.g., ncbo will preserve
-   (and not difference) the variable wgt_1. This is the same behavior
-   that NCO uses for coordinates, "gw", and masks (named with msk_*.)
-   The idea is that weights are a property of the grid and should not
-   be differenced, averaged, etc., unless necesssary.
-   http://nco.sf.net/nco.html#prc_xcp
-
-F. ncap2 now accepts "sum" as a synonym for "total" in its methods.
-   Additionally, ncap2 has a new function,
-   ncap_stats_wvariance(var,wgt) to computed weighted standard
-   deviations where missing values may be present.
-   Additionally, ncap2 now builds with GSL 2.x. All thanks to Henry.
-   http://nco.sf.net/nco.html#ncap2
+E. ncra/nces/ncwa: New operation tabs()=total_absolute_value.
+   The the -y tabs option is like -y ttl except the sum is over
+   absolute values. tabs(), mibs(), mebs(), and mabs() are analogous
+   to ttl(), min(), mean(), and max(). 
+   nces -y tabs in.nc in.nc out.nc
+   ncra -y tabs in.nc in.nc out.nc
+   ncwa -y tabs in.nc out.nc
+   http://nco.sf.net/nco.html#op_typ
+
+F. Improve support for Cygwin builds
 
 BUG FIXES:
 
-A. ncks -V in (at least) versions 4.5.1--4.5.3 could segfault.
-   NB: This is the "-V" (uppercase) not "-v" (lowercase) option. 
-   The workaround is not to use -V, solution is to upgrade to 4.5.4. 
-   Thanks to Patrick Nichols for reporting the problem.
+A. ncremap: Inferred curvilinear grids always return points now in
+   counterclockwise order. Version 4.5.4 sometimes did not. 
+   This caused bad things to happen in the weight-generators.
+
+B. ncremap: Inferring grids from curvilinear coordinates no longer
+   confused by "branch cuts" (i.e., the date-line). ncremap version
+   4.5.4 would sometimes infer concave gridcells that then confused
+   mapping software. Thanks to Feng Ding for reporting the problem.
 
-B. After dimension reduction operations, ncra and ncwa excise the
-   reduced dimensions from the CF "coordinates" attribute, if any.
-   Versions 4.4.9--4.5.3 could, under certain circumstances involving
-   multiple dimensions, retain extra whitespace in "coordinates".
-   A workaround is to dump (ncks --cdl in.nc > out.cdl) then
-   regenerate (ncgen -b out.nc out.cdl) the file.
-   The solution is to upgrade to 4.5.4.
-   Thanks to Richard Strub for reporting the problem.
+C. ncpdq: Fix problem that could cause '--gaa' option to fail in
+   earlier versions. 
+
+D. nces: Copy attributes of coordinate variables in nces --nsm_grp.
+   Previous versions omitted the attributes of coordinates (not
+   regular variables) in the ensemble average group. Thanks to Hannah
+   Nissan for reporting and Pedro Vicente for fixing this.
+
+E. ncra/nces: Correctly normalize "mebs" arithmetic. Under certain
+   conditions previous versions did not correctly normalize sums
+   computed with the mebs (mean absolute value) operator. Problem
+   reported by Will Koeppen. 
+
+F. ncap2: Fix incorrect handling of negative dimension indices.
+   Problem reported by Maksym Petrenko.
+
+G. ncatted/ncrename: Fully support --glb_att_add=--gaa.
+   This corrects an earlier oversight.
+   http://nco.sf.net/nco.html#gaa
 
 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.5.3 built/tested with netCDF
-   4.4.0-development (20160101) on top of HDF5 hdf5-1.8.13 with:
-
-   cd ~/nco;./configure # Configure mechanism -or-
-   cd ~/nco/bld;make dir;make allinone # Old Makefile mechanism
+   These problems occur with NCO 4.5.5 built/tested under
+   MacOS with netCDF 4.3.3.1 on HDF5 1.8.16 and with
+   Linux with netCDF 4.4.1-development (20160212) on HDF5 1.8.13.
 
 A. NOT YET FIXED (NCO problem)
    Correctly read arrays of NC_STRING with embedded delimiters in ncatted arguments
@@ -162,7 +154,7 @@ B. NOT YET FIXED (netCDF4 library bug)
 
    20150922: Confirmed problem reported by Isabelle Dast, reported to Unidata
    20150924: Unidata confirmed problem
-   20151221: Verified problem still exists in netCDF library
+   20160212: Verified problem still exists in netCDF library
 
    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 4cdefc5..c68211f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,194 @@
+2016-02-17  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.5 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5 final changes';git push
+	git tag -a 4.5.5 -m 'Version 4.5.5 new features: ncremap CCW, gaa, -j, -P mpas; CDF5, mebs nrm, tabs, gaa ncatted ncrename, nces crd mtd';git push --tags
+
+	* Add history attribute to maps produced by ncremap
+
+2016-02-16  Charlie Zender  <zender at uci.edu>
+
+	* Add nco_glb_att_add() and nco_vrs_att_cat() to ncatted, ncrename
+
+2016-02-14  Charlie Zender  <zender at uci.edu>
+
+	* Introduce tabs = total_absolute_value operator and add numerous nces/ncwa regression tests
+
+2016-02-13  Charlie Zender  <zender at uci.edu>
+
+	* Notice and fix mebs off-by-one error in tally accumulated in nco_opr_drv() (again affected ncra/nces not ncwa)
+
+2016-02-12  Charlie Zender  <zender at uci.edu>
+
+	* Tighten switch defaults for nco_op_typ
+
+	* NCO 4.5.5-alpha07 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5-alpha07 final changes';git push
+	git tag -a 4.5.5-alpha07 -m 'Version 4.5.5-alpha07 new features: ncremap zonal, ncra/nces mebs nrm, ncap2 ngt dmn idx, cygwin';git push --tags
+
+	* Fix mebs normalization in ncra/nces. Previously mebs was not normalized and would just accumulate!
+	Affected all previous version of ncra/nces but not ncwa. Problem reported by Will Koeppen.
+
+	* Complete special-case zonal workflows (HIRDLS and MLS) in ncremap, nco_rgr.c
+
+2016-02-11  Charlie Zender  <zender at uci.edu>
+
+	* Add most of HIRDLS special case to ncremap
+
+2016-02-11  Henry Butowsky  <henryb at hush.com>
+
+	* Fix incorrect handling of negative dmn indices in ncoGrammar in ncap_evl_lmt(): srt<0 => srt+=dmn_sz, end<0 => end+=dmn_sz
+
+2016-02-10  Charlie Zender  <zender at uci.edu>
+
+	* Collect backup-definitions of M_PI, M_LN2, M_LN10 from nco_aux.h, nco_ppc.h, and nco_rgr.h into nco.h
+	Those definitions appear to be needed by Cygwin, and only Cygwin, on which NCO is rarely tested
+	Having them available in all source files reduces chance of future Cygwin breakage
+
+	* NCO 4.5.5-alpha06 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5-alpha06 final changes';git push
+	git tag -a 4.5.5-alpha06 -m 'Version 4.5.5-alpha06 new features: bilinear default, fix when building with netCDF 4.4.0, nces crd mtd';git push --tags
+
+	* Update ncremap docs to describe new capabilities
+
+2016-02-09  Charlie Zender  <zender at uci.edu>
+
+	* ncremap appears to work with user-specified map-file names to	write
+	Unfortunately, neither ERWG nor Tempest support zonally 1-D zonally uniform grids
+
+	* Disentangle map_mk and map_usr_flg in ncremap
+
+	* Add DeepBlue-SeaWiFS dimensions natrack, nxtrack
+
+2016-02-08  Charlie Zender  <zender at uci.edu>
+
+	* Allow ncremap -m to specify name of internally-generated mapfile
+
+2016-02-07  Charlie Zender  <zender at uci.edu>
+
+	* Implement back-compatible NC_VERSION tokens in nco_netcdf.h
+
+	* Tweak ncremap defaults: tps_opt=mono, rgr_opt += --rnr=0.0
+
+2016-02-03  Charlie Zender  <zender at uci.edu>
+
+	* Patch to copy attributes of coordinate variables in nces --nsm_grp (from Pedro)
+
+2016-02-02  Charlie Zender  <zender at uci.edu>
+
+	* Make code MSVC-proof by allocating arrays only from compile-time constants
+
+	* Annotate mdl_1.cdl to verify whether nces, ncbo, ncra propagate coordinate and non-coordinate metadata to output
+
+2016-01-30  Charlie Zender  <zender at uci.edu>
+
+	* ncremap: Change default algorithm back to ESMF bilinear, which works for all Feng's cases
+
+2016-01-28  Charlie Zender  <zender at uci.edu>
+
+	* Improve ncatted quick help screen
+
+2016-01-27  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.5-alpha05 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5-alpha05 final changes';git push
+	git tag -a 4.5.5-alpha05 -m 'Version 4.5.5-alpha05 new features: CCW detection/correction';git push --tags
+
+2016-01-25  Charlie Zender  <zender at uci.edu>
+
+	* Cover most parameter space for tricky quadrilateral inputs by	calling nco_ccw_chk() recursively
+
+	* Mark --enable-esmf as developmental switch to be avoided
+
+	* ncremap correctly handle simultaneous -O drc_out -o fl_out switches
+
+	* Notate oft-need antlr post-processing perl script command
+
+2016-01-24  Charlie Zender  <zender at uci.edu>
+
+	* Implement "cheesy" patch that inverts CW quadrilaterals to make them CCW so Tempest can read them
+	Patch succeeds in making all grids CCW (according to NCO) though Tempest occasionally disagrees
+
+2016-01-24  Henry Butowsky  <henryb at hush.com>
+
+	* ncap2 first cut to grammar file of code for hyperslabbing attributes on LHS and RHS
+
+	* First version of push() method for attributes
+
+2016-01-18  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.5-alpha04 release procedure:
+	cd ~/nco;git commit -a -m 'Versqion 4.5.5-alpha04 final changes';git push
+	git tag -a 4.5.5-alpha04 -m 'Version 4.5.5-alpha04 new features: ncremap -j job_nbr';git push --tags
+
+	* Add parallelism tuning with ncremap -j job_nbr where job_nbr is number of simultaneous jobs
+
+	* Fix double eval() in ncremap
+
+	* Adopt MPI per-node parallelization nearly in toto from climo_nco.sh to ncremap
+
+2016-01-17  Charlie Zender  <zender at uci.edu>
+
+	* Implement nco_ccw_chk()
+
+	* Implement Bit Shave and Bit Set algorithms (for comparison with Bit Groom): ncks --baa=[0,1,2]
+
+2016-01-16  Charlie Zender  <zender at uci.edu>
+
+	* Update ncremap environment (e.g., DATA, NCO PATH, netCDF LD_LIBRARY_PATH) on HPCs and tidy output
+
+2016-01-15  Charlie Zender  <zender at uci.edu>
+
+	* Warn if packed in nco_grd_nfr() and nco_rgr_map() for input coordinate and variable, respectively
+
+	* Deep-free NC_STRING var_sct in nco_var_free() for ncap2 only
+
+	* NCO 4.5.5-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Versqion 4.5.5-alpha03 final changes';git push
+	git tag -a 4.5.5-alpha03 -m 'Version 4.5.5-alpha03 new features: ncremap -P airs,mpas';git push --tags
+
+	* ncpdq: Eliminate duplicate file-header set-up that causes --gaa option to fail second-time
+
+	* ncremap: Add -P pdq_typ option for AIRS and MPAS data
+
+2016-01-14  Charlie Zender  <zender at uci.edu>
+
+	* Tweaks to improve NaN-handling due to MODIS chlorophyll issues
+
+	* Explicitly include <math.h> for all files that use isfinite(), isinf(), isnan()
+
+	* NCO 4.5.5-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5-alpha02 final changes';git push
+	git tag -a 4.5.5-alpha02 -m 'Version 4.5.5-alpha02 new features: Support CDF5';git push --tags
+
+	* CDF5 work: deprecate NC_FORMAT_64BIT for NC_FORMAT_64BIT_OFFSET, expose NC_FORMAT_64BIT_DATA, update docs for -5, --5, --fl_fmt="64_bit_data"
+
+	* Deprecate pre-branch-cut methods
+
+	* NCO 4.5.5-alpha01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.5-alpha01 final changes';git push
+	git tag -a 4.5.5-alpha01 -m 'Version 4.5.5-alpha01 new features: branch-cut patch to infer curvilinear grids';git push --tags
+
+	* Implement full branch-cut patch in nco_grd_nfr(), keeps curvilinear grids from generating concave gridcells
+	in 3/4 of Feng's five-failure parade, and causes 2/4 of those to work "perfectly". Remaining two have other bugs in conserve mode.
+
+2016-01-13  Charlie Zender  <zender at uci.edu>
+
+	* Account for branch-cuts in extrapolating longitude from template
+
+	* Implement kludge for AMSR mask variable
+
+	* Add new lat,lon,col dimension and coordinate names for TRMM, GPM, AMSR, OCO2:
+	sounding_id,Latitude,Longitude,nscan,npix,npixel,S1_Latitude,S1_Longitude
+
+2016-01-08  Henry Butowsky  <henryb at hush.com>
+
+	* ncap2 ncap_stats_wvariance(var,weight) set mss_val in weight to missing values in var
+
 2016-01-07  Charlie Zender  <zender at uci.edu>
 
+	* Fix typos caught by Debian lint from Bas Couwenberg
+
 	* NCO 4.5.4 release procedure:
 	cd ~/nco;git commit -a -m 'Version 4.5.4 final changes';git push
 	git tag -a 4.5.4 -m 'Version 4.5.4 new features: ncremap fix ncpdq nfr cap, XML _Unsigned, crv dateline, GSL2';git push --tags
@@ -4768,7 +4957,7 @@
 	Eliminate pre-emptive check in nco_var_dmn_rdr_mtd() for condition
 	which was not illegal yet led to exit() anyway.
 	All that was necessary was to eliminate the exit() call.
-	False-postive errors were produced for variables that were record
+	False-positive errors were produced for variables that were record
 	in input, fixed in output, and themselves lacked the record
 	dimension, i.e., they became fixed (were neutered?) because record
 	dimension had to be fixed to satisfy re-ordering of other variables.
diff --git a/doc/TODO b/doc/TODO
index 6ef1c49..b4231f0 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -674,7 +674,8 @@ nco1126. ncra segfault with MSA christine smit regardless of presence of scale_f
       ncra -O -d time,1,1 -d time,3,3 ~/christine.nc ~/foo.nc # borken
       ncra -O -C -v one_dmn_rec_var -d time,0,0 -d time,2,2 ~/nco/data/in.nc ~/foo.nc # borken
       ncra -O -C -v one_dmn_rec_var -d time,0,0 -d time,1,1 ~/nco/data/in.nc ~/foo.nc # works
-nco1127. 
+nco1127. nco: replicate nco_var_dpl() method of deep-copying NC_STRING in nco_var_avg() so nco_var_free() can correctly free() var_sct for NC_STRING
+nco1128. 
 qrk
 ************************************************************************
 End ncoXXX TODOs
diff --git a/doc/VERSION b/doc/VERSION
index 0ed2bfe..3afbea7 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.5.4
+4.5.5
diff --git a/doc/debian.txt b/doc/debian.txt
index 311b624..1baa8ce 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.5.4
-   First we create a clean source distribution of nco and place it in nco-4.5.4
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.5.5
+   First we create a clean source distribution of nco and place it in nco-4.5.5
    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.5.4
-/bin/rm nco.tar.gz;tar cvzf nco-4.5.4.tar.gz ./nco-4.5.4/*
-cd ~/nco/nco-4.5.4
-dh_make -e zender at uci.edu -f ../nco-4.5.4.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.5.5
+/bin/rm nco.tar.gz;tar cvzf nco-4.5.5.tar.gz ./nco-4.5.5/*
+cd ~/nco/nco-4.5.5
+dh_make -e zender at uci.edu -f ../nco-4.5.5.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.5.4.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.5.4
+   cd ~/nco/nco-4.5.5
    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.5.4 with X.Y.Z+1
+# tags-query replace 4.5.5 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.5.4-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.5.5-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.5.4
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.5.5
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.5.4.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.5.5.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.5.4-2~ppa1_source.changes
+dput NCO nco_4.5.5-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.5.4-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_4.5.4-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_4.5.4-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_4.5.4-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_4.5.4.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_4.5.5-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.5.5-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.5.5-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.5.5-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.5.5.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.5.4 ${DATA}/nco_4.5.4* ${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.5.4-1 -d nco-4.5.4 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.5.4 nco # Export most recent
-tar cvzf ./nco_4.5.4.orig.tar.gz --exclude='nco-4.5.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.4 
-/bin/rm -rf ${DATA}/nco-4.5.4 # Remove cvs-exported directory
-tar xvzf ./nco_4.5.4.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-4.5.4/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.5.4/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.5.4/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-4.5.5 ${DATA}/nco_4.5.5* ${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.5.5-1 -d nco-4.5.5 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.5.5 nco # Export most recent
+tar cvzf ./nco_4.5.5.orig.tar.gz --exclude='nco-4.5.5/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.5 
+/bin/rm -rf ${DATA}/nco-4.5.5 # Remove cvs-exported directory
+tar xvzf ./nco_4.5.5.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.5.5/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.5.5/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.5.5/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.5.4;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-4.5.4;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
-cd ${DATA}/nco-4.5.4;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-4.5.5;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.5.5;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.5.5;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.5.4-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.5.5-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.5.4-1_*.deb
-ls -l ${DATA}/nco_4.5.4*
+lintian ${DATA}/nco_4.5.5-1_*.deb
+ls -l ${DATA}/nco_4.5.5*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_4.5.4* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_4.5.4* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_4.5.5* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.5.5* 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.5.4-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.5.5-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.5.4* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.5.5* # 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.5.4-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.5.4-1_*.changes
-lintian /var/cache/pbuilder/result/nco_4.5.4-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.5.5-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.5.5-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.5.5-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.5.4-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.5.5-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.5.4-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.5.5-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.5.4 ${DATA}/nco-4.5.4* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.5.5 ${DATA}/nco-4.5.5* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-4.5.4 \
-${rpm_root}/RPMS/i386/nco-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.4-?.i386.rpm \
-${rpm_root}/SOURCES/nco-4.5.4.tar.gz \
-${rpm_root}/SPECS/nco-4.5.4.spec \
-${rpm_root}/SRPMS/nco-4.5.4-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.4-1 -d nco-4.5.4 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.5.4.spec
-tar cvzf ./nco-4.5.4.tar.gz --exclude='nco-4.5.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.4 
-${sudo_sng} /bin/cp ${DATA}/nco-4.5.4.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-4.5.5 \
+${rpm_root}/RPMS/i386/nco-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.5-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.5.5.tar.gz \
+${rpm_root}/SPECS/nco-4.5.5.spec \
+${rpm_root}/SRPMS/nco-4.5.5-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.5-1 -d nco-4.5.5 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.5.5.spec
+tar cvzf ./nco-4.5.5.tar.gz --exclude='nco-4.5.5/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.5 
+${sudo_sng} /bin/cp ${DATA}/nco-4.5.5.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.5.4.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.5.5.spec > ~/foo.nco 2>&1
 scp \
-${rpm_root}/RPMS/i386/nco-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.4-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.5.4-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.5-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.5.5-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/RPMS/i386/nco-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.4-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.4-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.5.4-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.5-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.5-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.5.5-?.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.5.4 ${DATA}/nco-4.5.4* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.5.5 ${DATA}/nco-4.5.5* # Cleanup last build
 /bin/rm -r -f \
-${rpm_root}/nco-4.5.4-?.src.rpm \
-${rpm_root}/nco-4.5.4.spec \
-${rpm_root}/nco-4.5.4.tar.gz \
-${rpm_root}/*/nco-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.4-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.4-1 -d nco-4.5.4 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.5.4 nco # Export most recent and build as 4.5.4-1
-tar cvzf ./nco-4.5.4.tar.gz --exclude='nco-4.5.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.4 
-/bin/cp ${DATA}/nco-4.5.4.tar.gz ${rpm_root}
+${rpm_root}/nco-4.5.5-?.src.rpm \
+${rpm_root}/nco-4.5.5.spec \
+${rpm_root}/nco-4.5.5.tar.gz \
+${rpm_root}/*/nco-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.5-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.5-1 -d nco-4.5.5 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.5.5 nco # Export most recent and build as 4.5.5-1
+tar cvzf ./nco-4.5.5.tar.gz --exclude='nco-4.5.5/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.5 
+/bin/cp ${DATA}/nco-4.5.5.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.5.4-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.5.5-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.5.4-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.5.5-?.*.rpm
 scp \
-${rpm_root}/*/nco-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.4-?.*.rpm \
-${rpm_root}/nco-4.5.4-?.*.src.rpm \
+${rpm_root}/*/nco-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.5-?.*.rpm \
+${rpm_root}/nco-4.5.5-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/*/nco-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.4-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.4-?.*.rpm \
-${rpm_root}/nco-4.5.4-?.*.src.rpm \
+${rpm_root}/*/nco-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.5-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.5-?.*.rpm \
+${rpm_root}/nco-4.5.5-?.*.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 e27378a..a684a6d 100644
--- a/doc/index.shtml
+++ b/doc/index.shtml
@@ -67,10 +67,10 @@ Try to disable Spammers' machines:
 </td></tr></table>
 
 <p><hr width="100%"></p>
-<p><h1 align="center">Welcome to the netCDF Operator (NCO) Homepage</h1>
+<p><h1 align="center">Bienvenue sur le netCDF Operator (NCO) site</h1>
 
 <p><h2>
-Current stable NCO version is 4.5.4 released <!--#flastmod file="src/nco-4.5.4.tar.gz"-->
+Current stable NCO version is 4.5.5 released <!--#flastmod file="src/nco-4.5.5.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,12 +149,14 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2015 Jan ??: 4.5.5 (<i>In progress</i>)
-<li>2015 Jan 07: 4.5.4 (<tt>ncremap</tt>)
-<li>2015 Dec 16: <a href="http://dust.ess.uci.edu/smn/pst_nco_agu_201512.pdf">Poster</a> at Fall AGU, San Francisco, California</li>
-<li>2015 Nov 04: <a href="http://dust.ess.uci.edu/smn/smn_nco_acme_201511.pdf">Talk</a> at DOE ACME, Albuquerque, New Mexico</li>
+<li>2016 Mar ??: 4.5.6 (<i>In progress</i>)
+<li>2016 Feb 17: 4.5.5 (Stability)
+<li>2016 Jan 07: 4.5.4 (<tt>ncremap</tt>)
+<li>2015 Dec 16: <a href="http://dust.ess.uci.edu/smn/pst_nco_agu_201512.pdf">Poster</a> at Fall AGU, San Francisco</li>
+<li>2015 Nov 04: <a href="http://dust.ess.uci.edu/smn/smn_nco_acme_201511.pdf">Talk</a> at DOE ACME, Albuquerque</li>
 <li>2015 Oct 20: 4.5.3 (Curvilinear)
 <li>2015 Sep 06: 4.5.2 (Generate SCRIP)
+<li>2015 Sep 01: NSF EarthCube <a href="#prp_e3">project</a> commences</li>
 <li>2015 Jul 10: 4.5.1 (Stability)
 <li>2015 Jun 11: 4.5.0 (Regridding)
 <li>2015 May 21: 4.4.9 (<tt>ncra</tt> weights)
@@ -166,28 +168,12 @@ and
 <li>2014 Jul 01: NASA ACCESS 2013 <a href="#prp_axs">project</a> commences</li>
 <li>2014 May 29: 4.4.4 (Stability)
 <li>2014 Apr 02: 4.4.3 (Stability)
-<li>2014 Mar 27: <a href="http://dust.ess.uci.edu/smn/smn_nco_gsfc_201403.pdf">Talk</a> at NASA GSFC, Greenbelt, Maryland</li>
-<li>2014 Mar 25: <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201403.pdf">Poster</a> at NASA ESDSWG, Greenbelt, Maryland</li>
+<li>2014 Mar 27: <a href="http://dust.ess.uci.edu/smn/smn_nco_gsfc_201403.pdf">Talk</a> at NASA GSFC, Greenbelt</li>
+<li>2014 Mar 25: <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201403.pdf">Poster</a> at NASA ESDSWG, Greenbelt</li>
 <li>2014 Feb 20: 4.4.2 (Stability)
 <li>2014 Jan 29: 4.4.1 (Stability)
 <li>2014 Jan 09: 4.4.0 (Stability)
-<li>2013 Dec 13: <a href="http://dust.ess.uci.edu/smn/smn_nco_agu_201312.pdf">Talk</a> at Fall AGU, San Francisco, California</li>
-<li>2013 Dec 02: 4.3.9 (new operator, <tt>nces</tt>)
-<li>2013 Nov 06: 4.3.8 (<tt>ncatted</tt> groups)
-<li>2013 Oct 17: 4.3.7 (HDF4, XML, <tt>ncrename</tt> groups)
-<li>2013 Oct 02: <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201310.pdf">Poster</a> at NASA ESDSWG, Greenbelt, Maryland</li>
-<li>2013 Sep 27: 4.3.6 (<tt>--dbl</tt> default, <tt>ncdismember</tt>)
-<li>2013 Sep 20: 4.3.5 (<tt>nces</tt>, <tt>ncra</tt>, <tt>ncrcat</tt> groups)
-<li>2013 Aug 01: 4.3.4 (<tt>ncpdq</tt> bugfix, HDF unpacking)
-<li>2013 Jul 24: 4.3.3 (<tt>ncrename</tt>, <tt>ncwa</tt> groups, CDL, XML)
-<li>2013 Jul 05: 4.3.2 (<tt>ncflint</tt>, <tt>ncpdq</tt> groups)</li>
-<li>2013 Jun 03: Submitted NASA ACCESS 2013 <a href="http://dust.ess.uci.edu/prp/prp_axs/prp_axs.pdf">proposal</a></li>
-<li>2013 May 01: 4.3.1 (Group broadcasting)</li>
-<li>2013 Mar 28: 4.3.0 (<tt>ncbo</tt> groups)</li>
-<li>2013 Mar 19: 4.2.6</li>
-<li>2013 Jan 28: 4.2.5</li>
-<li>2013 Jan 21: 4.2.4</li>
-<li><a href="./milestones_old.shtml">Milestones from 2003–2012 (versions 2.8.4–4.2.3)</a></li>
+<li><a href="./milestones_old.shtml">Milestones from 2003–2013 (versions 2.8.4–4.3.9)</a></li>
 <li><a href="./nco_news.shtml">News and Announcements from 1998–2003 (version 1.1.0–2.8.3) and earlier</a></li>
 </ul>
 <hr></p>
@@ -693,20 +679,28 @@ San Francisco, CA, December 5–9, 2006.
 Stable releases receive unique tags and their tarballs are stored  
 <a href="http://nco.sf.net/src">here</a> on SourceForge and
 <a href="https://github.com/nco/nco/releases">here</a> at GitHub.
-You may also retrieve the source of tagged versions directly
-<a name="#Source">with <tt>git clone -b 4.5.2 http://github.com/nco/nco.git nco-4.5.2</tt></a>.
+You may also retrieve the source of tagged versions directly with, e.g.,
+<tt>git clone -b 4.5.5 http://github.com/nco/nco.git nco-4.5.5</tt></a>.
 <ul>
-<li><b>NCO 4.5.6</b>: (<i>Future</i>) 
+<li><b>NCO 4.5.7</b>: (<i>Future</i>) 
 <tt>ncks</tt> prints human-legible ISO8601 dates;
 <a href="http://nco.sf.net/nco.html#cnk">Chunking</a> bytes not elements, caching;
 <tt>ncks</tt> prints human-legible ISO8601 dates;
 extensive hashing?;
 netCDF4 compound types?;
+<tt>ncremap</tt> use CF to find coordinates;
+<tt>ncks --xtn</tt> better extensive variable treatment;
 Optimize diskless files?;</li>
-<li><b>NCO 4.5.5</b>: (<i>In Progress, features in-progress or completed include</i>)
-<tt>ncks</tt> regridder uses CF to find coordinates;
+<li><b>NCO 4.5.6</b>: (<i>In Progress, features in-progress or completed include</i>)
+<tt>ncremap</tt> use CF to find coordinates;
 <tt>ncks --xtn</tt> better extensive variable treatment;
 <tt>ncpdq</tt> fix permutation with multiple groups;</li>
+<li><b>NCO 4.5.5</b>: (<i>Current Stable Release</i>)
+All operators support CDF5 format;
+<tt>ncap2</tt> fix negative dimension indices handling;
+<tt>ncremap -P airs,hirdls,mls,mpas</tt>;
+<tt>nces/ncra</tt> fix <tt>-y mebs</tt> normalization, add <tt>-y tabs</tt>;
+<tt>ncatted/ncrename/ncpdq</tt> fix <tt>--gaa</tt>;</li>
 <li><b>NCO 4.5.4</b>: (<i>Current Stable Release</i>)
 <tt>ncap2</tt> syntax simplification/fixes;
 <tt>ncks -V</tt> bugfix;
@@ -901,7 +895,7 @@ Thanks to NSF for supporting AIX machines at NCAR over the years.
 <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.5.2</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.5.5</a></li>
 -->
 <a href="http://packages.debian.org/unstable/science/nco">Debian NCO</a> and 
 <a href="http://packages.ubuntu.com/natty/nco">Ubuntu NCO</a> homepages.
@@ -909,12 +903,12 @@ Thanks to NSF for supporting AIX machines at NCAR over the years.
 NCO packages in the Debian/Ubuntu repositories (i.e., 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.5.2-1_i386.deb</tt>’):</dt>
-<li><a href="src/nco_4.5.2-1_amd64.deb">nco_4.5.2-1_amd64.deb</a> (<!--#fsize file="src/nco_4.5.2-1_amd64.deb"-->): Executables AMD64-compatible (last updated <!--#flastmod file="src/nco_4.5.2-1_amd64.deb"-->)</li>
-<li><a href="src/nco_4.5.2-1.dsc">nco_4.5.2-1.dsc</a> (<!--#fsize file="src/nco_4.5.2-1.dsc"-->): Description (last updated <!--#flastmod file="src/nco_4.5.2-1.dsc"-->)</li>
-<li><a href="src/nco_4.5.2-1_amd64.changes">nco_4.5.2-1_amd64.changes</a> (<!--#fsize file="src/nco_4.5.2-1_amd64.changes"-->): Changes since last deb package (last updated <!--#flastmod file="src/nco_4.5.2-1_amd64.changes"-->)</li>
-<li><a href="src/nco_4.5.2.orig.tar.gz">nco_4.5.2.orig.tar.gz</a> (<!--#fsize file="src/nco_4.5.2.orig.tar.gz"-->): Upstream Source (last updated <!--#flastmod file="src/nco_4.5.2.orig.tar.gz"-->)</li>
-<li><a href="src/nco_4.5.2-1.diff.gz">nco_4.5.2-1.diff.gz</a> (<!--#fsize file="src/nco_4.5.2-1_amd64.changes"-->): Debian patch to upstream source (last updated <!--#flastmod file="src/nco_4.5.2-1_amd64.changes"-->)</li>
+<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_4.5.5-1_i386.deb</tt>’):</dt>
+<li><a href="src/nco_4.5.5-1_amd64.deb">nco_4.5.5-1_amd64.deb</a> (<!--#fsize file="src/nco_4.5.5-1_amd64.deb"-->): Executables AMD64-compatible (last updated <!--#flastmod file="src/nco_4.5.5-1_amd64.deb"-->)</li>
+<li><a href="src/nco_4.5.5-1.dsc">nco_4.5.5-1.dsc</a> (<!--#fsize file="src/nco_4.5.5-1.dsc"-->): Description (last updated <!--#flastmod file="src/nco_4.5.5-1.dsc"-->)</li>
+<li><a href="src/nco_4.5.5-1_amd64.changes">nco_4.5.5-1_amd64.changes</a> (<!--#fsize file="src/nco_4.5.5-1_amd64.changes"-->): Changes since last deb package (last updated <!--#flastmod file="src/nco_4.5.5-1_amd64.changes"-->)</li>
+<li><a href="src/nco_4.5.5.orig.tar.gz">nco_4.5.5.orig.tar.gz</a> (<!--#fsize file="src/nco_4.5.5.orig.tar.gz"-->): Upstream Source (last updated <!--#flastmod file="src/nco_4.5.5.orig.tar.gz"-->)</li>
+<li><a href="src/nco_4.5.5-1.diff.gz">nco_4.5.5-1.diff.gz</a> (<!--#fsize file="src/nco_4.5.5-1_amd64.changes"-->): Debian patch to upstream source (last updated <!--#flastmod file="src/nco_4.5.5-1_amd64.changes"-->)</li>
 Thanks to Daniel Baumann, Barry deFreese, Francesco Lovergine, 
 Brian Mays, Rorik Peterson, and Matej Vela for their help packaging
 NCO for Debian over the years. 
@@ -961,10 +955,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
 <!-- 
 # Mac OS X 10.11 (El Capitan) 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.5.4.macosx.10.11.tar.gz nc*;scp ${DATA}/nco-4.5.4.macosx.10.11.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-4.5.5.macosx.10.11.tar.gz nc*;scp ${DATA}/nco-4.5.5.macosx.10.11.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 -->
 The most up-to-date binaries 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.5.4.macosx.10.11.tar.gz">nco-4.5.4.macosx.10.11.tar.gz</a> (<!--#fsize file="src/nco-4.5.4.macosx.10.11.tar.gz"-->): Executables MacOSX 10.11-compatible (last updated <!--#flastmod file="src/nco-4.5.4.macosx.10.11.tar.gz"-->). 
+<li><a href="src/nco-4.5.5.macosx.10.11.tar.gz">nco-4.5.5.macosx.10.11.tar.gz</a> (<!--#fsize file="src/nco-4.5.5.macosx.10.11.tar.gz"-->): Executables MacOSX 10.11-compatible (last updated <!--#flastmod file="src/nco-4.5.5.macosx.10.11.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>
@@ -979,7 +973,7 @@ The most up-to-date binaries are probably those in the tarball below. Those unfa
 <a name="mvs"></a> <!-- http://nco.sf.net#mvs -->
 <a name="windows"></a> <!-- http://nco.sf.net#windows -->
 <h3><a href="http://www.microsoft.com">Microsoft Windows</a>
-(native build, compiled with <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express">Visual Studio 2010</a>, use this if unsure)</h3>
+(native build, compiled with <a href="https://www.visualstudio.com/en-us/visual-studio-homepage-vs.aspx">Visual Studio 2013</a>, use this if unsure)</h3>
 These native Windows executables should be stand-alone, i.e., not
 require users to have any additional software. 
 This is a new feature as of 20120615, please send us feedback. 
@@ -987,10 +981,10 @@ To build NCO from source yourself using MSVC or Qt, please see the <a href="nco_
 <ul>
 <!-- Copy files from http://glace.ess.uci.edu
 /usr/bin/scp /home/pvicente/nco/doc/index.shtml pvicente,nco at web.sf.net:/home/project-web/nco/htdocs
-/usr/bin/scp /home/pvicente/windows_setup/nco-4.5.2.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
+/usr/bin/scp /home/pvicente/windows_setup/nco-4.5.4.windows.mvs.exe pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
 /usr/bin/scp /home/pvicente/windows_setup/nco-4.4.5.win32.cygwin.tar.gz pvicente,nco at web.sf.net:/home/project-web/nco/htdocs/src
 -->
-<li><a href="src/nco-4.5.2.windows.mvs.exe">nco-4.5.2.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.5.2.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.5.2.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
+<li><a href="src/nco-4.5.4.windows.mvs.exe">nco-4.5.4.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.5.4.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.5.4.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
 </ul>
 
 <a name="cygwin"></a> <!-- http://nco.sf.net#cygwin -->
@@ -1156,11 +1150,11 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- scp ${DATA}/nco-4.5.2.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="src/nco-4.5.2.tar.gz">nco-4.5.2.tar.gz</a> 
-(<!--#fsize file="src/nco-4.5.2.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-4.5.2.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-4.5.2.tar.gz"--> 
+<!-- scp ${DATA}/nco-4.5.5.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="src/nco-4.5.5.tar.gz">nco-4.5.5.tar.gz</a> 
+(<!--#fsize file="src/nco-4.5.5.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-4.5.5.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-4.5.5.tar.gz"--> 
 </li>
 </ul>
 
@@ -1179,17 +1173,17 @@ 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.5.2</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.5.2</tt></p>
+then checks out NCO version <tt>4.5.5</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.5.5</tt></p>
 This command retrieves 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>
 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.5.2</tt>) and the development version is that the
+(e.g., <tt>4.5.5</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.5.2</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.5.5</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.
@@ -1233,7 +1227,7 @@ If pre-built executables do not satisfy you (e.g., are out-of-date)
 and you want the latest, greatest features, then the first steps to
 build (i.e., compile, for the most part) NCO from source code are to
 install the prerequisites:
-<a href="http://www.antlr.org">ANTLR</a> version 2.7.7 (like <a href="http://glace.ess.uci.edu/libs/antlr-2.7.7.tar.gz">this one</a> <i>not</i> version 3.x or 4.x!) (required for <tt>ncap2</tt>), 
+<a href="http://www.antlr.org">ANTLR</a> version 2.7.7 (like <a href="http://dust.ess.uci.edu/tmp/antlr-2.7.7.tar.gz">this one</a> <i>not</i> version 3.x or 4.x!) (required for <tt>ncap2</tt>), 
 <a href="http://www.gnu.org/software/gsl">GSL</a> (desirable for <tt>ncap2</tt>), 
 <a href="http://www.unidata.ucar.edu/packages/netcdf">netCDF</a> (absolutely required), 
 <a href="http://opendap.org">OPeNDAP</a> (enables network transparency), and
@@ -1321,9 +1315,9 @@ Users should instead first download and install the Antlr found <a href="http://
   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.5.2.tar.gz</dt>
-<dt>tar xvzf 4.5.2.tar.gz</dt>
-<dt>cd nco-4.5.2</dt>
+<dt>wget https://github.com/nco/nco/archive/4.5.5.tar.gz</dt>
+<dt>tar xvzf 4.5.5.tar.gz</dt>
+<dt>cd nco-4.5.5</dt>
 <dt>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1372,11 +1366,14 @@ is usually untagged.
   <tt>export LD_LIBRARY_PATH="~zender/lib:${LD_LIBRARY_PATH}"</tt>
 <ul>
 <li>ANL ALCF Cooley <tt>cooley.alcf.anl.gov</tt>: <tt>~zender/bin</tt></li>
+<li>ANL ALCF Mira <tt>mira.alcf.anl.gov</tt>: <tt>~zender/bin</tt></li>
 <li>NCAR CISL <tt>yellowstone.ucar.edu</tt>: <tt>~zender/bin</tt></li>
 <li>NCAR CISL <tt>mirage0.ucar.edu</tt>: <tt>~zender/bin</tt></li>
+<li>NERSC Cori <tt>cori.nersc.gov</tt>: <tt>~zender/bin</tt></li>
 <li>NERSC Edison <tt>edison.nersc.gov</tt>: <tt>~zender/bin</tt> or <tt>module load nco/4.5.2</tt></li>
 <li>ORNL OLCF Pileus <tt>pileus-login01.ornl.gov</tt>: <tt>~zender/bin</tt></li>
 <li>ORNL OLCF Rhea <tt>rhea.ccs.ornl.gov</tt>: <tt>~zender/bin</tt></li>
+<li>ORNL OLCF Titan <tt>titan.ccs.ornl.gov</tt>: <tt>~zender/bin</tt></li>
 <li>UCI ESS <tt>greenplanet.ps.uci.edu</tt>: <tt>~zender/bin</tt></li>
 </ul>
 <hr></p>
diff --git a/doc/milestones_old.shtml b/doc/milestones_old.shtml
index 5ca5f46..3e30322 100644
--- a/doc/milestones_old.shtml
+++ b/doc/milestones_old.shtml
@@ -23,11 +23,27 @@ scp -p ~/nco/doc/milestones_old.shtml dust.ess.uci.edu:/var/www/html/nco
 <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#008080" alink="#FF0000">
 
 <dt><a name="News"></a></dt>
-<h2>Releases & Milestones from 2003–2012 (versions 2.8.4–4.2.3)</h2>
+<h2>Releases & Milestones from 2003–2013 (versions 2.8.4–4.3.9)</h2>
 
 <ul>
-<li>2012 Dec 05: NCO <a href="http://dust.ess.uci.edu/smn/smn_nco_agu_201212.pdf">Talk</a> at Fall AGU, San Francisco, California</li>
-<li>2012 Nov 28: NCO <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201211.pdf">Poster</a> at NASA ESDSWG, Annapolis, Maryland</li>
+<li>2013 Dec 13: <a href="http://dust.ess.uci.edu/smn/smn_nco_agu_201312.pdf">Talk</a> at Fall AGU, San Francisco</li>
+<li>2013 Dec 02: 4.3.9 (new operator, <tt>nces</tt>)
+<li>2013 Nov 06: 4.3.8 (<tt>ncatted</tt> groups)
+<li>2013 Oct 17: 4.3.7 (HDF4, XML, <tt>ncrename</tt> groups)
+<li>2013 Oct 02: <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201310.pdf">Poster</a> at NASA ESDSWG, Greenbelt</li>
+<li>2013 Sep 27: 4.3.6 (<tt>--dbl</tt> default, <tt>ncdismember</tt>)
+<li>2013 Sep 20: 4.3.5 (<tt>nces</tt>, <tt>ncra</tt>, <tt>ncrcat</tt> groups)
+<li>2013 Aug 01: 4.3.4 (<tt>ncpdq</tt> bugfix, HDF unpacking)
+<li>2013 Jul 24: 4.3.3 (<tt>ncrename</tt>, <tt>ncwa</tt> groups, CDL, XML)
+<li>2013 Jul 05: 4.3.2 (<tt>ncflint</tt>, <tt>ncpdq</tt> groups)</li>
+<li>2013 Jun 03: Submitted NASA ACCESS 2013 <a href="http://dust.ess.uci.edu/prp/prp_axs/prp_axs.pdf">proposal</a></li>
+<li>2013 May 01: 4.3.1 (Group broadcasting)</li>
+<li>2013 Mar 28: 4.3.0 (<tt>ncbo</tt> groups)</li>
+<li>2013 Mar 19: 4.2.6</li>
+<li>2013 Jan 28: 4.2.5</li>
+<li>2013 Jan 21: 4.2.4</li>
+<li>2012 Dec 05: NCO <a href="http://dust.ess.uci.edu/smn/smn_nco_agu_201212.pdf">Talk</a> at Fall AGU, San Francisco</li>
+<li>2012 Nov 28: NCO <a href="http://dust.ess.uci.edu/smn/pst_nco_esds_201211.pdf">Poster</a> at NASA ESDSWG, Annapolis</li>
 <li>2012 Nov 13: NCO 4.2.3 (GPE)</li>
 <li>2012 Oct 29: NCO 4.2.2 (<tt>ncks, ncecat</tt> Groups)</li>
 <li>2012 Aug 02: NCO 4.2.1 (RAM disks)</li>
@@ -56,7 +72,7 @@ scp -p ~/nco/doc/milestones_old.shtml dust.ess.uci.edu:/var/www/html/nco
 <li>2008 May 11: NCO 3.9.5</li>
 <li>2008 Apr 28: NCO <a href="http://dust.ess.uci.edu/ppr/ppr_Zen08.pdf">overview</a> paper in EMS</li>
 <li>2008 Mar 04: NCO 3.9.4</li>
-<li>2007 Dec 10: SWAMP <a href="http://dust.ess.uci.edu/ppr/pst_WZJ074.pdf">Poster</a> at Fall AGU, San Francisco, California</li>
+<li>2007 Dec 10: SWAMP <a href="http://dust.ess.uci.edu/ppr/pst_WZJ074.pdf">Poster</a> at Fall AGU, San Francisco</li>
 <li>2007 Dec 07: NCO 3.9.3 (SWAMP!)</li>
 <li>2007 Dec 04: NCO <a href="http://dust.ess.uci.edu/ppr/ppr_ZeM07.pdf">scaling paper</a> in IJHPCA</li>
 <li>2007 Aug 29: NCO 3.9.2 (<tt>_FillValue</tt>s)</li>
@@ -67,10 +83,10 @@ scp -p ~/nco/doc/milestones_old.shtml dust.ess.uci.edu:/var/www/html/nco
 <li>2007 Apr 20: NCO 3.2.0</li>
 <li>2007 Mar 29: NCO 3.1.9 x86_64 RPMs</li>
 <li>2007 Mar 10: NCO 3.1.9 (i386/x86_64 debs and i386 RPMs)</li>
-<li>2007 Feb 22: SWAMP <a href="http://dust.ess.uci.edu/smn/smn_WZJ07_opendap_200702.pdf">Talk</a> at OPeNDAP Developer's Workshop, Boulder, Colorado</li>
+<li>2007 Feb 22: SWAMP <a href="http://dust.ess.uci.edu/smn/smn_WZJ07_opendap_200702.pdf">Talk</a> at OPeNDAP Developer's Workshop, Boulder</li>
 <li>2007 Jan 15: <a href="http://dust.ess.uci.edu/smn/smn_nco_ams_200701.pdf">Talk</a> and <a href="http://dust.ess.uci.edu/ppr/abs_xtn_ZeW07.pdf">Extended Abstract</a> on NCO Scaling at AMS IIPS, San Antonio, Texas</li>
-<li>2007 Jan 09: <a href="http://dust.ess.uci.edu/ppr/pst_ZMW06.pdf">Poster</a> on NCO Scaling at Fall AGU, San Francisco, California</li>
-<li>2006 Dec 09: <a href="http://dust.ess.uci.edu/ppr/pst_WZJ06.pdf">Poster</a> on SWAMP at Fall AGU, San Francisco, California</li>
+<li>2007 Jan 09: <a href="http://dust.ess.uci.edu/ppr/pst_ZMW06.pdf">Poster</a> on NCO Scaling at Fall AGU, San Francisco</li>
+<li>2006 Dec 09: <a href="http://dust.ess.uci.edu/ppr/pst_WZJ06.pdf">Poster</a> on SWAMP at Fall AGU, San Francisco</li>
 <li>2006 Dec 06: NCO 3.1.8</li>
 <li>2006 Nov 11: NCO 3.1.7</li>
 <li>2006 Sep 18: NCO 3.1.6</li>
diff --git a/doc/nco.texi b/doc/nco.texi
index 4865015..12eb3cc 100644
--- a/doc/nco.texi
+++ b/doc/nco.texi
@@ -113,12 +113,12 @@ Octave TeXInfo manual shows clean TeXInfo structure
 @setfilename nco.info
 
 @c Define edition, date, ...
- at set nco-edition 4.5.4
- at set doc-edition 4.5.4
+ at set nco-edition 4.5.5
+ at set doc-edition 4.5.5
 @set copyright-years 1995--2016
 @set update-year 2015
- at set update-date 1 January 2016
- at set update-month January 2016
+ at set update-date 17 February 2016
+ at set update-month February 2016
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -2357,13 +2357,13 @@ to the memory requirements.
 Further note that some operators perform internal type-promotion on some
 variables prior to arithmetic (@pxref{Type Conversion}).
 For example, @command{ncra} and @command{nces} both promote integer
-types to double-precision floating point prior to arithmetic, then 
+types to double-precision floating-point prior to arithmetic, then 
 perform the arithmetic, then demote back to the original integer type
 after arithmetic.
 This preserves the on-disk storage type while obtaining the accuracy
-advantages of floating point arithmetic. 
+advantages of floating-point arithmetic. 
 Since version 4.3.6 (released in September, 2013), @acronym{NCO} also
-by default converts single-precision floating point to double-precision
+by default converts single-precision floating-point to double-precision
 prior to arithmetic, which incurs the same @acronym{RAM} penalty.
 Hence, the sustained memory required for integer variables and
 single-precision floats are two or four-times their on-disk,
@@ -2713,7 +2713,7 @@ Compute-intensive operators (@code{ncap2}, @code{ncwa} and @code{ncpdq})
 benefit most from threading.
 The greatest increases in throughput due to threading occur on
 large datasets where each thread performs millions, at least,
-of floating point operations.
+of floating-point operations.
 Otherwise, the system overhead of setting up threads probably outweighs 
 the speed enhancements due to @acronym{SMP} parallelism.
 However, we have not yet demonstrated that the @acronym{SMP} parallelism 
@@ -3583,19 +3583,25 @@ when your other preferred methods are not available locally.
 @html
 <a name="fl_fmt"></a> <!-- http://nco.sf.net/nco.html#fl_fmt -->
 <a name="hdf"></a> <!-- http://nco.sf.net/nco.html#hdf -->
+<a name="cdf5"></a> <!-- http://nco.sf.net/nco.html#cdf5 -->
 <a name="64bit"></a> <!-- http://nco.sf.net/nco.html#64bit -->
+<a name="64bit-data"></a> <!-- http://nco.sf.net/nco.html#64bit-data -->
+<a name="64bit-offset"></a> <!-- http://nco.sf.net/nco.html#64bit-offset -->
 <a name="netcdf4"></a> <!-- http://nco.sf.net/nco.html#netcdf4 -->
 @end html
 @node File Formats and Conversion, Large File Support, Retaining Retrieved Files, Shared features
 @section File Formats and Conversion
 @cindex @acronym{HDF}
+ at cindex CDF5
 @cindex netCDF2
 @cindex netCDF3
 @cindex netCDF4
 @cindex @code{NETCDF4_CLASSIC} files
 @cindex @code{NETCDF4} files
 @cindex @code{CLASSIC} files
- at cindex @code{64BIT} files
+ at cindex @code{64BIT_OFFSET} files
+ at cindex @code{64BIT_DATA} files
+ at cindex @code{CDF5} files
 @cindex @code{--3}
 @cindex @code{-3}
 @cindex @code{-4}
@@ -3609,13 +3615,14 @@ when your other preferred methods are not available locally.
 @cindex @code{--netcdf4}
 @cindex @code{--fl_fmt}
 @cindex @code{--file_format}
- at cindex @code{--64bit}
+ at cindex @code{--64bit_offset}
+ at cindex @code{--64bit_data}
 @cartouche
 Availability: @command{ncap2}, @command{nces},
 @command{ncecat}, @command{ncflint}, @command{ncks}, @command{ncpdq},
 @command{ncra}, @command{ncrcat}, @command{ncwa}@*
-Short options: @samp{-3}, @samp{-4}, @samp{-6}, @samp{-7}@*
-Long options: @samp{--3}, @samp{--4}, @samp{--6}, @samp{--64bit}, @samp{--7}, @samp{--fl_fmt},
+Short options: @samp{-3}, @samp{-4}, @samp{-5}, @samp{-6}, @samp{-7}@*
+Long options: @samp{--3}, @samp{--4}, @samp{--5}, @samp{--6}, @samp{--64bit_offset}, @samp{--7}, @samp{--fl_fmt},
 @samp{--netcdf4}@*  
 @end cartouche
 All @acronym{NCO} operators support (read and write) all three (or four, 
@@ -3639,15 +3646,19 @@ format as the input netCDF file.)
 
 @node File Formats, Determining File Format, File Formats and Conversion, File Formats and Conversion
 @subsection File Formats
-netCDF supports four types of files: @code{CLASSIC}, @code{64BIT},
- at code{NETCDF4}, and @code{NETCDF4_CLASSIC}, 
+netCDF supports five types of files: @code{CLASSIC},
+ at code{64BIT_OFFSET}, @code{64BIT_DATA}, @code{NETCDF4}, and
+ at code{NETCDF4_CLASSIC}.
 The @code{CLASSIC} format is the traditional 32-bit offset written by
 netCDF2 and netCDF3.
 As of 2005, nearly all netCDF datasets were in @code{CLASSIC} format. 
-The @code{64BIT} format was added in Fall, 2004.
-As of 2010, many netCDF datasets were in @code{64BIT} format. 
+The @code{64BIT_OFFSET} (originally called plain old @code{64BIT})
+format was added in Fall, 2004. 
+As of 2010, many netCDF datasets were in @code{64BIT_OFFSET} format. 
 As of 2013, an increasing number of netCDF datasets were in
 @code{NETCDF4_CLASSIC} format.
+The @code{64BIT_DATA} (aka @code{CDF5} or @code{PNETCDF})
+format was added in January, 2016. 
 
 The @code{NETCDF4} format uses @acronym{HDF5} as the file storage layer. 
 The files are (usually) created, accessed, and manipulated using the 
@@ -3662,8 +3673,8 @@ linked with the netCDF4 library).
 @acronym{NCO} must be built with @w{netCDF4} to write files in the new
 @code{NETCDF4} and @code{NETCDF4_CLASSIC} formats, and to read files in
 these formats. 
-Datasets in the default @code{CLASSIC} or the newer @code{64BIT} formats 
-have maximum backwards-compatibility with older applications. 
+Datasets in the default @code{CLASSIC} or the newer @code{64BIT_OFFSET}
+formats have maximum backwards-compatibility with older applications. 
 @acronym{NCO} has deep support for @code{NETCDF4} formats.
 If performance or disk-space as important as backwards compatibility,
 then use @code{NETCDF4_CLASSIC} instead of @code{CLASSIC} format files. 
@@ -3674,11 +3685,11 @@ workflows will utilize this format.
 As mentioned above, all operators write use the input file format for
 output files unless told otherwise.
 Toggling the short option @samp{-6} or the long option @samp{--6} or
- at samp{--64bit} (or their @var{key}- at var{value} equivalent
- at samp{--fl_fmt=64bit}) produces the netCDF3 64-bit offset format named
- at code{64BIT}.
+ at samp{--64bit_offset} (or their @var{key}- at var{value} equivalent
+ at samp{--fl_fmt=64bit_offset}) produces the netCDF3 64-bit offset format
+named @code{64BIT_OFFSET}.
 @acronym{NCO} must be built with @w{netCDF 3.6} or higher to produce
-a @code{64BIT} file.
+a @code{64BIT_OFFSET} file.
 Using the @samp{-4} switch (or its long option equivalents
 @samp{--4} or @samp{--netcdf4}), or setting its @var{key}- at var{value}
 equivalent @samp{--fl_fmt=netcdf4} produces a @code{NETCDF4} file
@@ -3727,15 +3738,19 @@ First, examine the first line of global metadata output by @samp{ncks -M}:
 @cindex netCDF4 file format
 @cindex 32-bit offset file format
 @cindex 64-bit offset file format
+ at cindex 64-bit data file format
+ at cindex PnetCDF file format
 @cindex @command{ncks} 
 @cindex @code{-M}
 @example
-% ncks -M foo_3c.nc
-Summary of foo_3c.nc: filetype = NC_FORMAT_CLASSIC, 0 groups ...
-% ncks -M foo_364.nc
-Summary of foo_364.nc: filetype = NC_FORMAT_64BIT, 0 groups ...
-% ncks -M foo_4c.nc
-Summary of foo_4c.nc: filetype = NC_FORMAT_NETCDF4_CLASSIC, 0 groups ...
+% ncks -M foo_3.nc
+Summary of foo_3.nc: filetype = NC_FORMAT_CLASSIC, 0 groups ...
+% ncks -M foo_6.nc
+Summary of foo_6.nc: filetype = NC_FORMAT_64BIT_OFFSET, 0 groups ...
+% ncks -M foo_5.nc
+Summary of foo_5.nc: filetype = NC_FORMAT_CDF5, 0 groups ...
+% ncks -M foo_7.nc
+Summary of foo_7.nc: filetype = NC_FORMAT_NETCDF4_CLASSIC, 0 groups ...
 % ncks -M foo_4.nc
 Summary of foo_4.nc: filetype = NC_FORMAT_NETCDF4, 0 groups ...
 @end example
@@ -3743,24 +3758,24 @@ This method requires a netCDF4-enabled @acronym{NCO} version 3.9.0+
 (i.e., from 2007 or later).
 @cindex extended file format
 @cindex underlying file format
- at cindex @code{NC_FORMAT_NC3}
- at cindex @code{NC_FORMAT_NC_HDF5}
- at cindex @code{NC_FORMAT_NC_HDF4}
- at cindex @code{NC_FORMAT_PNETCDF}
- at cindex @code{NC_FORMAT_DAP2}
- at cindex @code{NC_FORMAT_DAP4}
+ at cindex @code{NC_FORMATX_NC3}
+ at cindex @code{NC_FORMATX_NC_HDF5}
+ at cindex @code{NC_FORMATX_NC_HDF4}
+ at cindex @code{NC_FORMATX_PNETCDF}
+ at cindex @code{NC_FORMATX_DAP2}
+ at cindex @code{NC_FORMATX_DAP4}
 As of @acronym{NCO} version 4.4.0 (January, 2014), @command{ncks} will
 also print the extended or underlying format of the input file.
 The extended filetype will be one of the six underlying formats that
 are accessible through the netCDF @acronym{API}.
 These formats are
- at code{NC_FORMAT_NC3} (classic and 64-bit versions of netCDF3 formats),
- at code{NC_FORMAT_NC_HDF5} (classic and extended versions of netCDF4, and
+ at code{NC_FORMATX_NC3} (classic and 64-bit versions of netCDF3 formats),
+ at code{NC_FORMATX_NC_HDF5} (classic and extended versions of netCDF4, and
 ``pure'' HDF5 format),
- at code{NC_FORMAT_NC_HDF4} (HDF4 format),
- at code{NC_FORMAT_PNETCDF} (PnetCDF format),
- at code{NC_FORMAT_DAP2} (accessed via DAP2 protocol), and
- at code{NC_FORMAT_DAP4} (accessed via DAP2 protocol).
+ at code{NC_FORMATX_NC_HDF4} (HDF4 format),
+ at code{NC_FORMATX_PNETCDF} (PnetCDF format),
+ at code{NC_FORMATX_DAP2} (accessed via DAP2 protocol), and
+ at code{NC_FORMATX_DAP4} (accessed via DAP4 protocol).
 For example,
 @example
 % ncks -D 2 -M hdf.hdf
@@ -3769,7 +3784,7 @@ Summary of hdf.hdf: filetype = NC_FORMAT_NETCDF4 (representation of \
 % ncks -D 2 -M http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc
 Summary of http://thredds-test.ucar.edu/thredds/dodsC/testdods/in.nc: \
   filetype = NC_FORMAT_CLASSIC (representation of extended/underlying \
-  filetype NC_FORMAT_DAP2), 0 groups  
+  filetype NC_FORMATX_DAP2), 0 groups  
 % ncks -D 2 -M foo_4.nc
 Summary of foo_4.nc: filetype = NC_FORMAT_NETCDF4 (representation of \
   extended/underlying filetype NC_FORMAT_HDF5), 0 groups  
@@ -3780,11 +3795,13 @@ has to alter the file.
 Second, query the file with @samp{ncdump -k}:
 @cindex @command{ncdump} 
 @example
-% ncdump -k foo_3c.nc
+% ncdump -k foo_3.nc
 classic
-% ncdump -k foo_364.nc
-64-bit-offset
-% ncdump -k foo_4c.nc
+% ncdump -k foo_6.nc
+64-bit offset
+% ncdump -k foo_5.nc
+cdf5
+% ncdump -k foo_7.nc
 netCDF-4 classic model
 % ncdump -k foo_4.nc
 netCDF-4
@@ -3797,11 +3814,13 @@ command:
 @cindex @command{od} 
 @cindex octal dump
 @example
-% od -An -c -N4 foo_3c.nc
+% od -An -c -N4 foo_3.nc
    C   D   F 001
-% od -An -c -N4 foo_364.nc
+% od -An -c -N4 foo_6.nc
    C   D   F 002
-% od -An -c -N4 foo_4c.nc
+% od -An -c -N4 foo_5.nc
+   C   D   F 005
+% od -An -c -N4 foo_7.nc
  211   H   D   F
 % od -An -c -N4 foo_4.nc
  211   H   D   F
@@ -3822,32 +3841,37 @@ Let us demonstrate converting a file from any netCDF-supported
 input format into any netCDF output format (subject to limits of the
 output format).  
 Here the input file @file{in.nc} may be in any of these formats:
-netCDF3 (classic and 64bit), netCDF4 (classic and extended), HDF4, HDF5,
-HDF-EOS (version 2 or 5), and DAP. 
+netCDF3 (classic, 64bit_offset, 64bit_data), netCDF4 (classic and
+extended), HDF4, HDF5, HDF-EOS (version 2 or 5), and DAP. 
 The switch determines the output format written in the comment:
 @footnote{The switches @samp{-5}, @samp{--5}, and @samp{pnetcdf} are
-reserved for PnetCDF files, i.e., @code{NC_FORMAT_PNETCDF}.
+reserved for PnetCDF files, i.e., @code{NC_FORMAT_CDF5}.
 Such files are similar to netCDF3 classic files, yet also support
 64-bit offsets and the additional netCDF4 atomic types.}
 @example
-ncks --fl_fmt=classic in.nc foo_3c.nc # netCDF3 classic
-ncks --fl_fmt=64bit in.nc foo_364.nc # netCDF3 64bit
-ncks --fl_fmt=netcdf4_classic in.nc foo_4c.nc # netCDF4 classic
+ncks --fl_fmt=classic in.nc foo_3.nc # netCDF3 classic
+ncks --fl_fmt=64bit_offset in.nc foo_6.nc # netCDF3 64bit-offset
+ncks --fl_fmt=64bit_data in.nc foo_5.nc # netCDF3 64bit-data
+ncks --fl_fmt=cdf5 in.nc foo_5.nc # netCDF3 64bit-data
+ncks --fl_fmt=netcdf4_classic in.nc foo_7.nc # netCDF4 classic
 ncks --fl_fmt=netcdf4 in.nc foo_4.nc # netCDF4 
-ncks -3 in.nc foo_3c.nc # netCDF3 classic
-ncks --3 in.nc foo_3c.nc # netCDF3 classic
-ncks -6 in.nc foo_364.nc # netCDF3 64bit
-ncks --64 in.nc foo_364.nc # netCDF3 64bit
+ncks -3 in.nc foo_3.nc # netCDF3 classic
+ncks --3 in.nc foo_3.nc # netCDF3 classic
+ncks -6 in.nc foo_6.nc # netCDF3 64bit-offset
+ncks --64 in.nc foo_6.nc # netCDF3 64bit-offset
+ncks -5 in.nc foo_5.nc # netCDF3 64bit-data
+ncks --5 in.nc foo_5.nc # netCDF3 64bit-data
 ncks -4 in.nc foo_4.nc # netCDF4 
 ncks --4 in.nc foo_4.nc # netCDF4 
-ncks -7 in.nc foo_4c.nc # netCDF4 classic
-ncks --7 in.nc foo_4c.nc # netCDF4 classic
+ncks -7 in.nc foo_7.nc # netCDF4 classic
+ncks --7 in.nc foo_7.nc # netCDF4 classic
 @end example
 Of course since most operators support these switches, the
 ``conversions'' can be done at the output stage of arithmetic
 or metadata processing rather than requiring a separate step.
-Producing (netCDF3) @code{CLASSIC} or @code{64BIT} files from
- at code{NETCDF4_CLASSIC} files will always work. 
+Producing (netCDF3) @code{CLASSIC} or @code{64BIT_OFFSET} or
+ at code{64BIT_DATA} files from @code{NETCDF4_CLASSIC} files always 
+works.  
 
 @html
 <a name="autoconversion"></a> <!-- http://nco.sf.net/nco.html#autoconversion -->
@@ -3890,7 +3914,7 @@ Three numeric types (@code{NC_UINT}, @code{NC_UINT64} and
 @code{NC_INT64}) are @emph{demoted}.
 Since the input range is larger than the output range, demotion can
 result in numeric truncation and thus loss of data. 
-In such cases, it would possible to convert the data to floating point
+In such cases, it would possible to convert the data to floating-point
 values instead. 
 If this feature interests you, please be the squeaky wheel and let us
 know.
@@ -5212,7 +5236,7 @@ ncks -F -d lon,1.0,2.0 in.nc out.nc
 # Every other longitude value between 0 and 90 degrees
 ncks -F -d lon,0.0,90.0,2 in.nc out.nc
 @end example
-As shown, we recommend using a full floating point suffix of @code{.0}
+As shown, we recommend using a full floating-point suffix of @code{.0}
 instead of simply @code{.} in order to make obvious the selection of
 hyperslab elements based on coordinate value rather than index.
 
@@ -5490,7 +5514,7 @@ used in @w{Step 1} above.
 
 The new @acronym{SSC} option aggregates more than one input record at a time
 before performing arithmetic operations, and, with an additional
-switch, allows us to archive those results in multiple record output
+switch, allows us to archive those results in multiple-record output
 (MRO) files.  
 This reduces the task of producing the climatological summertime
 mean to one step:
@@ -5934,7 +5958,7 @@ multi-slabs of regular coordinates.
 @example
 ncra -O -X 0.,180.,-30.,30. -X 270.,315.,45.,90. in.nc out.nc
 @end example
-The arguments to @samp{-X} are always interpreted as floating point
+The arguments to @samp{-X} are always interpreted as floating-point
 numbers, i.e., as coordinate values rather than dimension indices
 so that these two commands produce identical results
 @example
@@ -6333,7 +6357,7 @@ Currently @acronym{NCO} understands only the mapfile format pioneered by
 (@url{http://oceans11.lanl.gov/svn/SCRIP/trunk/SCRIP})
 and later extended by @acronym{ESMF} 
 (@uref{http://www.earthsystemcog.org/projects/regridweightgen}),
-and adopted by Tempest
+and adopted (along with Exodus) by Tempest
 (@uref{https://github.com/ClimateGlobalChange/tempestremap.git}).
 See those references for documentation on map formats, grid
 specification, and weight generation. 
@@ -6393,9 +6417,9 @@ planned.
 @cindex @code{--rnr}
 @cindex @code{--renormalize}
 @cindex @code{--rgr_rnr}
-First-order-accurate data regridding is a straightforward procedure of 
-identifying gridcell overlap and apportioning values correctly
-from source to destination.
+Conservative regridding is, for first-order accurate algorithms,
+a straightforward procedure of identifying gridcell overlap and
+apportioning values correctly from source to destination.
 The presence of missing values forces a decision on how to handle
 destination gridcells where some but not all source cells are valid. 
 @acronym{NCO} allows the user to choose between two distinct algorithms:
@@ -6450,7 +6474,25 @@ of the destination gridcell to meet the threshold for a non-missing
 destination value. 
 For a valid destination area of, say 25%, the renormalized algorithm
 produces a destination value four-times greater than the conservative
-algorithm.  
+algorithm.
+
+In practice, it may make sense to use the default ``conservative''
+algorithm when performing conservative regridding, and the
+``renormalized'' algorithm when performing other regridding such as
+bilinear interpolation or nearest-neighbor.
+Another consideration is whether the fields being regridded are fluxes
+or state variables. 
+For example, temperature (unlike heat) or concentrations (amount per
+unit volume) are not physically conserved quantities under
+areal-regridding so it often makes sense to interpolate them in a
+non-conservative fashion, to preserve their fine-scale structure. 
+Few researchers can digest the unphysical values of temperature that the  
+``conservative'' option will produce in regions rife with missing
+values.
+A counter-example is fluxes, which should be physically conserved under 
+areal-regridding.
+One should consider both the type of field and its conservation
+properties before choosing a regridding strategy.
 
 @acronym{NCO} automatically annotates the output with relevant metadata
 such as coordinate bounds, axes, and vertices (@w{@`{a} la} @acronym{CF}). 
@@ -7780,7 +7822,7 @@ Packed data also can also be deflated for additional space savings.
 A limitation of packing is that unpacking data stored as integers
 into the linear range defined by @code{scale_factor} and
 @code{add_offset} rapidly loses precision outside of a narrow range of
-floating point values.  
+floating-point values.  
 Variables packed as @code{NC_SHORT}, for example, can represent only
 about 64000 discrete values in the range 
 @math{-32768*scale_factor+add_offset} to
@@ -7839,9 +7881,9 @@ intrinsic characteristics and, in addition, the units of storage.
 This is the fundamental difference between the @acronym{NSD} and 
 @acronym{DSD} approaches. 
 The eight-hundred pound gorilla always has @math{@var{nsd=1}} regardless 
-of whether the value is store in pounds or in some other unit.
+of whether the value is stored in pounds or in some other unit.
 @acronym{DSD} corresponding to this weight is @math{@var{dsd=-2}} if the
-value is store in pounds, @math{@var{dsd=4}} if stored in megapounds.
+value is stored in pounds, @math{@var{dsd=4}} if stored in megapounds.
 
 Users may wish to express the precision to be preserved as either
 @acronym{NSD} or @acronym{DSD}.
@@ -7895,13 +7937,13 @@ when more precision is requested.
 The time-penalty for compressing and uncompressing data varies according 
 to the algorithm.
 The Number of Significant Digit (@acronym{NSD}) algorithm quantizes by
-bitmasking, and employs no floating point math.
+bitmasking, and employs no floating-point math.
 The Decimal Significant Digit (@acronym{DSD}) algorithm quantizes by
-rounding, which does require floating point math.
+rounding, which does require floating-point math.
 Hence @acronym{NSD} is likely faster than @acronym{DSD}, though
 the difference has not been measured.
 @acronym{NSD} creates a bitmask to alter the @dfn{significand} of
- at w{@acronym{IEEE} 754} floating point data.
+ at w{@acronym{IEEE} 754} floating-point data.
 The bitmask is one for all bits to be retained and zero or one for all
 bits to be ignored.
 The algorithm assumes that the number of binary digits (i.e., bits)
@@ -8029,7 +8071,7 @@ fashion when processing array data.
 In general, the first element is rounded down, the second up, and so
 on. 
 This results in a mean bias quite close to zero.
-The only exception is that the floating point value of zero is never 
+The only exception is that the floating-point value of zero is never 
 quantized upwards.
 For simplicity, @acronym{NSD} always rounds scalars downwards.
 
@@ -8100,7 +8142,7 @@ in the attribute @code{least_significant_digit} and @acronym{NCO}
 does the same for consistency.
 The Unidata blog 
 @uref{http://www.unidata.ucar.edu/blogs/developer/en/entry/compression_by_bit_shaving,  
-here} also shows how to compress @acronym{IEEE} floating point data by
+here} also shows how to compress @acronym{IEEE} floating-point data by
 zeroing insignificant bits.
 The author, John Caron, writes that the technique has been called
 ``bit-shaving''.
@@ -8148,7 +8190,7 @@ on-disk storage reduction only occurs once the data are compressed.
 @end html
 How can one be sure the lossy data are sufficiently precise?
 @acronym{PPC} preserves all significant digits of every value.
-The @acronym{DSD} algorithm uses floating point math to round each 
+The @acronym{DSD} algorithm uses floating-point math to round each 
 value optimally so that it has the maximum number of zeroed bits
 that preserve the specified precision.
 The @acronym{NSD} algorithm uses a theoretical approach (3.2 bits per
@@ -8436,7 +8478,7 @@ This table summarizes the performance of lossless and lossy compression
 on two typical, or at least random, netCDF data files.  
 The files were taken from representative model-simulated and
 satellite-retrieved datasets.
-Only floating point data were compressed.
+Only floating-point data were compressed.
 No attempt was made to compress integer-type variables as they occupy an 
 insignificant fraction of every dataset.
 The columns are
@@ -8462,7 +8504,7 @@ Number of significant digits retained by the precision-preserving
 compression @acronym{NSD} algorithm.  
 @item Pck 
 @kbd{Y} if the default @command{ncpdq} packing algorithm (convert
-floating point types to @code{NC_SHORT}) was employed.
+floating-point types to @code{NC_SHORT}) was employed.
 @item Size
 Resulting filesize in @acronym{MB}.
 @item %
@@ -9171,6 +9213,7 @@ Pack and unpack individual variables with @command{ncpdq} and the
 @cindex @code{mibs}
 @cindex @code{rmssdn}
 @cindex @code{rms}
+ at cindex @code{tabs}
 @cindex @code{ttl}
 @cindex @code{sqrt}
 @cindex average
@@ -9208,7 +9251,7 @@ Minimum value
 Maximum absolute value
 @item mebs
 Mean absolute value
- at item mabs
+ at item mibs
 Minimum absolute value
 @item rms
 Root-mean-square (normalized by @var{N})
@@ -9216,6 +9259,8 @@ Root-mean-square (normalized by @var{N})
 Root-mean square (normalized by @var{N-1})
 @item sqrt
 Square root of the mean
+ at item tabs
+Sum of absolute values
 @item ttl
 Sum of values
 @end table
@@ -9349,6 +9394,12 @@ $$
 $$
 Thus the minima and maxima are determined after any weights are applied.
 
+The total absolute value of~$\xxx$ (@code{-y tabs}) is 
+$$
+\bar \xxx_{\jjj} = \sum_{\idx=1}^{\idx=\lmnnbr} \mssflg_{\idx}
+\mskflg_{\idx} \wgt_{\idx} |\xxx_{\idx}|
+$$
+
 The minimum absolute value of~$\xxx$ (@code{-y mibs}) is 
 $$
 \bar \xxx_{\jjj} = \min [ \mssflg_{1} \mskflg_{1} \wgt_{1} |\xxx_{1}|,
@@ -9672,10 +9723,10 @@ Reasons to engage in type conversion include avoiding rounding
 errors and out-of-range limitations of less-precise types.
 This is the case with most integers.
 Thus @acronym{NCO} defaults to automatically promote integer types to
-floating point when performing lengthy arithmetic, yet @acronym{NCO}
+floating-point when performing lengthy arithmetic, yet @acronym{NCO}
 defaults to not promoting single to double-precision floats.
 
-Before discussing the more subtle floating point issues, we first
+Before discussing the more subtle floating-point issues, we first
 examine integer promotion. 
 We will show how following parsimonious conversion rules dogmatically
 can cause problems, and what @acronym{NCO} does about that. 
@@ -9774,7 +9825,7 @@ Truncation rounds @var{x} to the nearest integer not larger in absolute
 value.
 For example, truncation rounds @code{1.0d}, @code{1.5d}, and
 @code{1.8d} to the same value, @code{1s}. 
-Clearly, truncation does not round floating point numbers to the nearest
+Clearly, truncation does not round floating-point numbers to the nearest
 integer! 
 Yet truncation is how the @w{C language} performs implicit conversion of 
 real numbers to integers.
@@ -9912,7 +9963,7 @@ However the intermediate results where running sums are accumulated may
 suffer from too much rounding or from underflow unless computed in
 double-precision. 
 
-The order of operations matters to floating point math even when the
+The order of operations matters to floating-point math even when the
 analytic expressions are equal. 
 Cautious users feel disquieted when results from equally valid analyses
 differ in the final bits instead of agreeing bit-for-bit.
@@ -10123,7 +10174,7 @@ Why are the single-precision numerical artifacts so large?
 Each global average is the result of multiplying almost 15,000 elements
 each by its weight, summing those, and then dividing by the summed 
 weights.  
-Thus about 50,000 single-precision floating point operations caused
+Thus about 50,000 single-precision floating-point operations caused
 the loss of two to three significant digits of precision.
 The net error of a series of independent rounding errors is a random
 walk phenomena
@@ -10222,11 +10273,11 @@ their results.
 
 The @samp{--dbl} and @samp{--flt} switches are only available with the
 @acronym{NCO} arithmetic operators that could potentially perform more
-than a few  single-precision floating point operations per result.
+than a few  single-precision floating-point operations per result.
 These are @command{nces}, @command{ncra}, and @command{ncwa}.
 Each is capable of thousands to millions or more operations per result. 
 By contrast, the arithmetic operators @command{ncbo} and
- at command{ncflint} perform at most one floating point operation per
+ at command{ncflint} perform at most one floating-point operation per
 result. 
 Providing the @samp{--dbl} option for such trivial operations makes 
 little sense, so the option is not currently made available.
@@ -11489,7 +11540,7 @@ template variable @code{var_tpl}, i.e., a variable with the same shape
 as the desired output. 
 The type of @code{var_out} will be the same as @code{val_srt}.
 Be sure to encode this type with the appropriate decimal point
-and floating point suffix when @code{val_srt} is a ``naked constant''
+and floating-point suffix when @code{val_srt} is a ``naked constant''
 rather than a variable.
 For example, to produce an array of shorts (signed two-byte integers), 
 integers (signed four-byte integers), unsigned 64-bit integers,
@@ -11728,8 +11779,6 @@ sng_arr[$sng_len]=a1 at long_name; // sng_arr now contains "Kelvin"
 Attributes defined in a script are stored in memory and are written to Output after script completion.
 To stop the attribute being written use the ram_delete() method or use a bogus variable name.
 
-
-
 @noindent @strong{Attribute Propagation and Inheritance}
 @cindex attribute propagation
 @cindex attribute inheritance
@@ -11764,7 +11813,7 @@ The table below lists the postfix character(s) to add to a number
 literal (aka, a naked constant) for explicit type specification.
 The same type-specification rules are used for variables and
 attributes. 
-A floating point number without a postfix defaults to @code{NC_DOUBLE}, 
+A floating-point number without a postfix defaults to @code{NC_DOUBLE}, 
 while an integer without a postfix defaults to type @code{NC_INT}:
 @example
 @verbatim
@@ -11839,9 +11888,9 @@ filetype is not.
 @item l|L	 
   @code{NC_INT}, a signed 4-byte integer 
 @item f|F	 
-  @code{NC_FLOAT}, a single-precision (4-byte) floating point number 
+  @code{NC_FLOAT}, a single-precision (4-byte) floating-point number 
 @item d|D
-  @code{NC_DOUBLE}, a double-precision (8-byte) floating point number 
+  @code{NC_DOUBLE}, a double-precision (8-byte) floating-point number 
 @item @strong{netCDF4 Types}
 @item ub|UB	 
   @code{NC_UBYTE}, an unsigned 1-byte integer 
@@ -12145,7 +12194,10 @@ Root-mean-square (normalize by @var{N})
 @item rmssdn()
 @cindex rmssdn()
 Root-mean square (normalize by @var{N-1})
- at item ttl() or total()
+ at item tabs() or ttlabs()
+ at cindex tabs()
+Sum of absolute values
+ at item ttl() or total() or sum()
 @cindex ttl()
 Sum of values
 @end table
@@ -12256,10 +12308,10 @@ lat_2D_rrg_new=0,90,-30,30,-30,30,-90,0
  convert to @code{NC_INT},   a signed 4-byte integer 
 @item float()
 @cindex float()	 
- convert to @code{NC_FLOAT}, a single-precision (4-byte) floating point number 
+ convert to @code{NC_FLOAT}, a single-precision (4-byte) floating-point number 
 @item double() 
 @cindex double()
- convert to @code{NC_DOUBLE}, a double-precision (8-byte) floating point number 
+ convert to @code{NC_DOUBLE}, a double-precision (8-byte) floating-point number 
 @item @strong{netCDF4 Types}
 @item ubyte()	 
 @cindex ubyte()
@@ -13143,7 +13195,7 @@ These are the @acronym{GSL} standard function names postfixed with
 function suffix.
 }.
 This allows @acronym{NCO} to return a missing value when the
- at acronym{GSL} library encounters a domain error or a floating point 
+ at acronym{GSL} library encounters a domain error or a floating-point 
 exception. 
 The slow-down due to calling the error-handling version of the 
 @acronym{GSL} numerical functions was found to be negligible (please let
@@ -13687,7 +13739,7 @@ print(yout);  // 3.18545454545 ,9.15636363636, ,12.1418181818 ,33.04
 @node GSL statistics, GSL random number generation, GSL least-squares fitting, ncap2 netCDF Arithmetic Processor
 @subsection GSL statistics
 
- at noindent Wrappers for most of the @acronym{GSL} Statistical functions have been implemented. The @acronym{GSL} function names include a type specifier (except for type double functions). To obtain the equivalent @acronym{NCO} name simply remove the type specifier; then depending on the data type the appropriate @acronym{GSL} function  is called. The weighed statistical functions e.g., @code{ gsl_stats_wvariance()} are only defined in @acronym{GSL} for floating point types; so your data  [...]
+ at noindent Wrappers for most of the @acronym{GSL} Statistical functions have been implemented. The @acronym{GSL} function names include a type specifier (except for type double functions). To obtain the equivalent @acronym{NCO} name simply remove the type specifier; then depending on the data type the appropriate @acronym{GSL} function  is called. The weighed statistical functions e.g., @code{ gsl_stats_wvariance()} are only defined in @acronym{GSL} for floating-point types; so your data  [...]
 
 @noindent @acronym{GSL} Functions
 @example
@@ -14436,7 +14488,7 @@ log$(10.0) = 1.0$
 @end ifinfo
 @item nearbyint(x)
 @dfn{Round inexactly}
-Nearest integer to @var{x} is returned in floating point format.
+Nearest integer to @var{x} is returned in floating-point format.
 @cindex inexact conversion
 No exceptions are raised for @dfn{inexact conversions}.
 Example: 
@@ -14464,7 +14516,7 @@ pow$(2,3) = 8$
 @end ifinfo
 @item rint(x)
 @dfn{Round exactly}
-Nearest integer to @var{x} is returned in floating point format.
+Nearest integer to @var{x} is returned in floating-point format.
 Exceptions are raised for @dfn{inexact conversions}.
 Example: 
 @tex
@@ -14475,7 +14527,7 @@ rint$(0.1) = 0$
 @end ifinfo
 @item round(x)
 @dfn{Round}
-Nearest integer to @var{x} is returned in floating point format.
+Nearest integer to @var{x} is returned in floating-point format.
 Round halfway cases away from zero, regardless of current @acronym{IEEE}
 rounding direction.  
 Example: 
@@ -14543,7 +14595,7 @@ tanh$(1.0) = 0.761594155956$
 @end ifinfo
 @item trunc(x)
 @dfn{Truncate}
-Nearest integer to @var{x} is returned in floating point format.
+Nearest integer to @var{x} is returned in floating-point format.
 Round halfway cases toward zero, regardless of current @acronym{IEEE}
 rounding direction.  
 Example: 
@@ -14782,7 +14834,7 @@ as swiftly as possible.
 @cindex @code{_FillValue}
 When @command{ncatted} is used to change the @code{_FillValue} attribute,
 it changes the associated missing data self-consistently.
-If the internal floating point representation of a missing value, 
+If the internal floating-point representation of a missing value, 
 e.g., 1.0e36, differs between two machines then netCDF files produced 
 on those machines will have incompatible missing values.
 This allows @command{ncatted} to change the missing values in files from 
@@ -14935,7 +14987,7 @@ type @code{NC_FLOAT}.
 Value(s) specified in @var{att_val} will be stored as netCDF intrinsic
 type @code{NC_DOUBLE}.
 @item i, l
- at dfn{Integer} or @dfn{Long}.
+ at dfn{Integer} or (its now deprecated synonym) @dfn{Long}.
 Value(s) specified in @var{att_val} will be stored as netCDF intrinsic
 type @code{NC_INT}.
 @item s
@@ -15099,6 +15151,7 @@ ncatted -a long_name,T,o,c,temperature in.nc
 
 @html
 <a name="NaN"></a> <!-- http://nco.sf.net/nco.html#NaN -->
+<a name="nan"></a> <!-- http://nco.sf.net/nco.html#nan -->
 @end html
 @cindex NaN
 @cindex @acronym{IEEE} NaN
@@ -15128,6 +15181,12 @@ missing value was).
 @example
 ncatted -a _FillValue,,m,f,1.0e36 in.nc
 @end example
+Some @acronym{NASA} @acronym{MODIS} datasets provide a real-world
+example. 
+ at example
+ncatted -O -a _FillValue,,m,d,1.0e36 -a missing_value,,m,d,1.0e36 \
+        MODIS_L2N_20140304T1120.nc MODIS_L2N_20140304T1120_noNaN.nc
+ at end example
 
 Delete all existing @code{units} attributes:
 @example
@@ -18541,10 +18600,11 @@ ncrcat -d time,6.,54. ??.nc 8506_8906.nc
 SYNTAX
 @example
 ncremap [-a @var{alg_typ}] [-D @var{dbg_lvl}] [-d @var{dst_fl}] [-E @var{esmf_opt}]
-[-G @var{grd_sng}] [-g @var{grd_dst}] [-I @var{drc_in}] [-i @var{input-file}]
+[-G @var{grd_sng}] [-g @var{grd_dst}] [-I @var{drc_in}] [-i @var{input-file}] [-j @var{job_nbr}]
 [-M] [-m @var{map_fl}] [-n @var{nco_opt}] [-O @var{drc_out}] [-o @var{output-file}]
-[-p @var{par_typ}] [-R @var{rgr_opt}] [-s @var{grd_src}] [-T @var{tempest_opt}] [-t @var{thr_nbr}]
-[-v @var{var_lst}[, at dots{}]] [-w @var{wgt_gnr}] [-x @var{xtn_lst}[, at dots{}]] 
+[-P @var{pdq_typ}] [-p @var{par_typ}] [-R @var{rgr_opt}] [-s @var{grd_src}] 
+[-T @var{tempest_opt}] [-t @var{thr_nbr}] [-v @var{var_lst}[, at dots{}]] 
+[-w @var{wgt_gnr}] [-x @var{xtn_lst}[, at dots{}]] 
 @end example
 
 @noindent
@@ -18554,15 +18614,17 @@ DESCRIPTION
 @var{drc_in}, or piped through standard input, to the grid specified by 
 (in descending order of precedence) @var{map_fl}, @var{grd_dst}, or
 @var{dst_fl} and stores the result in @var{output-file}(s). 
+When no @var{input-file} is provided, @command{ncremap} operates in
+``map-only'' mode where it exits after producing an annotated map-file. 
 @command{ncremap} was introduced to @acronym{NCO} in version 4.5.4
 (December, 2015). 
-As the newest operator, its interface is still evolving to respond to
-user needs, feedback, and new features.
+As the newest operator, its interface is evolving in response to user
+needs, feedback, and new features. 
 @command{ncremap} orchestrates the regridding features of several
 different programs.
-Under the hood, @acronym{NCO} generates and infers grids, and calls
-external programs to generate the remapping weights that @acronym{NCO}
-then applies.  
+Under the hood @acronym{NCO} applies pre-computed remapping weights or, 
+when necessary, generates and infers grids, and calls external programs
+to generate the remapping weights that @acronym{NCO} then applies.  
 
 @cindex @command{ncremap}
 @cindex @command{ESMF_RegridWeightGen}
@@ -18585,6 +18647,9 @@ or Unstructured Data (@acronym{CRUD}) grid.
 TempestRemap's
 @command{GenerateOverlapMesh}/@command{GenerateOfflineMap}) to
 generate weights and mapfiles.
+In order to use the weight-generation options, ensure that one or both
+of the weight-generation packages is installed and on your
+ at code{$PATH}. 
 @acronym{ERWG} is distributed in binary format with @acronym{NCL}, which
 many (most?) @acronym{NCO} users already have on their system(s). 
 @acronym{ERWG} may also be installed from source:
@@ -18595,6 +18660,26 @@ TempestRemap,
 Please contact those projects for support on building and installing
 their software, which makes @command{ncremap} more functional and
 user-friendly.
+Please ensure you have the latest version of @acronym{ERWG} or
+TempestRemap before reporting any related problems to @acronym{NCO}. 
+
+As mentioned above, @command{ncremap} orchestrates the regridding
+features of several different programs.
+ at command{ncremap} runs most quickly when it is supplied with a
+pre-computed mapfile.  
+However, @command{ncremap} will also (call other programs to) compute
+mapfiles when necessary and when given sufficient grid information.
+Thus it is helpful to understand when @command{ncremap} will and will 
+not internally generate a mapfile.
+Supplying input data files and a pre-computed mapfile @emph{without}
+any other grid information causes @command{ncremap} to regrid the data
+files without first pausing to internally generate a mapfile.
+On the other hand, supplying any grid information (i.e., using any of
+the @samp{-d}, @samp{-G}, @samp{-g}, or @samp{-s} switches described
+below), causes @command{ncremap} to internally (re-)generate the
+mapfile by combining the supplied and inferred grid information.
+A generated mapfile is given a default name unless a user-specified name
+is supplied with @samp{-m @var{map_fl}}. 
 
 @unnumberedsubsec Options specific to @command{ncremap}
 
@@ -18618,7 +18703,7 @@ are more frequently change by users than other @acronym{ERWG} options
 (that can be changed with @samp{-E @var{esmf_opt}}).
 The @var{alg_typ} argument must be one of @acronym{ERWG}'s five
 interpolation algorithms: 
- at code{bilinear} (default, acceptable abbreviations are @code{bln}), 
+ at code{bilinear} (default, acceptable abbreviation is @code{bln}), 
 @code{conserve} (or @code{conservative} or @code{cns}), 
 @code{nearestdtos} (or @code{nds} or @code{dtos}), 
 @code{neareststod} (or @code{nds} or @code{stod}), 
@@ -18656,9 +18741,12 @@ Currently @var{dst_fl} must be a data file (not a gridfile,
 infer the destination grid. 
 The more coordinate and boundary information and metadata 
 the better @acronym{NCO} will do at inferring the grid.
-If @var{dst_fl} has only cell-center coordinates (and no edges),
-then @acronym{NCO} will guess-at or interpolate the edges.
 If @var{dst_fl} has cell boundaries then @acronym{NCO} will use those.
+If @var{dst_fl} has only cell-center coordinates (and no edges),
+then @acronym{NCO} will guess-at (for rectangular grids) or interpolate
+(for curvilinear grids) the edges. 
+Unstructured grids must supply cell boundary information, as it cannot
+be interpolated or guessed-at.
 @acronym{NCO} only reads coordinate and grid data and metadata from
 @var{dst_fl}. 
 @var{dst_fl} is not modified, and may have read-only permissions.
@@ -18715,6 +18803,7 @@ and inspecting the results.
 @end html
 @cindex @code{-I @var{in_drc}}
 @cindex @var{in_drc}
+ at cindex @code{stdin}
 @item -I @var{in_drc}
 Specifies the input directory, i.e., the directory which contains
 the input file(s).
@@ -18729,8 +18818,8 @@ When multiple files are regridded, each output file takes the name
 of the corresponding input file.
 There is no namespace conflict because the input and output files are in
 separate directories. 
-Note that @command{ncremap} could instead take the list of multiple 
-input piped through standard input, e.g., @samp{ls *.nc | ncremap ...}.
+Note that @command{ncremap} can instead accept the list of input files
+through standard input, e.g., @samp{ls *.nc | ncremap ...}. 
 
 @html
 <a name="in_fl"></a> <!-- http://nco.sf.net/nco.html#in_fl -->
@@ -18740,19 +18829,74 @@ input piped through standard input, e.g., @samp{ls *.nc | ncremap ...}.
 @item -i @var{in_fl}
 Specifies the file containing data on the source grid to be remapped
 to the destination grid.
-Currently @var{in_fl} must be a data file (not a gridfile,
- at acronym{SCRIP} or otherwise).
 When provided with the optional @var{map_fl}, @command{ncremap} 
 only reads data from @var{in_fl} in order to regrid it.
-Without the optional @var{map_fl}, @command{ncremap} must infer the
-source grid from @var{in_fl}, and so must read coordinate and metatdata
-information from @var{in_fl}.  
+Without the optional @var{map_fl} or @var{src_grd}, @command{ncremap}
+will try to infer the source grid from @var{in_fl}, and so must read
+coordinate and metatdata information from @var{in_fl}.  
 In this case the more coordinate and boundary information and metadata,
 the better @acronym{NCO} will do at inferring the source grid.
-If @var{in_fl} has only cell-center coordinates (and no edges),
-then @acronym{NCO} guess at or interpolate the edges.
 If @var{in_fl} has cell boundaries then @acronym{NCO} will use those. 
+If @var{in_fl} has only cell-center coordinates (and no edges),
+then @acronym{NCO} will guess (for rectangular grids) or interpolate
+(for curvilinear grids) the edges.  
+Unstructured grids must supply cell boundary information, as it cannot
+be interpolated or guessed-at.
 @var{in_fl} is not modified, and may have read-only permissions.
+Note that @command{ncremap} can instead accept the input file name
+through standard input, e.g., @samp{ls *.nc | ncremap ...}. 
+
+ at html
+<a name="job_nbr"></a> <!-- http://nco.sf.net/nco.html#job_nbr -->
+ at end html
+ at cindex @code{-j @var{job_nbr}}
+ at cindex @var{job_nbr}
+ at item -j @var{job_nbr}
+Specifies the number of simultaneous regridding processes to spawn  
+during parallel execution for both Background and @acronym{MPI} modes. 
+In both parallel modes @command{ncremap} spawns proceses in batches 
+of @var{job_nbr} jobs, thens waits for those processes to complete.
+Once a batch finishes, @command{ncremap} spawns the next batch.
+In Background mode, all jobs are spawned to the local node.
+In @acronym{MPI} mode, all jobs are spawned in round-robin fashion
+to all available nodes until @var{job_nbr} jobs are running.
+
+If regridding consumes so much @acronym{RAM} (e.g., because
+variables are large and/or the number of threads is large) that a
+single node can perform only one regridding job at a time, then a
+reasonable value for @var{job_nbr} is the number of nodes,
+ at var{node_nbr}. 
+Often, however, nodes can regrid multiple files simultaneously. 
+It can be more efficient to spawn multiple jobs per node than to
+increase the threading per job because I/O contention for write
+access to a single file prevents threading from scaling indefinitely. 
+
+By default @math{@var{job_nbr} = 2} in Background mode, and
+ at math{@var{job_nbr} = @var{node_nbr}} in @acronym{MPI} mode.
+This helps prevent users from overloading nodes with too many jobs.
+Subject to the availability of adequate @acronym{RAM},
+expand the number of jobs per node by increasing @var{job_nbr}
+until, ideally, each core on the node is used. 
+Remember that processes and threading are multiplicative in core use.
+Four jobs each with four threads consumes sixteen cores.
+
+As an example, consider regridding 100 files with a single map.
+Say you have a five-node cluster, and each node has @w{16 cores}
+and can simultaneously regrid two files using eight threads each.
+(One usually needs to test a bit to determine these parameters.)
+Then an optimal (in terms of wallclock time) way to regrid would
+be requesting five nodes with 10 simultaneous jobs of eight threads.
+On many batch systems this would involve a scheduler command like 
+this @samp{qsub -l nodes=5 ...} followed by 
+ at samp{ncremap -p mpi -j 10 -t 8 ...}.
+This job will likely complete between five and ten-times faster than a 
+serial invocation of @command{ncremap}.
+The uncertainty range is due to unforeseeable, system-dependent
+load and I/O charateristics.
+Nodes that can simultaneously write to more than one file fare better
+with multiple jobs per node.
+Nodes with only one I/O channel to disk may be better exploited
+by utilizing more threads per process.
 
 @html
 <a name="map_fl"></a> <!-- http://nco.sf.net/nco.html#map_fl -->
@@ -18760,14 +18904,28 @@ If @var{in_fl} has cell boundaries then @acronym{NCO} will use those.
 @cindex @code{-m @var{map_fl}}
 @cindex @var{map_fl}
 @item -m @var{map_fl}
-Specifies a pre-computed mapfile to remap the source to destination grid.
-The @var{map_fl} must be in @acronym{SCRIP} format, although it may have
-been produced by any application (usually @acronym{ERWG} or
-TempestRemap). 
+Specifies a mapfile (i.e., weight-file) to remap the source to
+destination grid. 
+If @var{map_fl} is specified in conjunction with any of the @samp{-d},
+ at samp{-G}, @samp{-g}, or @samp{-s} switches, then @command{ncremap}
+will name the internally generated mapfile @var{map_fl}.
+Otherwise (i.e., if none of the source-grid switches are used),
+ at command{ncremap} assumes that @var{map_fl} is a pre-computed mapfile. 
+In that case, the @var{map_fl} must be in @acronym{SCRIP} format,
+although it may have been produced by any application (usually
+ at acronym{ERWG} or TempestRemap). 
 If @var{map_fl} has only cell-center coordinates (and no edges),
 then @acronym{NCO} will guess-at or interpolate the edges.
 If @var{map_fl} has cell boundaries then @acronym{NCO} will use those.
- at var{map_fl} is not modified, and may have read-only permissions.
+A pre-computed @var{map_fl} is not modified, and may have read-only
+permissions. 
+The user will be prompted to confirm if a newly generated map-file  
+named @var{map_fl} would overwrite an existing file.
+ at command{ncremap} adds provenance information to any newly generated
+map-file whose name was specified with @samp{-m @var{map_fl}}.
+This provenance includes a @code{history} attribute that contains
+the command invoking @command{ncremap}, and the map-generating command
+invoked by @command{ncremap}.
 
 @html
 <a name="map_mlt"></a> <!-- http://nco.sf.net/nco.html#map_mlt -->
@@ -18828,13 +18986,34 @@ using @samp{-I @var{in_drc}} or standard input) generates an error
 (output files will be named the same as input files).
 
 @html
+<a name="pdq_typ"></a> <!-- http://nco.sf.net/nco.html#pdq_typ -->
+ at end html
+ at cindex @code{-P @var{pdq_typ}}
+ at cindex @var{pdq_typ}
+ at item -P @var{pdq_typ}
+Specifies the permutation mode desired.
+As of January 15, 2016, one can tell @command{ncremap} to automatically
+tagpermute the dimensions in the data file prior to regridding for a
+limited (though growning) number of data-file types that suffer from
+the @command{ncremap} limitation concerning dimension ordering.
+Valid types are @samp{airs} (for @acronym{NASA AIRS} satellite data), 
+ at samp{mpas} (for @acronym{MPAS} ocean/ice model data), and @samp{nil} (for none).
+The default @var{pdq_typ} is @samp{nil}, which means @command{ncremap} 
+does not permute the dimension order prior to regridding.
+In @acronym{AIRS}-mode, @command{ncremap} calls @command{ncpdq} to
+permute dimensions from their order in the input file to this order:
+ at code{StdPressureLev,GeoTrack,GeoXTrack}.
+In @acronym{MPAS}-mode the order is 
+ at code{Time,nVertLevels,maxEdges,MaxEdges2,nEdges,nCells}. 
+
+ at html
 <a name="par_typ"></a> <!-- http://nco.sf.net/nco.html#par_typ -->
 @end html
 @cindex @code{-p @var{par_typ}}
 @cindex @var{par_typ}
 @item -p @var{par_typ}
 Specifies the parallelism mode desired.
-Parallelism accelerate throughput when regridding multiple files in one 
+Parallelism accelerates throughput when regridding multiple files in one  
 @command{ncremap} invocation.
 Valid types are @samp{bck} (for Background mode), 
 @samp{mpi} (for @acronym{MPI} mode), and @samp{nil} (for none).
@@ -18904,6 +19083,13 @@ contents, which are currently empty.
 For example, to cause @command{GenerateOfflineMap} to use a
 @code{_FillValue} of @math{-1}, pass 
 @samp{-T "--fillvalue -1.0"} to @command{ncremap}.
+Other common options include enforcing monotonicity (which is not the
+default in TempestRemap) constraints. 
+To guarantee monotonicity in regridding from Finite Volume @acronym{FV} 
+to @acronym{FV} maps (e.g., @acronym{MPAS}-to-rectangular), pass 
+ at samp{-T "-in_np 1"} to @command{ncremap}.
+To guarantee monotonicity in regridding from Finite Element @acronym{FE} 
+to @acronym{FV} maps, pass @samp{-T "--mono"}.
 
 @html
 <a name="thr_nbr"></a> <!-- http://nco.sf.net/nco.html#thr_nbr -->
@@ -18953,7 +19139,7 @@ Support for extensive variables during regridding is nascent.
 Currently variables marked as extensive are summed, not regridded.
 @end table
 
- at unnumberedsubsec Limitatations to @command{ncremap}
+ at unnumberedsubsec Limitations to @command{ncremap}
 
 There are three significant limitations to @command{ncremap} that we
 hope to remove in the coming year.
@@ -18967,13 +19153,31 @@ to permute the dimensions before (and un-permute them after) regridding.
 For example
 @example
 # AIRS Level2 vertical profiles
-ncpdq -a StdPressureLev,GeoTrack,GeoXTrack AIRS_L2.hdf AIRS_L2.ncpdq.nc
-ncremap -i AIRS_L2.ncpdq.nc -d dst_1x1.nc -O ~/rgr
+ncpdq -a StdPressureLev,GeoTrack,GeoXTrack AIRS_L2.hdf AIRS_L2_ncpdq.nc
+ncremap -i AIRS_L2_ncpdq.nc -d dst_1x1.nc -O ~/rgr
 # MPAS-O fields
 ncpdq -a Time,nVertLevels,maxEdges,MaxEdges2,nEdges,nCells mpas.nc mpas_ncpdq.nc
 ncremap -R "--rgr col_nm=nCells" -i mpas_ncpdq.nc -m mpas120_to_t62.nc -O ~/rgr
 @end example
 @noindent
+The previous two examples occur so frequently that @command{ncremap} has
+been specially equipped to handle @acronym{AIRS} and @acronym{MPAS}
+files. 
+As of 20160115, the following @command{ncremap} commands with @samp{-P}
+switches automagically perform all the required permutation and renaming
+necessary:
+ at example
+# AIRS Level2 vertical profiles
+ncremap -P airs -i AIRS_L2.nc -d dst_1x1.nc -O ~/rgr
+# MPAS-O fields
+ncremap -P mpas -i mpas.nc -m mpas120_to_t62.nc -O ~/rgr
+ at end example
+ at noindent
+The machinery to handle permutations and special options for other
+datafiles is relatively easy to extend. 
+If you work with common datasets that could benefit from their own
+ at command{ncremap} @samp{-P} options, contact us and we will try to
+implement them. 
 
 The second limitation is that @command{ncremap} does not yet follow
 @acronym{CF} conventions to identify coordinate variables.
@@ -18989,11 +19193,11 @@ ncremap -R "--rgr lat_nm=xq --rgr lon_nm=zj" -i in.nc -d dst.nc -O ~/rgr
 @noindent
 
 The third limitation is that @command{ncremap} currently must read
-weights from a mapfile, it cannot compute weights itself in memory.
+weights from an on-disk mapfile, it cannot yet compute weights itself 
+and use them directly from @acronym{RAM}.
 This makes @command{ncremap} an ``offline regridder'' and unnecessarily
-slow compared to a program  an ``integrated regridder'' that computes
-weights and immediately applies them in @acronym{RAM} without any
-map-file.   
+slow compared to an ``integrated regridder'' that computes weights and
+immediately applies them in @acronym{RAM} without any disk-access.
 In practice, the difference is most noticeable when the weights are 
 easily computable ``on the fly'', e.g., rectangular-to-rectangular
 mappings. 
@@ -19005,17 +19209,21 @@ to call @acronym{ERWG} with the options to exploit those capabilities.
 
 A side-effect of @command{ncremap} being an offline regridder is that,
 when necessary, it generates intermediate files to store grids and maps.  
-(No intermediate files are generated when the map-file is provided).
 These files are named, by default, 
 @file{ncremap_tmp_grd_dst.nc},
 @file{ncremap_tmp_grd_src.nc},   
 @file{ncremap_tmp_gnr_out.nc},  
- at file{ncremap_tmp_map_*.nc}, and
- at file{ncremap_tmp_msh_ovr_*.nc}.
+ at file{ncremap_tmp_map_*.nc}, 
+ at file{ncremap_tmp_msh_ovr_*.nc}, and
+ at file{ncremap_tmp_pdq.nc},  
 They are placed in @var{drc_out}, which is the current working directory
 unless otherwise specified.
-Should they proliferate and/or annoy you, locate and/or remove all
-intermediate files under the current directory with 
+No intermediate grid or map files are generated when the map-file is
+provided. 
+No intermediate permuted file is generated unless the 
+ at samp{-P @var{prm_typ}} option is invoked.
+Should intermediate files proliferate and/or annoy you, locate and/or
+remove all such files under the current directory with 
 @example
 find . -name 'ncremap_tmp*'
 rm `find . -name 'ncremap_tmp*'`
@@ -19038,33 +19246,44 @@ Regrid input file @file{in.nc} to the spatial grid in file @file{dst.nc}
 and write the output to @file{out.nc}: 
 @example
 ncremap -i in.nc -d dst.nc -o out.nc
-ncremap -i in.nc -d dst.nc -O regrid
 ncremap -i in.nc -d dst.nc -O regrid -o out.nc
 ncremap -i in.nc -d dst.nc -o regrid/out.nc
+ncremap -i in.nc -d dst.nc -O regrid # output named in.nc
 @end example
 @noindent
 @acronym{NCO} infers the destination spatial grid from @file{dst.nc} by
 reading its coordinate variables and @acronym{CF} attributes.
 In the first example, @command{ncremap} places the output in
 @file{out.nc}.
-In the second example, @command{ncremap} places the output in the
+In the second and third examples, the output file is
+ at file{regrid/out.nc}. 
+In the fourth example, @command{ncremap} places the output in the
 specified output directory.
 Since no output filename is provided, the output file will be named
 @file{regrid/in.nc}.
-In the third and fourth examples, the output file is
- at file{regrid/out.nc}. 
 
-To save time generating weights, use a pre-computed mapfile instead
+Supplying a pre-computed mapfile (with @samp{-m @var{map_fl}})
+considerably reduces wallclock time because it eliminates time-consuming
+weight-generation:
 @example
 ncremap -i in.nc  -m map.nc -o out.nc
 ncremap -I drc_in -m map.nc -O regrid
 @end example
-Supplying the mapfile @var{map_fl} considerably reduces wallclock time. 
-The mapfile file may have been generated by a previous @command{ncremap} 
-invocation. 
+The mapfile is often generated by a previous @command{ncremap}
+invocation, and then stored for later re-use.
 
-To test the remapping workflow, limit regridding to one or a few
-variables instad of remapping the entire file: 
+ at command{ncremap} annotates the gridfiles and mapfiles that it creates
+with helpful metadata containing the full provenance of the command.
+Consequently, @command{ncremap} is a sensible tool for generating
+mapfiles for later use. 
+To generate a mapfile with the specified (non-default) name
+ at file{map.nc}, and then regrid a single file, 
+ at example
+ncremap -i in.nc -d dst.nc -m map.nc -o out.nc
+ at end example
+
+To test the remapping workflow, regrid only one or a few variables
+instead of the entire file:  
 @example
 ncremap -v T,Q,FSNT -i in.nc -m map.nc -o out.nc
 @end example
@@ -19092,10 +19311,10 @@ The second example obtains the input file list from standard input,
 and uses the mapfile and output directory as before.
 
 If multiple input files are on the same grid, yet the mapfile does not
-exist in advance, one can still regrid all the input without suffering
+exist in advance, one can still regrid all input files without incurring
 the time-penalty of generating multiple mapfiles. 
-To do so, one must provide the (known-in-advance) source gridfile or
-toggle the @samp{-M} switch:
+To do so, provide the (known-in-advance) source gridfile or toggle the
+ at samp{-M} switch: 
 @example
 ncremap -M -I drc_in -d dst.nc -O regrid
 ls drc_in/*.nc | ncremap -M -d dst.nc -O regrid
@@ -19122,7 +19341,7 @@ a simulation.
 The most powerful, time-consuming (yet simultaneously time-saving!)
 feature of @command{ncremap} is its ability to regrid multiple input
 files on unique grids.
-Both the input and output can be on any @acronym{CRUD} grid.
+Both input and output can be on any @acronym{CRUD} grid.
 @example
 ncremap -I drc_in -d dst.nc -O regrid
 ls drc_in/*.nc | ncremap -d dst.nc -O regrid
@@ -19141,6 +19360,45 @@ grids.
 These examples require remarkably little input, since @command{ncremap}
 automates most of the work.
 
+Finally, @command{ncremap} uses the parallelization options 
+ at samp{-p @var{par_typ}} and @samp{-j @var{job_nbr}} to help manage
+high-volume workflow. 
+On a single node such as a local workstation, use Background mode
+to regrid multiple files in parallel
+ at example
+ls drc_in/*.nc | ncremap -p bck -d dst.nc -O regrid
+ls drc_in/*.nc | ncremap -p bck -j 4 -d dst.nc -O regrid
+ at end example
+ at noindent
+Both examples will eventually regrid all input files.
+The first example regrids two at a time because two is the default
+batch size @command{ncremap} employs.
+The second example regrids files in batches of four at a time.
+Increasing @var{job_nbr} will increase throughput so long as the node
+is not I/O-limited.
+
+Multi-node clusters can exploit inter-node parallelism in
+ at acronym{MPI}-mode:
+ at example
+qsub -I -A CLI115 -V -l nodes=4 -l walltime=03:00:00 -N ncremap
+ls drc_in/*.nc | ncremap -p mpi -j 4 -d dst.nc -O regrid
+ at end example
+ at noindent
+This example shows a typical request for four compute nodes.
+After receiving the login prompt from the interactive master node,
+execute the @command{ncremap} command with @samp{-p mpi}.
+ at command{ncremap} will send regridding jobs in round-robin fashion
+to all available compute nodes until all jobs finish.
+It does this by internally prepending an @acronym{MPI} execution
+command, like @samp{mpirun -H @var{node_name} -npernode 1 -n 1},
+to the usual regridding command.
+ at acronym{MPI}-mode typically has excellent scaling because most
+nodes have independent access to hard storage.
+This is the easiest way to speed your cumbersome job by factors
+of ten or more.
+As mentioned above under Limitations, parallelism is currently only
+supported when all regridding uses the same map-file.
+
 @page
 @html
 <a name="ncrename"></a> <!-- http://nco.sf.net/nco.html#ncrename -->
@@ -20232,16 +20490,18 @@ Zender, C. S. (2008), Analysis of Self-describing Gridded Geoscience
 Data with netCDF Operators (NCO), Environ. Modell. Softw., 23(10),
 1338-1342, doi:10.1016/j.envsoft.2008.03.004. 
 
-Zender, C. S. (2014), netCDF Operator (NCO) User Guide, Version 4.4.3,
+Zender, C. S. and H. J. Mangalam (2007), Scaling Properties of Common
+Statistical Operators for Gridded Datasets, Int. J. High
+Perform. Comput. Appl., 21(4), 485--498, doi:10.1177/1094342007083802.
+
+Zender, C. S. (Year), netCDF Operator (NCO) User Guide, 
 http://nco.sf.net/nco.pdf. 
 @end verbatim
 @end example
-Use the former when referring to overall design, purpose, and 
-optimization of @acronym{NCO}, and use the latter when referring to
-specific features and/or the User Guide itself.
-
-Additional information on citing @acronym{NCO} is in the User Guide at 
- at url{http://nco.sf.net#ctt}.
+Use the first when referring to overall design, purpose, and 
+optimization of @acronym{NCO}, the second for the speed and throughput
+of @acronym{NCO}, and the third for specific features and/or the User
+Guide itself, or in a non-academic setting.
 A complete list of @acronym{NCO} publications and presentations is at
 @url{http://nco.sf.net#pub}.
 This list links to the full papers and seminars themselves.
@@ -20272,28 +20532,29 @@ This list links to the full papers and seminars themselves.
 @cindex @acronym{SDO}
 @cindex @acronym{SEIII}
 @cindex OptIPuter
- at acronym{NSF} has funded a
+ at cindex parallelism
+From 2004--2007, @acronym{NSF} funded a
 @uref{http://nco.sf.net#prp_sei, project}
 to improve Distributed Data Reduction & Analysis (@acronym{DDRA}) by
-evolving @acronym{NCO} into a suite of Scientific Data Operators called 
- at acronym{SDO}.
- at cindex parallelism
-The two main components of this project are @acronym{NCO} parallelism
-(OpenMP, @acronym{MPI}) and Server-Side @acronym{DDRA}
-(@acronym{SSDDRA}) implemented through extensions to @acronym{OPeNDAP} 
-and netCDF4. 
-This project will dramatically reduce bandwidth usage for @acronym{NCO}
- at acronym{DDRA}. 
+evolving @acronym{NCO} parallelism (OpenMP, @acronym{MPI}) and
+Server-Side @acronym{DDRA} (@acronym{SSDDRA}) implemented through
+extensions to @acronym{OPeNDAP} and netCDF4. 
+The @acronym{SSDDRA} features were implemented in @acronym{SWAMP},
+the PhD Thesis of Daniel Wang.
+ at acronym{SWAMP} dramatically reduced bandwidth usage for @acronym{NCO} 
+between client and server.
 
 @cindex @acronym{NASA}
 @cindex @acronym{NRA}
 @cindex @acronym{HDF}
 With this first @acronym{NCO} proposal funded, the content of the
-next @acronym{NCO} proposal is clear.
-We are interested in obtaining @acronym{NASA} support for
+next @acronym{NCO} proposal became clear.
+We had long been interested in obtaining @acronym{NASA} support for 
 @acronym{HDF}-specific enhancements to @acronym{NCO}. 
-We plan to submit a proposal to the next suitable @acronym{NASA}
- at acronym{NRA} or @acronym{NSF} opportunity. 
+From 2012--2015 the @acronym{NASA} @acronym{ACCESS} program funded us to
+implement support support netCDF4 group functionality. 
+Thus @acronym{NCO} will grow and evade bit-rot for the foreseeable
+future. 
 
 We are considering other interesting ideas for still more proposals.
 Please contact us if you wish to be involved with any future
@@ -20593,10 +20854,11 @@ nces -O --nsm_grp --nsm_sfx='_avg' \
 sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc \
   sn_LImon_all-mdl_all-xpt_nsm-avg.nc
 @end example
-The input file, @file{sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc}, produced by @file{cmb_fl_grp.sh}, 
-includes all the ensemble members as groups.
+The input file,
+ at file{sn_LImon_all-mdl_all-xpt_all-nsm_200001-200512.nc}, produced by
+ at file{cmb_fl_grp.sh}, includes all the ensemble members as groups.
 The option @samp{--nsm_grp} denotes 
-that we are using @uref{http://nco.sf.net/nco.html#nsm_grp, group ensembles mode} of @command{nces},
+that we are using @uref{http://nco.sf.net/nco.html#nsm_grp, group ensembles mode} of @command{nces}, 
 instead of @uref{http://nco.sf.net/nco.html#nsm_fl, file ensembles mode}, @samp{--nsm_fl}.
 The option @samp{--nsm_sfx='_avg'} instructs @command{nces} 
 to store the output as a new child group @file{/[model]/[model name]_avg/var};
diff --git a/man/ncremap.1 b/man/ncremap.1
index bcb32bc..efbfba0 100644
--- a/man/ncremap.1
+++ b/man/ncremap.1
@@ -23,6 +23,8 @@ ncremap
 .IR in_drc ] 
 [\-i
 .IR in_fl ] 
+[\-j
+.IR job_nbr ] 
 [\-M] [\-m
 .IR map_fl ] 
 [\-n
@@ -31,6 +33,8 @@ ncremap
 .IR out_drc ] 
 [\-o
 .IR output-file ] 
+[\-P
+.IR pdq_typ ] 
 [\-p
 .IR par_typ ] 
 [\-R
diff --git a/src/nco++/Makefile.am b/src/nco++/Makefile.am
index b2ec224..45d01aa 100644
--- a/src/nco++/Makefile.am
+++ b/src/nco++/Makefile.am
@@ -16,6 +16,9 @@ ANTLR = runantlr
 #Invoke.o : ncoGrammer.g
 #	${ANTLR} ncoGrammer.g
 
+# 20160125: fxm postprocess tokens when symbol table changes
+# cd ~/nco/src/nco++;antlr ncoGrammer.g;./nco_antlr_pst_prc.pl < ncoParserTokenTypes.hpp > ncoEnumTokenTypes.hpp
+
 # fxm: Split off all sources except front-end into nco++ library
 ncap2_SOURCES = Invoke.cc \
 ncap2.cc \
diff --git a/src/nco++/Makefile.in b/src/nco++/Makefile.in
index 0438847..181bbcb 100644
--- a/src/nco++/Makefile.in
+++ b/src/nco++/Makefile.in
@@ -362,6 +362,9 @@ ANTLR = runantlr
 #Invoke.o : ncoGrammer.g
 #	${ANTLR} ncoGrammer.g
 
+# 20160125: fxm postprocess tokens when symbol table changes
+# cd ~/nco/src/nco++;antlr ncoGrammer.g;./nco_antlr_pst_prc.pl < ncoParserTokenTypes.hpp > ncoEnumTokenTypes.hpp
+
 # fxm: Split off all sources except front-end into nco++ library
 ncap2_SOURCES = Invoke.cc \
 ncap2.cc \
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index 64d926c..47dea1b 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -3330,12 +3330,203 @@ double bil_cls::clc_lin_ipl(double x1,double x2, double x, double Q0,double Q1){
     //Populate only on first constructor call
     if(fmc_vtr.empty()){
       fmc_vtr.push_back( fmc_cls("join",this,(int)PJOIN));
+      fmc_vtr.push_back( fmc_cls("push",this,(int)PPUSH));
     }
   }
 
 
   var_sct *vlist_cls::fnd(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker){
   const std::string fnc_nm("vlist_cls::fnd");
+  bool bret;
+  int idx;
+  int fdx;
+  int nbr_args;
+  int nbr_dim;         
+  char *cstr;
+  std::string susg;
+  std::string sfnm=fmc_obj.fnm();
+  std::string att_nm;
+
+  var_sct *var=NULL_CEWI;
+  var_sct *var_att=NULL_CEWI;
+  var_sct *var_add=NULL_CEWI;
+
+
+  RefAST aRef;
+  RefAST tr;
+  std::vector<RefAST> vtr_args; 
+  prs_cls *prs_arg=walker.prs_arg;
+
+  NcapVar *Nvar=NULL;
+          
+  fdx=fmc_obj.fdx();
+
+
+  // Put args into vector 
+  if(expr)
+    vtr_args.push_back(expr);
+
+  if(tr=fargs->getFirstChild())
+  {
+    do  
+      vtr_args.push_back(tr);
+    while(tr=tr->getNextSibling());    
+  } 
+            
+  nbr_args=vtr_args.size();  
+
+  susg="usage: att_out="+sfnm+"(att_id, att_nm|var_nm|string)";
+
+  if(nbr_args!=2)
+    err_prn(sfnm, " Function has been called with wrong number of arguments arguments\n"+susg); 
+
+  
+
+
+
+  // deal with call by ref 
+  if(vtr_args[0]->getType() == CALL_REF )     
+  {   
+    bret=false; 
+  }
+  else
+  {
+    var_att=walker.out(vtr_args[0]);      
+    bret=true;
+  }
+
+  var_add=walker.out(vtr_args[1]);
+
+  // inital scan just return udf
+  if(prs_arg->ntl_scn)
+  {
+    if(var_att)
+       nco_var_free(var_att);
+     
+    nco_var_free(var_add);        
+
+    if( bret) 
+      var=ncap_var_udf("~zz at join_methods");  
+    else
+      var=ncap_sclr_var_mk(std::string(var_add->nm),(nc_type)NC_INT,false);  
+
+    return var;
+  }
+
+  // deal with call by ref final scan
+  if( !bret)
+  {     
+     att_nm=vtr_args[0]->getFirstChild()->getText();  
+     
+
+     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 new var then write var - end of story   
+     if(!var_att) 
+     {   
+       nco_free(var_add->nm);
+       var_add->nm=strdup(att_nm.c_str());      
+       Nvar=new NcapVar(var_add,att_nm);
+
+       var=ncap_sclr_var_mk(att_nm,(nco_int)var_add->sz);
+       prs_arg->var_vtr.push_ow(Nvar);       
+
+       return var;
+
+     } 
+
+  } 
+
+  if(!var_att )
+     err_prn(sfnm, " first argument has evaluated to null\n"+susg); 
+  
+  
+  if(var_att->type==NC_CHAR && var_add->type !=NC_CHAR ) 
+     err_prn(sfnm, "Cannot push to a NC_CHAR attribute a non NC_CHAR type"+susg);           
+  
+
+  if(var_att->type == NC_STRING && !(var_add->type == NC_CHAR || var_add->type==NC_STRING) )
+     err_prn(sfnm, "Cannot push to a NC_STRING attribute a non-text type "+susg);           
+
+
+
+  // deal with this corner case first
+  if(var_att->type==NC_STRING && var_add->type==NC_CHAR)
+  { 
+     
+    char buffer[NC_MAX_ATTRS];
+    size_t sz_new;
+    size_t slb_sz=nco_typ_lng(var_att->type);   
+      
+    strncpy(buffer,(char*)var_add->val.vp, var_add->sz);            
+    buffer[var_add->sz]='\0';
+    sz_new=var_att->sz+1;
+ 
+    var_att->val.vp=nco_realloc(var_att->val.vp, sz_new*slb_sz);           
+    cast_void_nctype(NC_STRING,&var_att->val);         
+       
+    var_att->val.sngp[var_att->sz]=strdup(buffer);      
+    cast_nctype_void(NC_STRING,&var_att->val);           
+    var_att->sz++;
+          
+   }
+   else 
+   {
+     char *cp_in;
+     char *cp_out;
+     size_t slb_sz=nco_typ_lng(var_att->type);   
+     long sz_new=var_att->sz+var_add->sz;
+
+     nco_var_cnf_typ(var_att->type,var_add);         
+     var_att->val.vp=nco_realloc(var_att->val.vp, sz_new*slb_sz);           
+     
+     cp_in=(char*)var_add->val.vp;
+     cp_out=(char*)var_att->val.vp + (size_t)(var_att->sz*slb_sz);    
+   
+     memcpy(cp_out,cp_in, slb_sz*var_add->sz); 
+     var_att->sz=sz_new;  
+
+      // a bit cheeky here - set to null so we DONT have to deep-copy ragged array of strings    
+     if(var_add->type==NC_STRING) 
+     {
+       nco_free(var_add->val.vp);  
+       var_add->val.vp=(void*)NULL_CEWI;   
+     }
+        
+
+   }
+  
+
+  nco_var_free(var_add);
+
+  // deal with call by ref 
+  // not sure if we need a return value -?  for now return the att size 
+  if(bret) 
+  {
+     return var_att; 
+  }
+  else
+  {
+    Nvar=new NcapVar(var_att); 
+     var=ncap_sclr_var_mk(SCS("~zz at join_methods"), (nco_int)var_att->sz);
+     prs_arg->var_vtr.push_ow(Nvar);       
+     return var;  
+  }
+
+
+
+  }
+
+
+
+  var_sct *vlist_cls::fnd_join(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker){
+  const std::string fnc_nm("vlist_cls::fnd");
   int idx;
   int fdx;
   int nbr_args;
@@ -3532,10 +3723,47 @@ double bil_cls::clc_lin_ipl(double x1,double x2, double x, double Q0,double Q1){
   // make vars conform or die 
   if( !ncap_var_stretch(&var_in,&var_weight) )
     err_prn(sfnm ,"unable to make weight var conform to input var");
+  
+
+  
+
+  // make sure missing value is same is same in both vars
+  // copy missing datums in var_in to var_weight
+  if(var_in->has_mss_val)
+  {
+    long idx;
+    long sz=var_in->sz;
+    char *cp_in=(char*)var_in->val.vp;
+    char *cp_out=(char*)var_weight->val.vp;
+    char  *cp_miss_var;
+    char  *cp_miss_weight;
+    size_t slb_sz=nco_typ_lng(var_in->type);
+
+    if(!var_weight->has_mss_val)
+       nco_mss_val_cp(var_in,var_weight);
+  
+    cp_miss_var=(char*)var_in->mss_val.vp;
+    cp_miss_weight=(char*)var_weight->mss_val.vp;
+  
+
+
+    for(idx=0;idx<sz;idx++)
+    {
+      if( !memcmp(cp_in, cp_miss_var, slb_sz) || !memcmp(cp_out, cp_miss_weight, slb_sz) )
+	 memcpy(cp_out, cp_miss_var, slb_sz);   
+
+      cp_in+=slb_sz;
+      cp_out+=slb_sz;
+    }
+    
+    memcpy(cp_miss_weight, cp_miss_var, slb_sz);   
+  }
+ 
 
   // [S1] single value - duplicate is destroyed
   var_weight_sum=nco_var_avg(nco_var_dpl(var_weight),var_weight->dim,var_weight->nbr_dim ,nco_op_ttl,False,&ddra_info);
-
+  
+  // return var_weight_sum;
   // [S2] single value - duplicate is destroyed
   var_weight_avg = nco_var_avg(  ncap_var_var_stc( nco_var_dpl(var_weight), var_in, TIMES), var_weight->dim, var_weight->nbr_dim, nco_op_ttl,False,&ddra_info);
 
diff --git a/src/nco++/fmc_all_cls.hh b/src/nco++/fmc_all_cls.hh
index 2c5712c..5699fe3 100644
--- a/src/nco++/fmc_all_cls.hh
+++ b/src/nco++/fmc_all_cls.hh
@@ -243,11 +243,12 @@ public:
 // var list class /*********************************************************/
 class vlist_cls: public vtl_cls {
 private:
-   enum {PJOIN };
+  enum {PJOIN,PPUSH };
    bool _flg_dbg;
 public:
   vlist_cls(bool flg_dbg);
   var_sct *fnd(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker);
+  var_sct *fnd_join(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker);
 };
 
 
diff --git a/src/nco++/ncap2_utl.cc b/src/nco++/ncap2_utl.cc
index fcc14c0..13f3155 100644
--- a/src/nco++/ncap2_utl.cc
+++ b/src/nco++/ncap2_utl.cc
@@ -633,6 +633,7 @@ void
 ncap_lmt_evl
 (int nc_id,
  lmt_sct* lmt_ptr,
+ long hint_sz,
  prs_cls *prs_arg){
   
   long cnt_dmn;
@@ -650,14 +651,18 @@ ncap_lmt_evl
   dmn_vtr=(nc_id==prs_arg->in_id ? prs_arg->dmn_in_vtr: prs_arg->dmn_out_vtr);
   
   
+  // fudge the size
+  if( hint_sz > -1L )
+    cnt_dmn=hint_sz;
+  else 
+  {
+    dmn_ptr=dmn_vtr.find(lmt_ptr->nm);
   
-  dmn_ptr=dmn_vtr.find(lmt_ptr->nm);
-  
-  if(dmn_ptr==NULL)
-    err_prn(fnc_nm,"Dimension "+ std::string(lmt_ptr->nm)+" in limits not found");
-  
-  cnt_dmn=dmn_ptr->sz;
-  
+    if(dmn_ptr==NULL)
+      err_prn(fnc_nm,"Dimension "+ std::string(lmt_ptr->nm)+" in limits not found");
+
+    cnt_dmn=dmn_ptr->sz;
+  }   
   //fill out defaults
   srt=( lmt_ptr->is_usr_spc_min ? lmt_ptr->srt:0L);
   end=( lmt_ptr->is_usr_spc_max ? lmt_ptr->end:cnt_dmn-1);
@@ -696,8 +701,8 @@ ncap_lmt_evl
   // do error checking 
   if(!prs_arg->FORTRAN_IDX_CNV){ 
     std::ostringstream os;
-    if(srt<0) srt+=cnt_dmn-1;       
-    if(end<0) end+=cnt_dmn-1;       
+    if(srt<0) srt+=cnt_dmn;       
+    if(end<0) end+=cnt_dmn;       
     if(lmt_ptr->is_usr_spc_min && (srt<0 || srt>cnt_dmn-1)) {
       
       os<<"Lower limit " <<srt<<" for dim "<<lmt_ptr->nm<<" is outside range "<<0L<<"-"<<cnt_dmn-1;
@@ -1620,7 +1625,7 @@ ncap_var_var_op   /* [fnc] Add two variables */
     if( (var1->has_dpl_dmn ==-1 || var2->has_dpl_dmn==-1) && var1->sz >1 && var2->sz>1){  
       if(var1->sz != var2->sz) {
 	std::ostringstream os;
-	os<<"Hyperslabbed variable:"<<var1->nm <<" and variable:"<<var2->nm <<" have differnet number of elements, so cannot perform arithmetic operation.";
+	os<<"Hyperslabbed variable:"<<var1->nm <<" and variable:"<<var2->nm <<" have different number of elements, so cannot perform arithmetic operation.";
 	err_prn(fnc_nm,os.str());
       }
       if( nco_shp_chk(var1,var2)==False){ 
diff --git a/src/nco++/ncap2_utl.hh b/src/nco++/ncap2_utl.hh
index 38a1d02..c2df2c9 100644
--- a/src/nco++/ncap2_utl.hh
+++ b/src/nco++/ncap2_utl.hh
@@ -150,6 +150,7 @@ ncap_var_var_atan2
 void ncap_lmt_evl( 
 int nc_id,
 lmt_sct* lmt_ptr,
+long hint_sz,
 prs_cls *prs_arg);
 
 var_sct*
diff --git a/src/nco++/ncoEnumTokenTypes.hpp b/src/nco++/ncoEnumTokenTypes.hpp
index 8ecbbba..4e26b59 100644
--- a/src/nco++/ncoEnumTokenTypes.hpp
+++ b/src/nco++/ncoEnumTokenTypes.hpp
@@ -118,10 +118,11 @@
 		NUMBER = 110,
 		VAR_ATT = 111,
 		VAR_ATT_QT = 112,
-		DIM_QT = 113,
-		DIM_VAL = 114,
-		INCLUDE = 115,
-		LMT_DMN = 116,
+		STR_ATT_QT = 113,
+		DIM_QT = 114,
+		DIM_VAL = 115,
+		INCLUDE = 116,
+		LMT_DMN = 117,
 		NULL_TREE_LOOKAHEAD = 3
 	};
 #endif /*INC_ncoEnumTokenTypes_hpp_*/
diff --git a/src/nco++/ncoGrammer.g b/src/nco++/ncoGrammer.g
index a6bff1e..bc68354 100644
--- a/src/nco++/ncoGrammer.g
+++ b/src/nco++/ncoGrammer.g
@@ -582,12 +582,12 @@ VAR_ATT_QT :( '\''!)
    ;     
 
 // return a STR_ATT_ID
-STR_ATT_ID:  '@'(LPH)(LPH|DGT)* {$setType(STR_ATT_ID);}
+ATT_ID:  '@'(LPH)(LPH|DGT)* {string an=$getText;$setText("global"+an);$setType(ATT_ID);}
 ;
 
 // Return a quoted STR_ATT_ID
 STR_ATT_QT :( '\''!)
-              '@' VAR_NM_QT {$setType(STR_ATT_ID);}
+              '@' VAR_NM_QT {$setType(STR_ATT_QT);}
              ('\''!)
 ;     
 
@@ -1614,8 +1614,23 @@ var=NULL_CEWI;
         } // end action
        
    |   (#(ATT_ID LMT_LIST))=> #(att:ATT_ID LMT_LIST){
-        ;
-        } 
+
+            //In Initial scan all newly defined atts are flagged as Undefined
+            var_sct *var1;
+            NcapVar *Nvar;
+
+            if(nco_dbg_lvl_get() > nco_dbg_var) dbg_prn(fnc_nm,att->getText());
+            
+            var1=ncap_var_udf(att->getText().c_str());
+
+            Nvar=new NcapVar(var1);
+            prs_arg->int_vtr.push_ow(Nvar);          
+
+            // Copy return variable
+            var=nco_var_dpl(var1);    
+
+       } //end action
+
    |   (#(ATT_ID LMT_DMN))=>  #(att1:ATT_ID DMN_LIST){
         ;
         } 
@@ -1723,7 +1738,7 @@ var=NULL_CEWI;
                  slb_sz=1;        
                 // fill out limit structure
                 for(idx=0 ; idx < nbr_dmn ;idx++){
-                   (void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],prs_arg);
+                   (void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],-1,prs_arg);
                     // Calculate size
                    slb_sz *= lmt_vtr[idx]->cnt;
                 }
@@ -1784,7 +1799,7 @@ var=NULL_CEWI;
                 var_lhs->sz=1;        
                 // fill out limit structure
                 for(idx=0 ; idx < nbr_dmn ;idx++){
-                   (void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],prs_arg);
+                   (void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],-1,prs_arg);
                     // Calculate size
                    var_lhs->sz *= lmt_vtr[idx]->cnt;
                 }
@@ -1990,9 +2005,162 @@ end0:         if(lmt->getNextSibling() && lmt->getNextSibling()->getType()==NORE
                          
        } // end action
  
-   |   (#(ATT_ID LMT_LIST)) => #(att:ATT_ID LMT_LIST){
-        ;
+   |   (#(ATT_ID LMT_LIST)) => #(att:ATT_ID lmta:LMT_LIST){
+
+            long srt,end,cnt,srd;  
+            std::string att_nm=att->getText();
+            std::string fnc_nm("att_lmt"); 
+            NcapVar *Nvar=NULL;
+            NcapVector<lmt_sct*> lmt_vtr;
+
+            var_sct *var_lhs=NULL_CEWI; 
+            var_sct *var_rhs=NULL_CEWI; 
+            
+            if(prs_arg->ntl_scn)
+            { 
+              // only final scan for this attribute hyperslab 
+              var=ncap_var_udf(att_nm.c_str());
+              // can't return here -- have to use goto
+              goto att_end; 
+            } 
+  
+            Nvar=prs_arg->var_vtr.find(att_nm);
+
+            if(Nvar!=NULL)
+                var_lhs=nco_var_dpl(Nvar->var);
+            else    
+                var_lhs=ncap_att_init(att_nm,prs_arg);
+            
+
+            if(var_lhs==NULL_CEWI )
+                err_prn(fnc_nm,"Unable to locate attribute " +att_nm+ " in input or output files.");
+            
+		    lmt_mk(1L,lmta,lmt_vtr);
+           
+
+            if( lmt_vtr.size() != 1)
+                err_prn(fnc_nm,"Number of hyperslab limits for an attribute "+ att_nm+" must be one ");
+
+
+            lmt_vtr[0]->nm=strdup("zz at attribute");    
+            (void)ncap_lmt_evl(1,lmt_vtr[0],var_lhs->sz,prs_arg); 
+            
+            if(lmt_vtr[0]->cnt==0)
+               err_prn(fnc_nm,"Hyperslab limits for attribute "+ att_nm+" doesn't include any elements");   
+
+            srt=lmt_vtr[0]->srt;
+            cnt=lmt_vtr[0]->cnt;
+            srd=lmt_vtr[0]->srd; 
+            end=lmt_vtr[0]->end; 
+
+            // get rhs can be anything as long as it is of size cnt 
+            var_rhs=out(att->getNextSibling());
+
+
+            
+            if( var_lhs->type==NC_STRING)
+            { 
+              long szn; 
+              long idx; 
+              long cnt=0;  
+              char buffer[NC_MAX_ATTRS];  
+
+              buffer[0]='\0';
+ 
+              cast_void_nctype(NC_STRING, &var_lhs->val);    
+              cast_void_nctype(var_rhs->type, &var_rhs->val);     
+               
+              if( var_rhs->type==NC_STRING)
+              {
+                // check size
+               if(  var_rhs->sz!=1L &&  var_rhs->sz != cnt)   
+                  err_prn(fnc_nm,"Hyperslab limits for attribute "+att_nm + " on LHS size="+nbr2sng(cnt)+ " doesnt match RHS size=" + nbr2sng(var_rhs->sz));
+
+                   
+                szn=(var_rhs->sz >1 ? 1: 0);     
+                for(idx=srt; idx<=end;idx+=srd)  
+                {
+                   var_lhs->val.sngp[idx]=strdup(var_rhs->val.sngp[cnt]);    
+                   cnt+=szn;
+                }
+
+
+              } 
+                  
+              else if( var_rhs->type==NC_CHAR )
+              { 
+               // if RHS is a char string then it reduces to  single NC_STRING regardless of size  
+                strncpy(buffer, var_rhs->val.cp , var_rhs->sz);   
+                buffer[var_rhs->sz]='\0';  
+
+                for(idx=srt; idx<=end;idx+=srd)  
+                   var_lhs->val.sngp[idx]=strdup(buffer);    
+              }
+              else 
+              { 
+                err_prn(fnc_nm,"To hyperslab into a text NC_STRING The RHS type must alo be a text string of type NC_CHAR or NC_STRING"); 
+              } 
+
+              cast_nctype_void(var_rhs->type, &var_rhs->val);    
+              cast_nctype_void(var_lhs->type, &var_lhs->val);    
+
+  
+
+            }
+            
+
+            // deal with regular types   
+            if(var_lhs->type !=NC_STRING)
+            {  
+               char *cp_in;
+               char *cp_out;  
+               long idx;
+               long szn; 
+
+               size_t slb_sz=nco_typ_lng(var_lhs->type); 
+
+               // check size
+               if(  var_rhs->sz!=1L &&  var_rhs->sz != cnt)   
+                  err_prn(fnc_nm,"Hyperslab limits for attribute "+att_nm + " on LHS size="+nbr2sng(cnt)+ " doesnt match RHS size=" + nbr2sng(var_rhs->sz));
+
+ 
+               nco_var_cnf_typ(var_lhs->type,var_rhs);               
+
+               // if rhs size is one then simply copy across possibly multiple times
+               szn=(var_rhs->sz >1 ? 1: 0);   
+
+               cp_in=(char*)(var_rhs->val.vp); 
+              
+               //cp_out=(char*)var_lhs->val.vp; 
+
+               for(idx=srt; idx<=end;idx+=srd) 
+               { 
+                cp_out=(char*)(var_lhs->val.vp)+slb_sz*idx;     
+                memcpy(cp_out,cp_in,slb_sz);  
+                cp_in+= szn;
+               }
+
+            }
+
+            nco_var_free(var_rhs);  
+            nco_lmt_free(lmt_vtr[0]); 
+                  
+            Nvar=new NcapVar(var_lhs,att_nm);
+
+            prs_arg->var_vtr.push_ow(Nvar);       
+
+               // See If we have to return something
+            if(lmta->getFirstChild() && lmta->getFirstChild()->getType()==NORET)
+              var=NULL_CEWI;
+            else 
+              var=nco_var_dpl(var_lhs);               ;
+ 
+
+           att_end: ; 
+
+        
         } 
+
    |   (#(ATT_ID DMN_LIST))=> #(att1:ATT_ID DMN_LIST){
         ;
         } 
@@ -2277,6 +2445,102 @@ out returns [var_sct *var]
              
     }
 
+     // attribute with argument list 
+    | (#(ATT_ID LMT_LIST)) => #( attl:ATT_ID lmtl:LMT_LIST) {
+
+            std::string att_nm=attl->getText();
+            std::string fnc_nm("att_lmt"); 
+            NcapVar *Nvar=NULL;
+            NcapVector<lmt_sct*> lmt_vtr;
+
+            var_sct *var_att=NULL_CEWI; 
+
+            
+            if(prs_arg->ntl_scn)
+            { 
+              // only final scan for this attribute hyperslab 
+              var=ncap_var_udf(att_nm.c_str());
+              // can't return here -- have to use goto
+              goto attl_end; 
+            } 
+  
+            Nvar=prs_arg->var_vtr.find(attl->getText());
+
+            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.");
+            
+		    lmt_mk(1L,lmtl,lmt_vtr);
+           
+
+            if( lmt_vtr.size() != 1)
+                err_prn(fnc_nm,"Number of hyperslab limits for an attribute "+ att_nm+"must be one ");
+
+            // fxm - very soon  
+            lmt_vtr[0]->nm=strdup("zz at attribute");    
+            (void)ncap_lmt_evl(1,lmt_vtr[0],var_att->sz,prs_arg); 
+             
+            // we have something to hyperslab
+            if( lmt_vtr[0]->cnt > 0)
+            {  
+               char *cp_in;
+               char *cp_out;  
+               long idx;
+               long srt=lmt_vtr[0]->srt;
+               long cnt=lmt_vtr[0]->cnt;
+               long srd=lmt_vtr[0]->srd; 
+               size_t slb_sz=nco_typ_lng(var_att->type); 
+                
+               /* create output att */
+               var=ncap_sclr_var_mk(att_nm,var_att->type,true);                 
+               (void)ncap_att_stretch(var,cnt);     
+
+               cp_in=(char*)( var_att->val.vp); 
+               cp_in+= (ptrdiff_t)slb_sz*srt;
+               cp_out=(char*)var->val.vp; 
+                    
+               idx=0;
+  
+               while(idx++ < cnt )
+               { 
+                  memcpy(cp_out, cp_in, slb_sz);                   
+                  cp_in+=srd*slb_sz;
+                  cp_out+=slb_sz; 
+               } 
+               
+               // if type NC_STRING then realloc ragged array  
+               if(var_att->type==NC_STRING)
+               { 
+                 idx=0;  
+                 (void)cast_void_nctype((nc_type)NC_STRING,&var->val);                  
+
+                 while(idx<cnt)
+                   var->val.sngp[idx]=strdup(var->val.sngp[idx++]);    
+
+                
+                 (void)cast_nctype_void((nc_type)NC_STRING,&var->val); 
+
+               }  
+
+
+            }
+            else
+            {
+              err_prn(fnc_nm,"Hyperslab limits for attribute "+ att_nm+" doesn't include any elements");  
+            }
+             
+            nco_var_free(var_att);    
+
+            attl_end: ; 
+        }
+
+
+
     // plain Variable
 	|   v:VAR_ID       
         { 
@@ -2814,7 +3078,7 @@ var_sct *var_nbr;
               if(prs_arg->FORTRAN_IDX_CNV)
                 srt--;
               else if ( srt<0) 
-                srt+=var_rhs->sz-1; // deal with negative index 
+                srt+=var_rhs->sz; // deal with negative index 
  
               // do some bounds checking
               if(srt >= var_rhs->sz || srt<0 )
@@ -2936,7 +3200,7 @@ var_sct *var_nbr;
                // fortran index convention   
                if(prs_arg->FORTRAN_IDX_CNV)
                 srt--;
-               else if(srt<0) srt+=var_lhs->sz-1; //deal with negative index convention 
+               else if(srt<0) srt+=var_lhs->sz; //deal with negative index convention 
                  
                  // do some bounds checking on single limits
                  if(srt >= var_lhs->sz || srt<0 )
@@ -2977,7 +3241,7 @@ var_sct *var_nbr;
                // fortran index convention   
                if(prs_arg->FORTRAN_IDX_CNV)
                 srt--;
-               else if(srt<0) srt+=var_lhs->sz-1; //deal with negative index convention 
+               else if(srt<0) srt+=var_lhs->sz; //deal with negative index convention 
               
                 // do some bounds checking on single limits
                 if(srt >= var_lhs->sz || srt<0 )
@@ -3093,7 +3357,7 @@ var=NULL_CEWI;
                         
           // fill out limit structure
            for(idx=0 ; idx < nbr_dmn ;idx++)
-            (void)ncap_lmt_evl(var_rhs->nc_id,lmt_vtr[idx],prs_arg);
+            (void)ncap_lmt_evl(var_rhs->nc_id,lmt_vtr[idx],-1,prs_arg);
 
           // See if var can be normalized
            for(idx=0; idx<nbr_dmn ; idx++){
diff --git a/src/nco++/ncoLexer.cpp b/src/nco++/ncoLexer.cpp
index 3be9457..627122c 100644
--- a/src/nco++/ncoLexer.cpp
+++ b/src/nco++/ncoLexer.cpp
@@ -201,7 +201,7 @@ ANTLR_USE_NAMESPACE(antlr)RefToken ncoLexer::nextToken()
 			}
 			case 0x40 /* '@' */ :
 			{
-				mSTR_ATT_ID(true);
+				mATT_ID(true);
 				theRetToken=_returnToken;
 				break;
 			}
@@ -2306,9 +2306,9 @@ void ncoLexer::mVAR_ATT_QT(bool _createToken) {
 	_saveIndex=0;
 }
 
-void ncoLexer::mSTR_ATT_ID(bool _createToken) {
+void ncoLexer::mATT_ID(bool _createToken) {
 	int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
-	_ttype = STR_ATT_ID;
+	_ttype = ATT_ID;
 	ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
 	
 	match('@' /* charlit */ );
@@ -2398,7 +2398,7 @@ void ncoLexer::mSTR_ATT_ID(bool _createToken) {
 	_loop205:;
 	} // ( ... )*
 #line 585 "ncoGrammer.g"
-	_ttype = STR_ATT_ID;
+	string an=text.substr(_begin,text.length()-_begin);{ text.erase(_begin); text += "global"+an; };_ttype = ATT_ID;
 #line 2403 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
@@ -2421,7 +2421,7 @@ void ncoLexer::mSTR_ATT_QT(bool _createToken) {
 	match('@' /* charlit */ );
 	mVAR_NM_QT(false);
 #line 590 "ncoGrammer.g"
-	_ttype = STR_ATT_ID;
+	_ttype = STR_ATT_QT;
 #line 2426 "ncoLexer.cpp"
 	{
 	_saveIndex = text.length();
@@ -2751,31 +2751,31 @@ const unsigned long ncoLexer::_tokenSet_0_data_[] = { 0UL, 96UL, 1073741824UL, 2
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_0(_tokenSet_0_data_,10);
 const unsigned long ncoLexer::_tokenSet_1_data_[] = { 0UL, 134179584UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // ( ) + - . 0 1 2 3 4 5 6 7 8 9 : A B C D E F G H I J K L M N O P Q R 
-// S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v 
+// S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_1(_tokenSet_1_data_,10);
 const unsigned long ncoLexer::_tokenSet_2_data_[] = { 0UL, 0UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g 
-// h i j k l m n o p q r s t u v 
+// h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_2(_tokenSet_2_data_,10);
 const unsigned long ncoLexer::_tokenSet_3_data_[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11 
 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
 //   ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 
 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a 
-// b c d e f g h i j k l m n o p q r s t u v 
+// b c d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_3(_tokenSet_3_data_,16);
 const unsigned long ncoLexer::_tokenSet_4_data_[] = { 4294958079UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 
 // 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! 
 // \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C 
 // D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d 
-// e f g h i j k l m n o p q r s t u v 
+// e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_4(_tokenSet_4_data_,16);
 const unsigned long ncoLexer::_tokenSet_5_data_[] = { 4294966271UL, 4294967291UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11 
 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
 //   ! # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B 
 // C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c 
-// d e f g h i j k l m n o p q r s t u v 
+// d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_5(_tokenSet_5_data_,16);
 
diff --git a/src/nco++/ncoLexer.hpp b/src/nco++/ncoLexer.hpp
index 7415676..0c49f69 100644
--- a/src/nco++/ncoLexer.hpp
+++ b/src/nco++/ncoLexer.hpp
@@ -14,7 +14,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2015 Charlie Zender
+/* Copyright (C) 1995--2016 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -146,7 +146,7 @@ public:
 	public: void mNUMBER(bool _createToken);
 	public: void mVAR_ATT(bool _createToken);
 	public: void mVAR_ATT_QT(bool _createToken);
-	public: void mSTR_ATT_ID(bool _createToken);
+	public: void mATT_ID(bool _createToken);
 	public: void mSTR_ATT_QT(bool _createToken);
 	public: void mDIM_QT(bool _createToken);
 	public: void mDIM_VAL(bool _createToken);
diff --git a/src/nco++/ncoParser.cpp b/src/nco++/ncoParser.cpp
index e083bb1..afc88c7 100644
--- a/src/nco++/ncoParser.cpp
+++ b/src/nco++/ncoParser.cpp
@@ -2189,7 +2189,7 @@ void ncoParser::imaginary_token() {
 
 void ncoParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
 {
-	factory.setMaxNodeType(118);
+	factory.setMaxNodeType(117);
 }
 const char* ncoParser::tokenNames[] = {
 	"<0>",
@@ -2305,7 +2305,6 @@ const char* ncoParser::tokenNames[] = {
 	"NUMBER",
 	"variable or function or attribute identifier",
 	"VAR_ATT_QT",
-	"STR_ATT_ID",
 	"STR_ATT_QT",
 	"DIM_QT",
 	"dimension identifier",
diff --git a/src/nco++/ncoParser.hpp b/src/nco++/ncoParser.hpp
index 7068e46..e4350f6 100644
--- a/src/nco++/ncoParser.hpp
+++ b/src/nco++/ncoParser.hpp
@@ -14,7 +14,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2015 Charlie Zender
+/* Copyright (C) 1995--2016 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -124,10 +124,10 @@ protected:
 private:
 	static const char* tokenNames[];
 #ifndef NO_STATIC_CONSTS
-	static const int NUM_TOKENS = 119;
+	static const int NUM_TOKENS = 118;
 #else
 	enum {
-		NUM_TOKENS = 119
+		NUM_TOKENS = 118
 	};
 #endif
 	
diff --git a/src/nco++/ncoParserTokenTypes.hpp b/src/nco++/ncoParserTokenTypes.hpp
index 2ca52da..b41781d 100644
--- a/src/nco++/ncoParserTokenTypes.hpp
+++ b/src/nco++/ncoParserTokenTypes.hpp
@@ -1,7 +1,7 @@
 #ifndef INC_ncoParserTokenTypes_hpp_
 #define INC_ncoParserTokenTypes_hpp_
 
-/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoParserTokenTypes.hpp"$ */
+/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoParserTokenTypes.hpp"$ */
 
 #ifndef CUSTOM_API
 # define CUSTOM_API
@@ -121,12 +121,11 @@ struct CUSTOM_API ncoParserTokenTypes {
 		NUMBER = 110,
 		VAR_ATT = 111,
 		VAR_ATT_QT = 112,
-		STR_ATT_ID = 113,
-		STR_ATT_QT = 114,
-		DIM_QT = 115,
-		DIM_VAL = 116,
-		INCLUDE = 117,
-		LMT_DMN = 118,
+		STR_ATT_QT = 113,
+		DIM_QT = 114,
+		DIM_VAL = 115,
+		INCLUDE = 116,
+		LMT_DMN = 117,
 		NULL_TREE_LOOKAHEAD = 3
 	};
 #ifdef __cplusplus
diff --git a/src/nco++/ncoTree.cpp b/src/nco++/ncoTree.cpp
index a8861dc..9c5b297 100644
--- a/src/nco++/ncoTree.cpp
+++ b/src/nco++/ncoTree.cpp
@@ -829,7 +829,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2039 "ncoGrammer.g"
+#line 2207 "ncoGrammer.g"
 	var_sct *var;
 #line 835 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST out_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
@@ -848,6 +848,8 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	ANTLR_USE_NAMESPACE(antlr)RefAST dval = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	ANTLR_USE_NAMESPACE(antlr)RefAST attl = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	ANTLR_USE_NAMESPACE(antlr)RefAST lmtl = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST v = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vlst = ANTLR_USE_NAMESPACE(antlr)nullAST;
@@ -863,14 +865,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	ANTLR_USE_NAMESPACE(antlr)RefAST val_uint = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST val_int64 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST val_uint64 = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2039 "ncoGrammer.g"
+#line 2207 "ncoGrammer.g"
 	
 	const std::string fnc_nm("out"); 
 		var_sct *var1;
 	var_sct *var2;
 	var=NULL_CEWI;
 	
-#line 874 "ncoTree.cpp"
+#line 876 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -889,9 +891,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t320;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2066 "ncoGrammer.g"
+#line 2234 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, TIMES );
-#line 895 "ncoTree.cpp"
+#line 897 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -908,9 +910,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t321;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2069 "ncoGrammer.g"
+#line 2237 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, DIVIDE );
-#line 914 "ncoTree.cpp"
+#line 916 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -927,9 +929,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t322;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2071 "ncoGrammer.g"
+#line 2239 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, MOD);
-#line 933 "ncoTree.cpp"
+#line 935 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -946,9 +948,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t323;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2073 "ncoGrammer.g"
+#line 2241 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, CARET);
-#line 952 "ncoTree.cpp"
+#line 954 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -963,9 +965,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t324;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2076 "ncoGrammer.g"
+#line 2244 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,NULL_CEWI, LNOT );
-#line 969 "ncoTree.cpp"
+#line 971 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -980,9 +982,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t327;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2082 "ncoGrammer.g"
+#line 2250 "ncoGrammer.g"
 				var=ncap_var_var_inc(var1,NULL_CEWI,INC,false,prs_arg);
-#line 986 "ncoTree.cpp"
+#line 988 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -997,9 +999,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t328;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2084 "ncoGrammer.g"
+#line 2252 "ncoGrammer.g"
 				var=ncap_var_var_inc(var1,NULL_CEWI, DEC,false,prs_arg );
-#line 1003 "ncoTree.cpp"
+#line 1005 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1014,11 +1016,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t329;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2086 "ncoGrammer.g"
+#line 2254 "ncoGrammer.g"
 				
 				var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,false,prs_arg);
 				
-#line 1022 "ncoTree.cpp"
+#line 1024 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1033,11 +1035,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t330;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2089 "ncoGrammer.g"
+#line 2257 "ncoGrammer.g"
 				
 				var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,false,prs_arg);
 				
-#line 1041 "ncoTree.cpp"
+#line 1043 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1054,9 +1056,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t331;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2094 "ncoGrammer.g"
+#line 2262 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LAND );
-#line 1060 "ncoTree.cpp"
+#line 1062 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1073,9 +1075,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t332;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2096 "ncoGrammer.g"
+#line 2264 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LOR );
-#line 1079 "ncoTree.cpp"
+#line 1081 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1092,9 +1094,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t333;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2099 "ncoGrammer.g"
+#line 2267 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LTHAN );
-#line 1098 "ncoTree.cpp"
+#line 1100 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1111,9 +1113,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t334;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2101 "ncoGrammer.g"
+#line 2269 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GTHAN );
-#line 1117 "ncoTree.cpp"
+#line 1119 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1130,9 +1132,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t335;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2103 "ncoGrammer.g"
+#line 2271 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GEQ );
-#line 1136 "ncoTree.cpp"
+#line 1138 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1149,9 +1151,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t336;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2105 "ncoGrammer.g"
+#line 2273 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LEQ );
-#line 1155 "ncoTree.cpp"
+#line 1157 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1168,9 +1170,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t337;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2107 "ncoGrammer.g"
+#line 2275 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, EQ );
-#line 1174 "ncoTree.cpp"
+#line 1176 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1187,9 +1189,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t338;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2109 "ncoGrammer.g"
+#line 2277 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, NEQ );
-#line 1193 "ncoTree.cpp"
+#line 1195 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1206,9 +1208,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t339;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2112 "ncoGrammer.g"
+#line 2280 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FLTHAN );
-#line 1212 "ncoTree.cpp"
+#line 1214 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1225,9 +1227,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t340;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2114 "ncoGrammer.g"
+#line 2282 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FGTHAN );
-#line 1231 "ncoTree.cpp"
+#line 1233 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1245,12 +1247,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t341;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2116 "ncoGrammer.g"
+#line 2284 "ncoGrammer.g"
 				
 				var1=out_asn(pls_asn);
 				var=ncap_var_var_inc(var1,var2, PLUS_ASSIGN ,(pls_asn->getType()==UTIMES), prs_arg);
 				
-#line 1254 "ncoTree.cpp"
+#line 1256 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1268,12 +1270,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t342;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2120 "ncoGrammer.g"
+#line 2288 "ncoGrammer.g"
 				
 				var1=out_asn(min_asn);
 				var=ncap_var_var_inc(var1,var2, MINUS_ASSIGN ,(min_asn->getType()==UTIMES), prs_arg);
 				
-#line 1277 "ncoTree.cpp"
+#line 1279 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1291,12 +1293,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t343;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2124 "ncoGrammer.g"
+#line 2292 "ncoGrammer.g"
 				
 				var1=out_asn(tim_asn);
 				var=ncap_var_var_inc(var1,var2, TIMES_ASSIGN ,(tim_asn->getType()==UTIMES), prs_arg);
 				
-#line 1300 "ncoTree.cpp"
+#line 1302 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1314,12 +1316,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t344;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2128 "ncoGrammer.g"
+#line 2296 "ncoGrammer.g"
 					
 				var1=out_asn(div_asn);
 				var=ncap_var_var_inc(var1,var2, DIVIDE_ASSIGN ,(div_asn->getType()==UTIMES), prs_arg);
 				
-#line 1323 "ncoTree.cpp"
+#line 1325 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1335,7 +1337,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t345;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2134 "ncoGrammer.g"
+#line 2302 "ncoGrammer.g"
 				
 				// Check for RAM variable - if present 
 				// change tree - for example from:
@@ -1370,7 +1372,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				var=assign(tr,bram);
 				
 				
-#line 1374 "ncoTree.cpp"
+#line 1376 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1386,11 +1388,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t346;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2168 "ncoGrammer.g"
+#line 2336 "ncoGrammer.g"
 				
 				
 				
-#line 1394 "ncoTree.cpp"
+#line 1396 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1408,7 +1410,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t347;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2173 "ncoGrammer.g"
+#line 2341 "ncoGrammer.g"
 				
 				bool br;
 				
@@ -1425,7 +1427,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}   
 				var1=nco_var_free(var1);
 				
-#line 1429 "ncoTree.cpp"
+#line 1431 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1441,7 +1443,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t348;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2191 "ncoGrammer.g"
+#line 2359 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1451,7 +1453,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				RefAST tr;  
 				var=prs_arg->fmc_vtr[idx].vfnc()->fnd(tr ,args, prs_arg->fmc_vtr[idx],*this); 
 				
-#line 1455 "ncoTree.cpp"
+#line 1457 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1473,7 +1475,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t349;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2202 "ncoGrammer.g"
+#line 2370 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1482,7 +1484,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				int idx=atoi(sdx.c_str());
 				var=prs_arg->fmc_vtr[idx].vfnc()->fnd(mtd ,margs, prs_arg->fmc_vtr[idx],*this); 
 				
-#line 1486 "ncoTree.cpp"
+#line 1488 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1492,7 +1494,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,DIM_ID_SIZE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2212 "ncoGrammer.g"
+#line 2380 "ncoGrammer.g"
 				
 				string sDim=dval->getText();
 				dmn_sct *dmn_fd;
@@ -1532,47 +1534,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				} 
 				
 				
-#line 1536 "ncoTree.cpp"
-			}
-			break;
-		}
-		case ATT_ID:
-		{
-			att = _t;
-			match(_t,ATT_ID);
-			_t = _t->getNextSibling();
-			if ( inputState->guessing==0 ) {
-#line 2299 "ncoGrammer.g"
-				
-				
-				NcapVar *Nvar=NULL;
-				
-				if(prs_arg->ntl_scn)
-				Nvar=prs_arg->int_vtr.find(att->getText());
-				
-				if(Nvar==NULL) 
-				Nvar=prs_arg->var_vtr.find(att->getText());
-				
-				var=NULL_CEWI;    
-				if(Nvar !=NULL)
-				var=nco_var_dpl(Nvar->var);
-				else    
-				// Check input file for attribute
-				var=ncap_att_init(att->getText(),prs_arg);
-				
-				if(!prs_arg->ntl_scn && var==NULL_CEWI ){
-				err_prn(fnc_nm,"Unable to locate attribute " +att->getText()+ " in input or output files.");
-				}
-				
-				// if att not found return undefined
-				if(prs_arg->ntl_scn && var==NULL_CEWI )
-				var=ncap_var_udf(att->getText().c_str());
-				
-				if(prs_arg->ntl_scn && var->val.vp !=NULL)
-				var->val.vp=(void*)nco_free(var->val.vp);
-				
-				
-#line 1576 "ncoTree.cpp"
+#line 1538 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1582,11 +1544,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VALUE_LIST);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2330 "ncoGrammer.g"
+#line 2594 "ncoGrammer.g"
 				
 				var=value_list(vlst);
 				
-#line 1590 "ncoTree.cpp"
+#line 1552 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1596,7 +1558,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NSTRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2335 "ncoGrammer.g"
+#line 2599 "ncoGrammer.g"
 				
 				char *tsng;
 				
@@ -1618,7 +1580,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				tsng=(char*)nco_free(tsng);      
 				
-#line 1622 "ncoTree.cpp"
+#line 1584 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1628,7 +1590,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,N4STRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2358 "ncoGrammer.g"
+#line 2622 "ncoGrammer.g"
 				
 				char *tsng;
 				
@@ -1656,7 +1618,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				tsng=(char*)nco_free(tsng);      
 				
-#line 1660 "ncoTree.cpp"
+#line 1622 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1666,9 +1628,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_FLOAT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2388 "ncoGrammer.g"
+#line 2652 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~float"),(nc_type)NC_FLOAT,false); else var=ncap_sclr_var_mk(SCS("~float"),static_cast<float>(std::strtod(val_float->getText().c_str(),(char **)NULL)));
-#line 1672 "ncoTree.cpp"
+#line 1634 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1678,9 +1640,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_DOUBLE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2390 "ncoGrammer.g"
+#line 2654 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~double"),(nc_type)NC_DOUBLE,false); else var=ncap_sclr_var_mk(SCS("~double"),strtod(val_double->getText().c_str(),(char **)NULL));
-#line 1684 "ncoTree.cpp"
+#line 1646 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1690,9 +1652,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_INT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2392 "ncoGrammer.g"
+#line 2656 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~int"),(nc_type)NC_INT,false); else var=ncap_sclr_var_mk(SCS("~int"),static_cast<nco_int>(std::strtol(val_int->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1696 "ncoTree.cpp"
+#line 1658 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1702,9 +1664,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_SHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2394 "ncoGrammer.g"
+#line 2658 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~short"),(nc_type)NC_SHORT,false); else var=ncap_sclr_var_mk(SCS("~short"),static_cast<nco_short>(std::strtol(val_short->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1708 "ncoTree.cpp"
+#line 1670 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1714,9 +1676,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_BYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2396 "ncoGrammer.g"
+#line 2660 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~byte"),(nc_type)NC_BYTE,false); else var=ncap_sclr_var_mk(SCS("~byte"),static_cast<nco_byte>(std::strtol(val_byte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1720 "ncoTree.cpp"
+#line 1682 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1726,9 +1688,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UBYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2401 "ncoGrammer.g"
+#line 2665 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~ubyte"),(nc_type)NC_UBYTE,false); else var=ncap_sclr_var_mk(SCS("~ubyte"),static_cast<nco_ubyte>(std::strtoul(val_ubyte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1732 "ncoTree.cpp"
+#line 1694 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1738,9 +1700,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_USHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2405 "ncoGrammer.g"
+#line 2669 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~ushort"),(nc_type)NC_USHORT,false); else var=ncap_sclr_var_mk(SCS("~ushort"),static_cast<nco_ushort>(std::strtoul(val_ushort->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1744 "ncoTree.cpp"
+#line 1706 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1750,9 +1712,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UINT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2407 "ncoGrammer.g"
+#line 2671 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~uint"),(nc_type)NC_UINT,false); else var=ncap_sclr_var_mk(SCS("~uint"),static_cast<nco_uint>(std::strtoul(val_uint->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1756 "ncoTree.cpp"
+#line 1718 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1762,9 +1724,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_INT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2409 "ncoGrammer.g"
+#line 2673 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~int64"),(nc_type)NC_INT64,false); else var=ncap_sclr_var_mk(SCS("~int64"),sng2nbr(val_int64->getText(),nco_int64_CEWI));
-#line 1768 "ncoTree.cpp"
+#line 1730 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1774,9 +1736,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UINT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2413 "ncoGrammer.g"
+#line 2677 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~uint64"),(nc_type)NC_UINT64,false); else var=ncap_sclr_var_mk(SCS("~uint64"),sng2nbr(val_uint64->getText(),nco_uint64_CEWI));
-#line 1780 "ncoTree.cpp"
+#line 1742 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1820,9 +1782,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				_t = __t291;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 2049 "ncoGrammer.g"
+#line 2217 "ncoGrammer.g"
 					var=ncap_var_var_op(var1,var2, PLUS );
-#line 1826 "ncoTree.cpp"
+#line 1788 "ncoTree.cpp"
 				}
 			}
 			else {
@@ -1865,9 +1827,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 					_t = __t295;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 2051 "ncoGrammer.g"
+#line 2219 "ncoGrammer.g"
 						var=ncap_var_var_op(var1,var2, MINUS );
-#line 1871 "ncoTree.cpp"
+#line 1833 "ncoTree.cpp"
 					}
 				}
 				else {
@@ -1918,11 +1880,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 						_t = __t300;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 2052 "ncoGrammer.g"
+#line 2220 "ncoGrammer.g"
 							
 							var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,true,prs_arg);      
 							
-#line 1926 "ncoTree.cpp"
+#line 1888 "ncoTree.cpp"
 						}
 					}
 					else {
@@ -1973,11 +1935,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 							_t = __t306;
 							_t = _t->getNextSibling();
 							if ( inputState->guessing==0 ) {
-#line 2055 "ncoGrammer.g"
+#line 2223 "ncoGrammer.g"
 								
 								var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,true,prs_arg);      
 								
-#line 1981 "ncoTree.cpp"
+#line 1943 "ncoTree.cpp"
 							}
 						}
 						else {
@@ -2028,11 +1990,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 								_t = __t312;
 								_t = _t->getNextSibling();
 								if ( inputState->guessing==0 ) {
-#line 2058 "ncoGrammer.g"
+#line 2226 "ncoGrammer.g"
 									
 									var=ncap_var_var_inc(var1,NULL_CEWI,INC,true,prs_arg);      
 									
-#line 2036 "ncoTree.cpp"
+#line 1998 "ncoTree.cpp"
 								}
 							}
 							else {
@@ -2083,11 +2045,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 									_t = __t318;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2061 "ncoGrammer.g"
+#line 2229 "ncoGrammer.g"
 										
 										var=ncap_var_var_inc(var1,NULL_CEWI,DEC,true,prs_arg);      
 										
-#line 2091 "ncoTree.cpp"
+#line 2053 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == MINUS)) {
@@ -2100,9 +2062,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 									_t = __t325;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2078 "ncoGrammer.g"
+#line 2246 "ncoGrammer.g"
 										var=ncap_var_var_op(var1,NULL_CEWI, MINUS );
-#line 2106 "ncoTree.cpp"
+#line 2068 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == PLUS)) {
@@ -2153,7 +2115,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 										_t = __t353;
 										_t = _t->getNextSibling();
 										if ( inputState->guessing==0 ) {
-#line 2253 "ncoGrammer.g"
+#line 2421 "ncoGrammer.g"
 											
 													
 													    // fxm: 4 Oct 2015
@@ -2180,37 +2142,209 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 											
 											
 											
-#line 2184 "ncoTree.cpp"
+#line 2146 "ncoTree.cpp"
 										}
 									}
-									else if ((_t->getType() == VAR_ID)) {
-										v = _t;
-										match(_t,VAR_ID);
-										_t = _t->getNextSibling();
-										if ( inputState->guessing==0 ) {
-#line 2282 "ncoGrammer.g"
-											
-											
-											var=prs_arg->ncap_var_init(v->getText(),true);
-											if(var== NULL){
-											if(prs_arg->ntl_scn){
-											var=ncap_var_udf(v->getText().c_str());
-											return var;
-											}else
-											nco_exit(EXIT_FAILURE);
+									else {
+										bool synPredMatched356 = false;
+										if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+											_t = ASTNULL;
+										if (((_t->getType() == ATT_ID))) {
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t;
+											synPredMatched356 = true;
+											inputState->guessing++;
+											try {
+												{
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t355 = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t;
+												match(_t,ATT_ID);
+												_t = _t->getFirstChild();
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t;
+												match(_t,LMT_LIST);
+												_t = _t->getNextSibling();
+												_t = __t355;
+												_t = _t->getNextSibling();
+												}
+											}
+											catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+												synPredMatched356 = false;
+											}
+											_t = __t356;
+											inputState->guessing--;
+										}
+										if ( synPredMatched356 ) {
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t357 = _t;
+											attl = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+											match(_t,ATT_ID);
+											_t = _t->getFirstChild();
+											lmtl = _t;
+											match(_t,LMT_LIST);
+											_t = _t->getNextSibling();
+											_t = __t357;
+											_t = _t->getNextSibling();
+											if ( inputState->guessing==0 ) {
+#line 2449 "ncoGrammer.g"
+												
+												
+												std::string att_nm=attl->getText();
+												std::string fnc_nm("att_lmt"); 
+												NcapVar *Nvar=NULL;
+												NcapVector<lmt_sct*> lmt_vtr;
+												
+												var_sct *var_att=NULL_CEWI; 
+												
+												
+												if(prs_arg->ntl_scn)
+												{ 
+												// only final scan for this attribute hyperslab 
+												var=ncap_var_udf(att_nm.c_str());
+												// can't return here -- have to use goto
+												goto attl_end; 
+												} 
+												
+												Nvar=prs_arg->var_vtr.find(attl->getText());
+												
+												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.");
+												
+														    lmt_mk(1L,lmtl,lmt_vtr);
+												
+												
+												if( lmt_vtr.size() != 1)
+												err_prn(fnc_nm,"Number of hyperslab limits for an attribute "+ att_nm+"must be one ");
+												
+												// fxm - very soon  
+												lmt_vtr[0]->nm=strdup("zz at attribute");    
+												(void)ncap_lmt_evl(1,lmt_vtr[0],var_att->sz,prs_arg); 
+												
+												// we have something to hyperslab
+												if( lmt_vtr[0]->cnt > 0)
+												{  
+												char *cp_in;
+												char *cp_out;  
+												long idx;
+												long srt=lmt_vtr[0]->srt;
+												long cnt=lmt_vtr[0]->cnt;
+												long srd=lmt_vtr[0]->srd; 
+												size_t slb_sz=nco_typ_lng(var_att->type); 
+												
+												/* create output att */
+												var=ncap_sclr_var_mk(att_nm,var_att->type,true);                 
+												(void)ncap_att_stretch(var,cnt);     
+												
+												cp_in=(char*)( var_att->val.vp); 
+												cp_in+= (ptrdiff_t)slb_sz*srt;
+												cp_out=(char*)var->val.vp; 
+												
+												idx=0;
+												
+												while(idx++ < cnt )
+												{ 
+												memcpy(cp_out, cp_in, slb_sz);                   
+												cp_in+=srd*slb_sz;
+												cp_out+=slb_sz; 
+												} 
+												
+												// if type NC_STRING then realloc ragged array  
+												if(var_att->type==NC_STRING)
+												{ 
+												idx=0;  
+												(void)cast_void_nctype((nc_type)NC_STRING,&var->val);                  
+												
+												while(idx<cnt)
+												var->val.sngp[idx]=strdup(var->val.sngp[idx++]);    
+												
+												
+												(void)cast_nctype_void((nc_type)NC_STRING,&var->val); 
+												
+												}  
+												
+												
+												}
+												else
+												{
+												err_prn(fnc_nm,"Hyperslab limits for attribute "+ att_nm+" doesn't include any elements");  
+												}
+												
+												nco_var_free(var_att);    
+												
+												attl_end: ; 
+												
+#line 2280 "ncoTree.cpp"
+											}
+										}
+										else if ((_t->getType() == VAR_ID)) {
+											v = _t;
+											match(_t,VAR_ID);
+											_t = _t->getNextSibling();
+											if ( inputState->guessing==0 ) {
+#line 2546 "ncoGrammer.g"
+												
+												
+												var=prs_arg->ncap_var_init(v->getText(),true);
+												if(var== NULL){
+												if(prs_arg->ntl_scn){
+												var=ncap_var_udf(v->getText().c_str());
+												return var;
+												}else
+												nco_exit(EXIT_FAILURE);
+												}
+												
+												// apply cast only if sz >1 
+												if(bcst && var->sz >1)
+												var=ncap_cst_do(var,var_cst,prs_arg->ntl_scn);
+												
+#line 2304 "ncoTree.cpp"
+											}
+										}
+										else if ((_t->getType() == ATT_ID)) {
+											att = _t;
+											match(_t,ATT_ID);
+											_t = _t->getNextSibling();
+											if ( inputState->guessing==0 ) {
+#line 2563 "ncoGrammer.g"
+												
+												
+												NcapVar *Nvar=NULL;
+												
+												if(prs_arg->ntl_scn)
+												Nvar=prs_arg->int_vtr.find(att->getText());
+												
+												if(Nvar==NULL) 
+												Nvar=prs_arg->var_vtr.find(att->getText());
+												
+												var=NULL_CEWI;    
+												if(Nvar !=NULL)
+												var=nco_var_dpl(Nvar->var);
+												else    
+												// Check input file for attribute
+												var=ncap_att_init(att->getText(),prs_arg);
+												
+												if(!prs_arg->ntl_scn && var==NULL_CEWI ){
+												err_prn(fnc_nm,"Unable to locate attribute " +att->getText()+ " in input or output files.");
+												}
+												
+												// if att not found return undefined
+												if(prs_arg->ntl_scn && var==NULL_CEWI )
+												var=ncap_var_udf(att->getText().c_str());
+												
+												if(prs_arg->ntl_scn && var->val.vp !=NULL)
+												var->val.vp=(void*)nco_free(var->val.vp);
+												
+												
+#line 2342 "ncoTree.cpp"
 											}
-											
-											// apply cast only if sz >1 
-											if(bcst && var->sz >1)
-											var=ncap_cst_do(var,var_cst,prs_arg->ntl_scn);
-											
-#line 2208 "ncoTree.cpp"
 										}
-									}
 		else {
 			throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
 		}
-		}}}}}}}
+		}}}}}}}}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
 		if( inputState->guessing == 0 ) {
@@ -2230,7 +2364,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 ) {
 #line 1469 "ncoGrammer.g"
 	var_sct *var;
-#line 2234 "ncoTree.cpp"
+#line 2368 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST assign_ntl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt = ANTLR_USE_NAMESPACE(antlr)nullAST;
@@ -2245,7 +2379,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	const std::string fnc_nm("assign_ntl"); 
 	var=NULL_CEWI;
 	
-#line 2249 "ncoTree.cpp"
+#line 2383 "ncoTree.cpp"
 	
 	try {      // for error handling
 		bool synPredMatched254 = false;
@@ -2258,10 +2392,10 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			try {
 				{
 				ANTLR_USE_NAMESPACE(antlr)RefAST __t253 = _t;
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t;
 				match(_t,LMT_LIST);
 				_t = _t->getNextSibling();
 				_t = __t253;
@@ -2314,7 +2448,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				(void)prs_arg->int_vtr.push_ow(Nvar);
 				}
 				
-#line 2318 "ncoTree.cpp"
+#line 2452 "ncoTree.cpp"
 			}
 		}
 		else {
@@ -2328,7 +2462,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				try {
 					{
 					ANTLR_USE_NAMESPACE(antlr)RefAST __t257 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t;
 					match(_t,VAR_ID);
 					_t = _t->getFirstChild();
 					{
@@ -2337,14 +2471,14 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					switch ( _t->getType()) {
 					case DMN_LIST:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						break;
 					}
 					case DMN_LIST_P:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t;
 						match(_t,DMN_LIST_P);
 						_t = _t->getNextSibling();
 						break;
@@ -2445,7 +2579,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					
 					bcst=false;   
 					
-#line 2449 "ncoTree.cpp"
+#line 2583 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -2497,7 +2631,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var=ncap_var_udf(var_nm.c_str());   
 					}  
 					
-#line 2501 "ncoTree.cpp"
+#line 2635 "ncoTree.cpp"
 				}
 			}
 			else {
@@ -2511,10 +2645,10 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					try {
 						{
 						ANTLR_USE_NAMESPACE(antlr)RefAST __t262 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t;
 						match(_t,LMT_LIST);
 						_t = _t->getNextSibling();
 						_t = __t262;
@@ -2532,7 +2666,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					att = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 					match(_t,ATT_ID);
 					_t = _t->getFirstChild();
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t;
 					match(_t,LMT_LIST);
 					_t = _t->getNextSibling();
 					_t = __t264;
@@ -2540,9 +2674,23 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					if ( inputState->guessing==0 ) {
 #line 1616 "ncoGrammer.g"
 						
-						;
 						
-#line 2546 "ncoTree.cpp"
+						//In Initial scan all newly defined atts are flagged as Undefined
+						var_sct *var1;
+						NcapVar *Nvar;
+						
+						if(nco_dbg_lvl_get() > nco_dbg_var) dbg_prn(fnc_nm,att->getText());
+						
+						var1=ncap_var_udf(att->getText().c_str());
+						
+						Nvar=new NcapVar(var1);
+						prs_arg->int_vtr.push_ow(Nvar);          
+						
+						// Copy return variable
+						var=nco_var_dpl(var1);    
+						
+						
+#line 2694 "ncoTree.cpp"
 					}
 				}
 				else {
@@ -2556,10 +2704,10 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						try {
 							{
 							ANTLR_USE_NAMESPACE(antlr)RefAST __t266 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t;
 							match(_t,ATT_ID);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t;
 							match(_t,LMT_DMN);
 							_t = _t->getNextSibling();
 							_t = __t266;
@@ -2577,17 +2725,17 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						att1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						_t = __t268;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1619 "ncoGrammer.g"
+#line 1634 "ncoGrammer.g"
 							
 							;
 							
-#line 2591 "ncoTree.cpp"
+#line 2739 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -2595,7 +2743,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1622 "ncoGrammer.g"
+#line 1637 "ncoGrammer.g"
 							
 							
 							//In Initial scan all newly defined atts are flagged as Undefined
@@ -2613,7 +2761,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							var=nco_var_dpl(var1);    
 							
 							
-#line 2617 "ncoTree.cpp"
+#line 2765 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -2637,9 +2785,9 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram
 ) {
-#line 1642 "ncoGrammer.g"
+#line 1657 "ncoGrammer.g"
 	var_sct *var;
-#line 2643 "ncoTree.cpp"
+#line 2791 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST assign_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt = ANTLR_USE_NAMESPACE(antlr)nullAST;
@@ -2647,14 +2795,15 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	ANTLR_USE_NAMESPACE(antlr)RefAST dmn = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	ANTLR_USE_NAMESPACE(antlr)RefAST lmta = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 1642 "ncoGrammer.g"
+#line 1657 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign"); 
 	var=NULL_CEWI;
 	
-#line 2658 "ncoTree.cpp"
+#line 2807 "ncoTree.cpp"
 	
 	try {      // for error handling
 		bool synPredMatched272 = false;
@@ -2667,10 +2816,10 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			try {
 				{
 				ANTLR_USE_NAMESPACE(antlr)RefAST __t271 = _t;
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t;
 				match(_t,LMT_LIST);
 				_t = _t->getNextSibling();
 				_t = __t271;
@@ -2694,7 +2843,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			_t = __t273;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1648 "ncoGrammer.g"
+#line 1663 "ncoGrammer.g"
 				
 				
 				int idx;
@@ -2773,7 +2922,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				slb_sz=1;        
 				// fill out limit structure
 				for(idx=0 ; idx < nbr_dmn ;idx++){
-				(void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],prs_arg);
+				(void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],-1,prs_arg);
 				// Calculate size
 				slb_sz *= lmt_vtr[idx]->cnt;
 				}
@@ -2834,7 +2983,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				var_lhs->sz=1;        
 				// fill out limit structure
 				for(idx=0 ; idx < nbr_dmn ;idx++){
-				(void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],prs_arg);
+				(void)ncap_lmt_evl(prs_arg->out_id,lmt_vtr[idx],-1,prs_arg);
 				// Calculate size
 				var_lhs->sz *= lmt_vtr[idx]->cnt;
 				}
@@ -2890,7 +3039,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				var=prs_arg->ncap_var_init(var_nm,true);
 				
 				
-#line 2894 "ncoTree.cpp"
+#line 3043 "ncoTree.cpp"
 			}
 		}
 		else {
@@ -2904,7 +3053,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				try {
 					{
 					ANTLR_USE_NAMESPACE(antlr)RefAST __t275 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t;
 					match(_t,VAR_ID);
 					_t = _t->getFirstChild();
 					{
@@ -2913,14 +3062,14 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					switch ( _t->getType()) {
 					case DMN_LIST:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						break;
 					}
 					case DMN_LIST_P:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t;
 						match(_t,DMN_LIST_P);
 						_t = _t->getNextSibling();
 						break;
@@ -2952,7 +3101,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				_t = __t278;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1845 "ncoGrammer.g"
+#line 1860 "ncoGrammer.g"
 					
 					
 					var_sct *var1;
@@ -3031,7 +3180,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var_cst=nco_var_free(var_cst); 
 					
 					
-#line 3035 "ncoTree.cpp"
+#line 3184 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -3039,7 +3188,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				match(_t,VAR_ID);
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1924 "ncoGrammer.g"
+#line 1939 "ncoGrammer.g"
 					
 					// Set class wide variables
 					var_sct *var_lhs=(var_sct*)NULL;
@@ -3108,7 +3257,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var=prs_arg->ncap_var_init(var_nm,true);               ;
 					
 					
-#line 3112 "ncoTree.cpp"
+#line 3261 "ncoTree.cpp"
 				}
 			}
 			else {
@@ -3122,10 +3271,10 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					try {
 						{
 						ANTLR_USE_NAMESPACE(antlr)RefAST __t280 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t;
 						match(_t,LMT_LIST);
 						_t = _t->getNextSibling();
 						_t = __t280;
@@ -3143,17 +3292,169 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					att = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 					match(_t,ATT_ID);
 					_t = _t->getFirstChild();
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t;
+					lmta = _t;
 					match(_t,LMT_LIST);
 					_t = _t->getNextSibling();
 					_t = __t282;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1993 "ncoGrammer.g"
+#line 2008 "ncoGrammer.g"
+						
+						
+						long srt,end,cnt,srd;  
+						std::string att_nm=att->getText();
+						std::string fnc_nm("att_lmt"); 
+						NcapVar *Nvar=NULL;
+						NcapVector<lmt_sct*> lmt_vtr;
+						
+						var_sct *var_lhs=NULL_CEWI; 
+						var_sct *var_rhs=NULL_CEWI; 
+						
+						if(prs_arg->ntl_scn)
+						{ 
+						// only final scan for this attribute hyperslab 
+						var=ncap_var_udf(att_nm.c_str());
+						// can't return here -- have to use goto
+						goto att_end; 
+						} 
+						
+						Nvar=prs_arg->var_vtr.find(att_nm);
+						
+						if(Nvar!=NULL)
+						var_lhs=nco_var_dpl(Nvar->var);
+						else    
+						var_lhs=ncap_att_init(att_nm,prs_arg);
+						
+						
+						if(var_lhs==NULL_CEWI )
+						err_prn(fnc_nm,"Unable to locate attribute " +att_nm+ " in input or output files.");
+						
+								    lmt_mk(1L,lmta,lmt_vtr);
+						
+						
+						if( lmt_vtr.size() != 1)
+						err_prn(fnc_nm,"Number of hyperslab limits for an attribute "+ att_nm+" must be one ");
+						
 						
-						;
+						lmt_vtr[0]->nm=strdup("zz at attribute");    
+						(void)ncap_lmt_evl(1,lmt_vtr[0],var_lhs->sz,prs_arg); 
 						
-#line 3157 "ncoTree.cpp"
+						if(lmt_vtr[0]->cnt==0)
+						err_prn(fnc_nm,"Hyperslab limits for attribute "+ att_nm+" doesn't include any elements");   
+						
+						srt=lmt_vtr[0]->srt;
+						cnt=lmt_vtr[0]->cnt;
+						srd=lmt_vtr[0]->srd; 
+						end=lmt_vtr[0]->end; 
+						
+						// get rhs can be anything as long as it is of size cnt 
+						var_rhs=out(att->getNextSibling());
+						
+						
+						
+						if( var_lhs->type==NC_STRING)
+						{ 
+						long szn; 
+						long idx; 
+						long cnt=0;  
+						char buffer[NC_MAX_ATTRS];  
+						
+						buffer[0]='\0';
+						
+						cast_void_nctype(NC_STRING, &var_lhs->val);    
+						cast_void_nctype(var_rhs->type, &var_rhs->val);     
+						
+						if( var_rhs->type==NC_STRING)
+						{
+						// check size
+						if(  var_rhs->sz!=1L &&  var_rhs->sz != cnt)   
+						err_prn(fnc_nm,"Hyperslab limits for attribute "+att_nm + " on LHS size="+nbr2sng(cnt)+ " doesnt match RHS size=" + nbr2sng(var_rhs->sz));
+						
+						
+						szn=(var_rhs->sz >1 ? 1: 0);     
+						for(idx=srt; idx<=end;idx+=srd)  
+						{
+						var_lhs->val.sngp[idx]=strdup(var_rhs->val.sngp[cnt]);    
+						cnt+=szn;
+						}
+						
+						
+						} 
+						
+						else if( var_rhs->type==NC_CHAR )
+						{ 
+						// if RHS is a char string then it reduces to  single NC_STRING regardless of size  
+						strncpy(buffer, var_rhs->val.cp , var_rhs->sz);   
+						buffer[var_rhs->sz]='\0';  
+						
+						for(idx=srt; idx<=end;idx+=srd)  
+						var_lhs->val.sngp[idx]=strdup(buffer);    
+						}
+						else 
+						{ 
+						err_prn(fnc_nm,"To hyperslab into a text NC_STRING The RHS type must alo be a text string of type NC_CHAR or NC_STRING"); 
+						} 
+						
+						cast_nctype_void(var_rhs->type, &var_rhs->val);    
+						cast_nctype_void(var_lhs->type, &var_lhs->val);    
+						
+						
+						
+						}
+						
+						
+						// deal with regular types   
+						if(var_lhs->type !=NC_STRING)
+						{  
+						char *cp_in;
+						char *cp_out;  
+						long idx;
+						long szn; 
+						
+						size_t slb_sz=nco_typ_lng(var_lhs->type); 
+						
+						// check size
+						if(  var_rhs->sz!=1L &&  var_rhs->sz != cnt)   
+						err_prn(fnc_nm,"Hyperslab limits for attribute "+att_nm + " on LHS size="+nbr2sng(cnt)+ " doesnt match RHS size=" + nbr2sng(var_rhs->sz));
+						
+						
+						nco_var_cnf_typ(var_lhs->type,var_rhs);               
+						
+						// if rhs size is one then simply copy across possibly multiple times
+						szn=(var_rhs->sz >1 ? 1: 0);   
+						
+						cp_in=(char*)(var_rhs->val.vp); 
+						
+						//cp_out=(char*)var_lhs->val.vp; 
+						
+						for(idx=srt; idx<=end;idx+=srd) 
+						{ 
+						cp_out=(char*)(var_lhs->val.vp)+slb_sz*idx;     
+						memcpy(cp_out,cp_in,slb_sz);  
+						cp_in+= szn;
+						}
+						
+						}
+						
+						nco_var_free(var_rhs);  
+						nco_lmt_free(lmt_vtr[0]); 
+						
+						Nvar=new NcapVar(var_lhs,att_nm);
+						
+						prs_arg->var_vtr.push_ow(Nvar);       
+						
+						// See If we have to return something
+						if(lmta->getFirstChild() && lmta->getFirstChild()->getType()==NORET)
+						var=NULL_CEWI;
+						else 
+						var=nco_var_dpl(var_lhs);               ;
+						
+						
+						att_end: ; 
+						
+						
+						
+#line 3458 "ncoTree.cpp"
 					}
 				}
 				else {
@@ -3167,10 +3468,10 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						try {
 							{
 							ANTLR_USE_NAMESPACE(antlr)RefAST __t284 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t;
 							match(_t,ATT_ID);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t;
 							match(_t,DMN_LIST);
 							_t = _t->getNextSibling();
 							_t = __t284;
@@ -3188,17 +3489,17 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						att1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						_t = __t286;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1996 "ncoGrammer.g"
+#line 2164 "ncoGrammer.g"
 							
 							;
 							
-#line 3202 "ncoTree.cpp"
+#line 3503 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -3206,7 +3507,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1999 "ncoGrammer.g"
+#line 2167 "ncoGrammer.g"
 							
 							
 							var_sct *var1;
@@ -3245,7 +3546,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							var=nco_var_dpl(var1);               ;
 							
 							
-#line 3249 "ncoTree.cpp"
+#line 3550 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -3267,14 +3568,14 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2423 "ncoGrammer.g"
+#line 2687 "ncoGrammer.g"
 	var_sct *var;
-#line 3273 "ncoTree.cpp"
+#line 3574 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST out_asn_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2423 "ncoGrammer.g"
+#line 2687 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign_asn");
 	var=NULL_CEWI; 
@@ -3282,7 +3583,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	NcapVar *Nvar;
 	
 	
-#line 3286 "ncoTree.cpp"
+#line 3587 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -3290,17 +3591,17 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		switch ( _t->getType()) {
 		case UTIMES:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t355 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t;
 			match(_t,UTIMES);
 			_t = _t->getFirstChild();
 			vid1 = _t;
 			match(_t,VAR_ID);
 			_t = _t->getNextSibling();
-			_t = __t355;
+			_t = __t359;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2433 "ncoGrammer.g"
+#line 2697 "ncoGrammer.g"
 				
 				if(vid1->getFirstChild())
 				err_prn(fnc_nm,"Invalid Lvalue " +vid1->getText() );
@@ -3318,7 +3619,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				
 				
-#line 3322 "ncoTree.cpp"
+#line 3623 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3328,7 +3629,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VAR_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2451 "ncoGrammer.g"
+#line 2715 "ncoGrammer.g"
 				
 				var_nm_s=vid->getText();  
 				if(vid->getFirstChild())
@@ -3349,7 +3650,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				
 				
-#line 3353 "ncoTree.cpp"
+#line 3654 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3359,7 +3660,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,ATT_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2472 "ncoGrammer.g"
+#line 2736 "ncoGrammer.g"
 				
 				// check "output"
 				NcapVar *Nvar=NULL;
@@ -3392,7 +3693,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				var->val.vp=(void*)nco_free(var->val.vp);
 				
 				
-#line 3396 "ncoTree.cpp"
+#line 3697 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3416,17 +3717,17 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2506 "ncoGrammer.g"
+#line 2770 "ncoGrammer.g"
 	var_sct *var;
-#line 3422 "ncoTree.cpp"
+#line 3723 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST value_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vlst = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2506 "ncoGrammer.g"
+#line 2770 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list");
 	var=NULL_CEWI; 
 	
-#line 3430 "ncoTree.cpp"
+#line 3731 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -3435,7 +3736,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 2511 "ncoGrammer.g"
+#line 2775 "ncoGrammer.g"
 			
 			
 			char *cp;
@@ -3523,7 +3824,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			var=var_ret;
 			
 			
-#line 3527 "ncoTree.cpp"
+#line 3828 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3542,20 +3843,20 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	 std::vector<var_sct*> &exp_vtr
 ) {
-#line 2602 "ncoGrammer.g"
+#line 2866 "ncoGrammer.g"
 	var_sct *var;
-#line 3548 "ncoTree.cpp"
+#line 3849 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST value_list_string_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
-#line 2602 "ncoGrammer.g"
+#line 2866 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list_string");
 	var=NULL_CEWI; 
 	
-#line 3555 "ncoTree.cpp"
+#line 3856 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if ( inputState->guessing==0 ) {
-#line 2608 "ncoGrammer.g"
+#line 2872 "ncoGrammer.g"
 			
 			int idx;
 			int nbr_lst;
@@ -3604,7 +3905,7 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			end_val: var=var_ret;
 			
 			
-#line 3608 "ncoTree.cpp"
+#line 3909 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3623,26 +3924,26 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	var_sct *var_msk
 ) {
-#line 2659 "ncoGrammer.g"
+#line 2923 "ncoGrammer.g"
 	bool bret=false;
-#line 3629 "ncoTree.cpp"
+#line 3930 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST where_assign_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2659 "ncoGrammer.g"
+#line 2923 "ncoGrammer.g"
 	
 	const std::string fnc_nm("where_assign");
 	var_sct *var_rhs;
 	
 	
-#line 3638 "ncoTree.cpp"
+#line 3939 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t360 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t364 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t;
 		match(_t,EXPR);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t361 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t365 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t;
 		match(_t,ASSIGN);
 		_t = _t->getFirstChild();
 		vid = _t;
@@ -3650,12 +3951,12 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 		_t = _t->getNextSibling();
 		var_rhs=out(_t);
 		_t = _retTree;
-		_t = __t361;
+		_t = __t365;
 		_t = _t->getNextSibling();
-		_t = __t360;
+		_t = __t364;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2665 "ncoGrammer.g"
+#line 2929 "ncoGrammer.g"
 			
 			
 			bool bfr=false;
@@ -3757,7 +4058,7 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			prs_arg->ncap_var_write(var_lhs,false);
 			bret=true;
 			
-#line 3761 "ncoTree.cpp"
+#line 4062 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3774,42 +4075,42 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2770 "ncoGrammer.g"
+#line 3034 "ncoGrammer.g"
 	var_sct *var;
-#line 3780 "ncoTree.cpp"
+#line 4081 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST var_lmt_one_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2770 "ncoGrammer.g"
+#line 3034 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 3789 "ncoTree.cpp"
+#line 4090 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t363 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t367 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t364 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t368 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t365 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t369 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t;
 		match(_t,LMT);
 		_t = _t->getFirstChild();
 		var_nbr=out(_t);
 		_t = _retTree;
-		_t = __t365;
+		_t = __t369;
 		_t = _t->getNextSibling();
-		_t = __t364;
+		_t = __t368;
 		_t = _t->getNextSibling();
-		_t = __t363;
+		_t = __t367;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2776 "ncoGrammer.g"
+#line 3040 "ncoGrammer.g"
 			
 			
 			int idx;
@@ -3851,7 +4152,7 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			if(prs_arg->FORTRAN_IDX_CNV)
 			srt--;
 			else if ( srt<0) 
-			srt+=var_rhs->sz-1; // deal with negative index 
+			srt+=var_rhs->sz; // deal with negative index 
 			
 			// do some bounds checking
 			if(srt >= var_rhs->sz || srt<0 )
@@ -3910,7 +4211,7 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			end0:       var_nbr=nco_var_free(var_nbr);
 			var_rhs=nco_var_free(var_rhs);   
 			
-#line 3914 "ncoTree.cpp"
+#line 4215 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3929,42 +4230,42 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram
 ) {
-#line 2881 "ncoGrammer.g"
+#line 3145 "ncoGrammer.g"
 	var_sct *var;
-#line 3935 "ncoTree.cpp"
+#line 4236 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST var_lmt_one_lhs_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2881 "ncoGrammer.g"
+#line 3145 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one_lhs");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 3944 "ncoTree.cpp"
+#line 4245 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t367 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t368 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t372 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t369 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t;
 		match(_t,LMT);
 		_t = _t->getFirstChild();
 		var_nbr=out(_t);
 		_t = _retTree;
-		_t = __t369;
+		_t = __t373;
 		_t = _t->getNextSibling();
-		_t = __t368;
+		_t = __t372;
 		_t = _t->getNextSibling();
-		_t = __t367;
+		_t = __t371;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2887 "ncoGrammer.g"
+#line 3151 "ncoGrammer.g"
 			
 			int idx; 
 			int var_id; 
@@ -4017,7 +4318,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			// fortran index convention   
 			if(prs_arg->FORTRAN_IDX_CNV)
 			srt--;
-			else if(srt<0) srt+=var_lhs->sz-1; //deal with negative index convention 
+			else if(srt<0) srt+=var_lhs->sz; //deal with negative index convention 
 			
 			// do some bounds checking on single limits
 			if(srt >= var_lhs->sz || srt<0 )
@@ -4058,7 +4359,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			// fortran index convention   
 			if(prs_arg->FORTRAN_IDX_CNV)
 			srt--;
-			else if(srt<0) srt+=var_lhs->sz-1; //deal with negative index convention 
+			else if(srt<0) srt+=var_lhs->sz; //deal with negative index convention 
 			
 			// do some bounds checking on single limits
 			if(srt >= var_lhs->sz || srt<0 )
@@ -4109,7 +4410,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			var_rhs=nco_var_free(var_rhs); 
 			var_nbr=nco_var_free(var_nbr); 
 			
-#line 4113 "ncoTree.cpp"
+#line 4414 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4126,31 +4427,31 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3035 "ncoGrammer.g"
+#line 3299 "ncoGrammer.g"
 	var_sct *var;
-#line 4132 "ncoTree.cpp"
+#line 4433 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST var_lmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 3035 "ncoGrammer.g"
+#line 3299 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt");
 	var=NULL_CEWI; 
 	
-#line 4141 "ncoTree.cpp"
+#line 4442 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t375 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
 		lmt = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getNextSibling();
-		_t = __t371;
+		_t = __t375;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3040 "ncoGrammer.g"
+#line 3304 "ncoGrammer.g"
 			
 			bool bram;   // Check for a RAM variable
 			bool bnrm;
@@ -4207,7 +4508,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			// fill out limit structure
 			for(idx=0 ; idx < nbr_dmn ;idx++)
-			(void)ncap_lmt_evl(var_rhs->nc_id,lmt_vtr[idx],prs_arg);
+			(void)ncap_lmt_evl(var_rhs->nc_id,lmt_vtr[idx],-1,prs_arg);
 			
 			// See if var can be normalized
 			for(idx=0; idx<nbr_dmn ; idx++){
@@ -4391,7 +4692,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			end2: var_rhs=nco_var_free(var_rhs); 
 			
-#line 4395 "ncoTree.cpp"
+#line 4696 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4524,7 +4825,6 @@ const char* ncoTree::tokenNames[] = {
 	"NUMBER",
 	"variable or function or attribute identifier",
 	"VAR_ATT_QT",
-	"STR_ATT_ID",
 	"STR_ATT_QT",
 	"DIM_QT",
 	"dimension identifier",
diff --git a/src/nco++/ncoTree.hpp b/src/nco++/ncoTree.hpp
index be2123e..9a9063d 100644
--- a/src/nco++/ncoTree.hpp
+++ b/src/nco++/ncoTree.hpp
@@ -12,7 +12,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2015 Charlie Zender
+/* Copyright (C) 1995--2016 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -534,10 +534,10 @@ protected:
 private:
 	static const char* tokenNames[];
 #ifndef NO_STATIC_CONSTS
-	static const int NUM_TOKENS = 119;
+	static const int NUM_TOKENS = 118;
 #else
 	enum {
-		NUM_TOKENS = 119
+		NUM_TOKENS = 118
 	};
 #endif
 	
diff --git a/src/nco++/nco_antlr_pst_prc.pl b/src/nco++/nco_antlr_pst_prc.pl
index d5ec8c8..d276af2 100755
--- a/src/nco++/nco_antlr_pst_prc.pl
+++ b/src/nco++/nco_antlr_pst_prc.pl
@@ -1,6 +1,7 @@
 #!/usr/bin/perl -w
 # Henry Butowsky 20080104
-# Usage: nco_antlr_pst_prc.pl < in_fl > out_fl   
+# Usage: nco_antlr_pst_prc.pl < in_fl > out_fl
+# cd ~/nco/src/nco++;antlr ncoGrammer.g;./nco_antlr_pst_prc.pl < ncoParserTokenTypes.hpp > ncoEnumTokenTypes.hpp
 
 # Removes #ifdef code where __cplusplus is checked.
 # The struct in ncoParserTokenTypes.hpp is deleted
diff --git a/src/nco/ESMC_CoordSys.h b/src/nco/ESMC_CoordSys.h
deleted file mode 100644
index 49ee160..0000000
--- a/src/nco/ESMC_CoordSys.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// $Id$
-//
-// Earth System Modeling Framework
-// Copyright 2002-2014, University Corporation for Atmospheric Research,
-// Massachusetts Institute of Technology, Geophysical Fluid Dynamics
-// Laboratory, University of Michigan, National Centers for Environmental
-// Prediction, Los Alamos National Laboratory, Argonne National Laboratory,
-// NASA Goddard Space Flight Center.
-// Licensed under the University of Illinois-NCSA License.
-//
-// ESMF Util C++ declaration include file
-//
-//-----------------------------------------------------------------------------
-//
-
-#ifndef ESMC_COORDSYS_H
-#define ESMC_COORDSYS_H
-
-
-enum ESMC_CoordSys_Flag {ESMC_COORDSYS_INVALID=-2,
-                    ESMC_COORDSYS_UNINIT,
-                    ESMC_COORDSYS_CART,
-                    ESMC_COORDSYS_SPH_DEG,
-                    ESMC_COORDSYS_SPH_RAD};
-
-// Constants for converting between radians and degrees
-// (These need to match the ones in ESMF_UtilTypes.F90) 
-
-/* csz 20150320
-   Define these only in main() files not in original location in ESMC_CoordSys.h  
-   Otherwise any file #including ESMC.h inadvertently includes these constants multiple times 
-   Should be defined as externals that resolve to single definition in main()
-   sudo cp ~/nco/src/nco/ESMC_CoordSys.h /usr/local/include */
-//const double ESMC_CoordSys_Deg2Rad= 0.01745329251994329547437;
-//const double ESMC_CoordSys_Rad2Deg=57.29577951308232286464772;
-
-#endif  // ESMC_COORDSYS_H
diff --git a/src/nco/ncatted.c b/src/nco/ncatted.c
index 5e1fbc7..e8a2b10 100644
--- a/src/nco/ncatted.c
+++ b/src/nco/ncatted.c
@@ -366,7 +366,7 @@ main(int argc,char **argv)
   fl_lst_in=nco_fl_lst_mk(argv,argc,optind,&fl_nbr,&fl_out,&FL_LST_IN_FROM_STDIN);
   if(fl_out) FL_OUT_NEW=True; else fl_out=(char *)strdup(fl_lst_in[0]);
 
-  if(nbr_aed == 0){
+  if(nbr_aed == 0 && gaa_nbr == 0){
     (void)fprintf(stdout,"%s: ERROR must specify an attribute to edit\n",nco_prg_nm);
     nco_usg_prn();
     nco_exit(EXIT_FAILURE);
@@ -446,8 +446,10 @@ main(int argc,char **argv)
     } /* end var_nm */
   } /* end loop over aed structures */
 
-  /* Catenate the time-stamped command line to the "history" global attribute */
+  /* Catenate time-stamped command line to "history" global attribute */
   if(HISTORY_APPEND) (void)nco_hst_att_cat(nc_id,cmd_ln);
+  if(gaa_nbr > 0) (void)nco_glb_att_add(nc_id,gaa_arg,gaa_nbr);
+  if(HISTORY_APPEND) (void)nco_vrs_att_cat(nc_id);
 
   /* Take output file out of define mode */
   if(hdr_pad == 0UL){
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index a06d47f..493cdba 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -251,7 +251,6 @@ main(int argc,char **argv)
   nco_bool PRN_VAR_METADATA=False; /* [flg] Print variable metadata */
   nco_bool PRN_VAR_METADATA_TGL=False; /* [flg] Toggle print variable metadata Option m */
   nco_bool PRN_VRB=False; /* [flg] Print data and metadata by default */
-  nco_bool PRN_NEW_FMT=False; /* [flg] Print using new print format */
   nco_bool RETAIN_ALL_DIMS=False; /* [flg] Retain all dimensions */
   nco_bool RAM_CREATE=False; /* [flg] Create file in RAM */
   nco_bool RAM_OPEN=False; /* [flg] Open (netCDF3-only) file(s) in RAM */
@@ -344,6 +343,7 @@ main(int argc,char **argv)
     {"xml_no_location",no_argument,0,0}, /* [flg] Omit XML location tag */
     {"ncml_no_location",no_argument,0,0}, /* [flg] Omit XML location tag */
     /* Long options with argument, no short option counterpart */
+    {"baa",required_argument,0,0}, /* [enm] Bit-Adjustment Algorithm */
     {"bfr_sz_hnt",required_argument,0,0}, /* [B] Buffer size hint */
     {"buffer_size_hint",required_argument,0,0}, /* [B] Buffer size hint */
     {"cnk_byt",required_argument,0,0}, /* [B] Chunk size in bytes */
@@ -391,10 +391,12 @@ main(int argc,char **argv)
     /* Long options with short counterparts */
     {"3",no_argument,0,'3'},
     {"4",no_argument,0,'4'},
-    {"64bit",no_argument,0,'4'},
+    {"64bit_offset",no_argument,0,'4'},
     {"netcdf4",no_argument,0,'4'},
-    {"pnetcdf",no_argument,0,'5'},
     {"5",no_argument,0,'5'},
+    {"64bit_data",no_argument,0,'5'},
+    {"cdf5",no_argument,0,'5'},
+    {"pnetcdf",no_argument,0,'5'},
     {"7",no_argument,0,'7'},
     {"abc",no_argument,0,'a'},
     {"alphabetize",no_argument,0,'a'},
@@ -505,6 +507,10 @@ main(int argc,char **argv)
 
     /* Process long options without short option counterparts */
     if(opt == 0){
+      if(!strcmp(opt_crr,"baa") || !strcmp(opt_crr,"bit_alg")){
+	nco_baa_cnv=(unsigned short int)strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
+	if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
+      } /* endif baa */
       if(!strcmp(opt_crr,"bfr_sz_hnt") || !strcmp(opt_crr,"buffer_size_hint")){
         bfr_sz_hnt=strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
         if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
@@ -685,11 +691,10 @@ main(int argc,char **argv)
       fl_out_fmt=NC_FORMAT_CLASSIC;
       break;
     case '4': /* Catch-all to prescribe output storage format */
-      if(!strcmp(opt_crr,"64bit")) fl_out_fmt=NC_FORMAT_64BIT; else fl_out_fmt=NC_FORMAT_NETCDF4; 
+      if(!strcmp(opt_crr,"64bit_offset")) fl_out_fmt=NC_FORMAT_64BIT_OFFSET; else fl_out_fmt=NC_FORMAT_NETCDF4; 
       break;
-    case '5': /* Print using new print format */
+    case '5': /* Request netCDF3 64-bit offset+data storage (i.e., pnetCDF) format */
       fl_out_fmt=NC_FORMAT_CDF5;
-      PRN_NEW_FMT=!PRN_NEW_FMT;
       break;
     case '6': /* Request netCDF3 64-bit offset output storage format */
       fl_out_fmt=NC_FORMAT_64BIT;
@@ -1088,7 +1093,7 @@ main(int argc,char **argv)
     prn_flg.xml=PRN_XML;
     prn_flg.trd=!(PRN_CDL || PRN_XML || PRN_JSN);
     if((prn_flg.cdl || prn_flg.xml) && nco_dbg_lvl >= nco_dbg_std) prn_flg.nfo_xtr=True; else prn_flg.nfo_xtr=False;
-    prn_flg.new_fmt=(PRN_CDL || PRN_JSN || PRN_SRM || PRN_XML || PRN_NEW_FMT);
+    prn_flg.new_fmt=(PRN_CDL || PRN_JSN || PRN_SRM || PRN_XML);
     prn_flg.hdn=PRN_HDN;
     prn_flg.rad=RETAIN_ALL_DIMS;
     /* CDL must print filename stub */
diff --git a/src/nco/nco.h b/src/nco/nco.h
index 52d0f7a..b9ac419 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -83,6 +83,25 @@ extern "C" {
 # define False 0
 #endif /* False */
   
+/* 20151207: Reports that Cygwin math.h does not define M_LN10 or M_LN2
+   20160209: More reports that Cygwin math.h does not define M_PI
+   math.h does not necessarily define these constants in C99 mode
+   They are usually defined on Linux and MacOSX but not Cygwin
+   Linux math.h says these constants are POSIX/UNIX extensions to the C standard,
+   and only defines them when __DARWIN_C_LEVEL >= 199506L
+   NCO uses these math constants in nco_aux.c (M_PI), nco_ppc.c (M_LN2,M_LN10), and nco_rgr.c (M_PI)
+   Rather than have backup-definitions in the three corresponding .h files, 
+   we #ifndef all necessary math constants once in the common header nco.h */
+#ifndef M_LN10
+# define M_LN10      2.30258509299404568401799145468436421   /* loge(10)       */
+#endif /* M_LN10 */
+#ifndef M_LN2
+# define M_LN2       0.693147180559945309417232121458176568  /* loge(2)        */
+#endif /* M_LN2 */
+#ifndef M_PI
+#define M_PI        3.14159265358979323846264338327950288   /* pi             */
+#endif /* M_PI */
+
   /* Variables marked CEWI "Compiler Error Warning Initialization" are initialized
      to prevent spurious "warning: `float foo' might be used uninitialized in 
      this function" warnings when, e.g., GCC -Wuninitialized is turned on.
@@ -199,6 +218,7 @@ extern "C" {
   char *nco_not_mss_val_sng_get(void); /* [sng] Not missing value attribute name */
   char *nco_prg_nm_get(void);
   int nco_prg_id_get(void);
+  unsigned short nco_baa_cnv_get(void);
   unsigned short nco_dbg_lvl_get(void);
   unsigned short nco_fmt_xtn_get(void);
   unsigned short nco_mrd_cnv_get(void);
@@ -216,6 +236,9 @@ extern "C" {
   char *nco_prg_nm; /* [sng] Program name */
   char *nco_prg_nm_get(void){return nco_prg_nm;} /* [sng] Program name */
   
+  unsigned short nco_baa_cnv=0; /* [enm] Bit-Adjustment Algorithm */
+  unsigned short nco_baa_cnv_get(void){return nco_baa_cnv;} /* [enm] Bit-Adjustment Algorithm */
+
   unsigned short nco_dbg_lvl=0; /* [enm] Debugging level */
   unsigned short nco_dbg_lvl_get(void){return nco_dbg_lvl;} /* [enm] Debugging level */
 
@@ -296,17 +319,17 @@ extern "C" {
 # define NCO_VERSION_MINOR 5
 #endif /* !NCO_VERSION_MINOR */
 #ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 4
+# define NCO_VERSION_PATCH 5
 #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  "alpha07" /* 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.5.4"
+# define NCO_VERSION "4.5.5"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -619,6 +642,7 @@ extern "C" {
     nco_op_mabs, /* [enm] Maximum absolute value */
     nco_op_mebs, /* [enm] Mean absolute value */
     nco_op_mibs, /* [enm] Minimum absolute value */
+    nco_op_tabs, /* [enm] Total absolute value */
     nco_op_nil /* [enm] Nil or undefined operation type */
   }; /* end nco_op_typ enum */
 
@@ -658,9 +682,15 @@ extern "C" {
 
   enum nco_rth_cnv{ /* [enm] Arithmetic convention to assume */
     nco_rth_flt_flt, /* 0 Keep single-precision floating point (NCO default through version 4.3.5 20130927) */
-    nco_rth_flt_dbl  /* 1 Promote single-precision floating point to double before arithmetic (NCO default since version 4.3.6 20130927)*/
+    nco_rth_flt_dbl  /* 1 Promote single-precision floating point to double before arithmetic (NCO default since version 4.3.6 20130927) */
   }; /* end nco_rth_cnv */
 
+  enum nco_baa_cnv{ /* [enm] Bit-Adjustment Algorithm to use */
+    nco_baa_grm, /* 0 Bit Groom (NCO default since inception) */
+    nco_baa_shv, /* 1 Bit Shave (option since 20160117) */
+    nco_baa_set, /* 2 Bit Set (option since 20160117) */
+  }; /* end nco_baa_cnv */
+
   enum nco_upk_cnv{ /* [enm] Unpacking convention to assume */
     /* netCDF convention  : http://www.unidata.ucar.edu/software/netcdf/docs/netcdf/Attribute-Conventions.html
        HDF/NASA convention: http://modis-atmos.gsfc.nasa.gov/MOD08_D3/faq.html */
@@ -1130,6 +1160,7 @@ extern "C" {
     /* Following are members only used by transformation operators (non-ncks) */
     nco_bool flg_dmn_avg;    /* [flg] Diferentiate between dimensions to average or keep for this variable (ncwa) */  
     nco_bool flg_rdd;        /* [flg] Retain dimension as degenerate (size 1) (ncwa) */  
+    nco_bool flg_rvr;        /* [flg] Reverse dimension (option -a - of ncpdq) FXM_PVN */
   } var_dmn_sct; 
 
   /* Processing type enumerator */
diff --git a/src/nco/nco_att_utl.c b/src/nco/nco_att_utl.c
index 1944f0c..e2a1951 100644
--- a/src/nco/nco_att_utl.c
+++ b/src/nco/nco_att_utl.c
@@ -1122,24 +1122,24 @@ nco_prs_aed_lst /* [fnc] Parse user-specified attribute edits into structure lis
      
      One mode must be set for each edited attribute: append (a), create (c), delete (d), modify (m), or overwrite (o).
      -a: Attribute append mode
-     Append value att_val to current var_nm attribute att_nm value att_val, if any. 
-     If var_nm does not have an attribute att_nm, there is no effect.
+     Append value att_val to current var_nm attribute att_nm value att_val, if any
+     If var_nm does not have an attribute att_nm, there is no effect
      
      -c: Attribute create mode
-     Create variable var_nm attribute att_nm with att_val if att_nm does not yet exist. 
-     If var_nm already has an attribute att_nm, there is no effect.
+     Create variable var_nm attribute att_nm with att_val if att_nm does not yet exist
+     If var_nm already has an attribute att_nm, there is no effect
      
      -d: Attribute delete mode
-     Delete current var_nm attribute att_nm.
-     If var_nm does not have an attribute att_nm, there is no effect.
+     Delete current var_nm attribute att_nm
+     If var_nm does not have an attribute att_nm, there is no effect
      
      -m: Attribute modify mode
-     Change value of current var_nm attribute att_nm to value att_val.
-     If var_nm does not have an attribute att_nm, there is no effect.
+     Change value of current var_nm attribute att_nm to value att_val
+     If var_nm does not have an attribute att_nm, there is no effect
      
      -o: Attribute overwrite mode
-     Write attribute att_nm with value att_val to variable var_nm, overwriting existing attribute att_nm, if any.
-     This is default mode. */
+     Write attribute att_nm with value att_val to variable var_nm, overwriting existing attribute att_nm, if any
+     This is default mode */
   
   aed_sct *aed_lst;
   
diff --git a/src/nco/nco_att_utl.h b/src/nco/nco_att_utl.h
index ee70ade..6236aa4 100644
--- a/src/nco/nco_att_utl.h
+++ b/src/nco/nco_att_utl.h
@@ -18,6 +18,7 @@
 #endif /* !HAVE_CONFIG_H */
 
 /* Standard header files */
+#include <math.h> /* sin cos cos sin 3.14159 isfinite isinf isnan */
 #include <stdio.h> /* stderr, FILE, NULL, printf */
 #include <string.h> /* strcmp() */
 #ifdef HAVE_STRINGS_H
diff --git a/src/nco/nco_cnf_typ.c b/src/nco/nco_cnf_typ.c
index 8e508f6..4691a2e 100644
--- a/src/nco/nco_cnf_typ.c
+++ b/src/nco/nco_cnf_typ.c
@@ -872,6 +872,8 @@ nco_val_cnf_typ /* [fnc] Copy val_in and typecast from typ_in to typ_out */
     } break;
   case NC_DOUBLE:
     switch(typ_in){
+      /* 20160114: Unclear whether implicit coercion to promote NaNf to NaN works (needed for chlorophyll variable in MODIS_L2N_20140304T1120.nc) */
+      //    case NC_FLOAT: if(isfinite(*val_in.fp)) *val_out.dp=*val_in.fp; else *val_out.dp=NC_MIN_DOUBLE; break; 
     case NC_FLOAT: *val_out.dp=*val_in.fp; break; 
     case NC_DOUBLE: *val_out.dp=*val_in.dp; break; 
     case NC_INT: *val_out.dp=*val_in.ip; break;
@@ -1053,7 +1055,7 @@ nco_val_cnf_typ /* [fnc] Copy val_in and typecast from typ_in to typ_out */
      value and are thus purely local to this routine. The only thing changed by this
      routine is the contents of the location pointed to by the pointer to the output value. */
   
-} /* end nco_val_cnf_typ */
+} /* end nco_val_cnf_typ() */
 
 int /* O [enm] Dummy return */
 nco_scv_cnf_typ /* [fnc] Convert scalar attribute to typ_new using C implicit coercion */
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index d50d0f4..bd996c8 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -843,7 +843,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 "Capital Grille\n";
+  return "VESL SUP\n";
 } /* end nco_nmn_get() */
 
 char * /* O [sng] nm_in stripped of any path (i.e., program name stub) */ 
@@ -1006,9 +1006,9 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"[-7]")) (void)fprintf(stdout,"-7, --7, --fl_fmt=netcdf4_classic\tOutput file in netCDF4 CLASSIC format (3+4=7)\n");
   if(strstr(opt_sng,"[-A]")) (void)fprintf(stdout,"-A, --apn, --append\tAppend to existing output file, if any\n");
   if(strstr(opt_sng,"[-a")){
-    if(prg_lcl == ncatted) (void)fprintf(stdout,"-a, --attribute att_nm,var_nm,mode,att_typ,att_val Attribute specification:\n\t\t\tmode = a,c,d,m,o and att_typ = f,d,l,s,c,b\n");
+    if(prg_lcl == ncatted) (void)fprintf(stdout,"-a, --attribute att_nm,var_nm,mode,att_typ,att_val Attribute specification:\n\t\t\tmode = a,c,d,m,o (append, create, delete, modify, overwrite)\n\t\t\tatt_typ = f,d,l/i,s,c,b (float, double, long/int, short, char, byte)\n");
 #ifdef ENABLE_NETCDF4
-    if(prg_lcl == ncatted) (void)fprintf(stdout,"\t\t\tnetCDF4 att_typ's = ub,us,u,ll,ull\n");
+    if(prg_lcl == ncatted) (void)fprintf(stdout,"\t\t\tnetCDF4 types = ub,us,u,ll,ull,sng (unsigned byte, u. short, u. int, long long int, u. long long int, string)\n");
 #endif /* !ENABLE_NETCDF4 */
     if(prg_lcl == ncks) (void)fprintf(stdout,"-a, --abc, --alphabetize\tDisable alphabetization of extracted variables\n");
     if(prg_lcl == ncpdq) (void)fprintf(stdout,"-a, --arrange, --permute, --reorder, --rdr [-]rdr_dim1[,[-]rdr_dim2[...]] Re-order dimensions\n");
@@ -1154,7 +1154,7 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"--xtn_var")) (void)fprintf(stdout,"    --xtn_var, --extensive var\tExtensive variables for regridding (summed not averaged)\n");
   if(strstr(opt_sng,"[-y op_typ]")){
     if(prg_lcl == ncbo)(void)fprintf(stdout,"-y, --op_typ, --operation op_typ\tBinary arithmetic operation: add,sbt,mlt,dvd (+,-,*,/)\n");
-    if(prg_lcl == ncra || prg_lcl == ncfe || prg_lcl == ncge || prg_lcl == ncwa)(void)fprintf(stdout,"-y, --op_typ, --operation op_typ\tArithmetic operation: avg,mabs,mebs,mibs,min,max,ttl,sqravg,avgsqr,sqrt,rms,rmssdn\n");
+    if(prg_lcl == ncra || prg_lcl == ncfe || prg_lcl == ncge || prg_lcl == ncwa)(void)fprintf(stdout,"-y, --op_typ, --operation op_typ\tArithmetic operation: avg,mabs,mebs,mibs,min,max,tabs,ttl,sqravg,avgsqr,sqrt,rms,rmssdn\n");
   }
   /* All operators have input files, no need to strstr(in.nc) */
   if(prg_lcl == ncbo || prg_lcl == ncflint){
diff --git a/src/nco/nco_fl_utl.c b/src/nco/nco_fl_utl.c
index d1ab409..1df3e58 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -62,9 +62,9 @@ nco_create_mode_prs /* [fnc] Parse user-specified file format */
   if(strcasestr("classic",fl_fmt_sng) && !strcasestr(fl_fmt_sng,"netcdf4")){
     /* If "classic" contains string and string does not contain "netcdf4" */
     *fl_fmt_enm=NC_FORMAT_CLASSIC;
-  }else if(strcasestr("64bit",fl_fmt_sng)){
-    /* If "64bit" contains string */
-    *fl_fmt_enm=NC_FORMAT_64BIT;
+  }else if(strcasestr("64bit_offset",fl_fmt_sng)){
+    /* If "64bit_offset" contains string */
+    *fl_fmt_enm=NC_FORMAT_64BIT_OFFSET;
   }else if(strcasestr(fl_fmt_sng,"netcdf4")){
     /* If string contains "netcdf4" */
 #ifdef ENABLE_NETCDF4
@@ -76,18 +76,18 @@ nco_create_mode_prs /* [fnc] Parse user-specified file format */
       *fl_fmt_enm=NC_FORMAT_NETCDF4_CLASSIC;
     } /* endif NETCDF4 */
 #else /* !ENABLE_NETCDF4 */
-    (void)fprintf(stderr,"%s: ERROR This NCO was not built with netCDF4 and cannot create the requested netCDF4 file format. HINT: Re-try with netCDF3 file format, either by omitting the filetype specification, or by explicitly specifying the \"-3\", \"--fl_fmt=classic\", \"-6\",  or \"--fl_fmt=64bit\" options.\n",nco_prg_nm_get());
+    (void)fprintf(stderr,"%s: ERROR This NCO was not built with netCDF4 and cannot create the requested netCDF4 file format. HINT: Re-try with netCDF3 file format, either by omitting the filetype specification, or by explicitly specifying the \"-3\", \"--fl_fmt=classic\", \"-6\",  or \"--fl_fmt=64bit_offset\" options.\n",nco_prg_nm_get());
     nco_exit(EXIT_FAILURE);
 #endif /* !ENABLE_NETCDF4 */
-  }else if(strcasestr("pnetcdf",fl_fmt_sng)){
-#ifdef ENABLE_MPI
-    /* If "pnetcdf" contains string */
-    *fl_fmt_enm=NC_FORMAT_CDF5;
-#else /* !ENABLE_MPI */
-    (void)fprintf(stderr,"%s: ERROR This NCO was not built with PnetCDF (http://trac.mcs.anl.gov/projects/parallel-netcdf) and cannot create the requested PnetCDF file format. HINT: Re-try with supported file format such as \"classic\" or \"64bit\".\n",nco_prg_nm_get());
-#endif /* !ENABLE_MPI */
+  }else if(strcasestr("64bit_data",fl_fmt_sng) || strcasestr("pnetcdf",fl_fmt_sng) || strcasestr(fl_fmt_sng,"cdf5")){
+    /* If "64bit_data" contains string or "pnetcdf" contains string or string contains "cdf5" */
+    if(NC_LIB_VERSION >= 440){
+      *fl_fmt_enm=NC_FORMAT_CDF5;
+    }else{
+      (void)fprintf(stderr,"%s: ERROR This NCO was not built with PnetCDF (http://trac.mcs.anl.gov/projects/parallel-netcdf) capabilities and cannot create the requested PnetCDF file format. PnetCDF was introduced in the base netCDF library in version 4.4.0 in January, 2016. HINT: Re-try with requisite library version or select a supported file format such as \"classic\" or \"64bit_offset\".\n",nco_prg_nm_get());
+    } /* !NC_LIB_VERSION */
   }else{
-    (void)fprintf(stderr,"%s: ERROR Unknown output file format \"%s\" requested. Valid formats are (unambiguous leading characters of) \"classic\", \"64bit\", \"netcdf4\", and \"netcdf4_classic\".\n",nco_prg_nm_get(),fl_fmt_sng);
+    (void)fprintf(stderr,"%s: ERROR Unknown output file format \"%s\" requested. Valid formats are (unambiguous leading characters of) \"classic\", \"64bit_offset\",%s \"netcdf4\", and \"netcdf4_classic\".\n",nco_prg_nm_get(),fl_fmt_sng,(NC_LIB_VERSION >= 440) ? "\"64bit_data\"," : "");
     nco_exit(EXIT_FAILURE);
   } /* endif fl_fmt_enm */
 
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 6239bd2..25adbcc 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -4552,7 +4552,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
           found_dim=True;
           /* If dimension was to be record keep it that way, otherwise define degenerate size of 1 */
           if(DFN_CRR_DMN_AS_REC_IN_OUTPUT) dmn_cnt=NC_UNLIMITED; else dmn_cnt=1L;
-        } 
+        } /* endif */
         if(!found_dim){
           DEFINE_DIM[idx_dmn]=False;
           nbr_dmn_var_out--;    
@@ -4563,8 +4563,9 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
       if(DEFINE_DIM[idx_dmn]){
         /* Define dimension and obtain dimension ID */
         (void)nco_def_dim(grp_dmn_out_id,dmn_nm,dmn_cnt,&dmn_id_out);
+	if(dmn_cnt == NC_UNLIMITED) rec_dmn_out_id=dmn_id_out; else rec_dmn_out_id=NCO_REC_DMN_UNDEFINED;
 
-        if(nco_dbg_lvl_get() == nco_dbg_dev) (void)fprintf(stdout,"%s: DEBUG %s Defined dimension <%s><%s>#%d\n",nco_prg_nm_get(),fnc_nm,grp_dmn_out_fll,dmn_nm,dmn_id_out);
+        if(nco_dbg_lvl_get() == nco_dbg_dev) (void)fprintf(stdout,"%s: DEBUG %s Defined dimension %s/%s ID %d\n",nco_prg_nm_get(),fnc_nm,grp_dmn_out_fll,dmn_nm,dmn_id_out);
 
         /* Assign defined ID to dimension ID array for the variable */
         dmn_out_id[idx_dmn]=dmn_id_out; 
@@ -4592,7 +4593,7 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
       } /* endif */
     } /* !ncwa */
 
-    /* Construct full dimension name using the full group name */
+    /* Construct full dimension name using full group name */
     dmn_nm_fll_out=(char *)nco_malloc(strlen(grp_dmn_out_fll)+strlen(dmn_nm)+2L);
     strcpy(dmn_nm_fll_out,grp_dmn_out_fll);
     if(strcmp(grp_dmn_out_fll,"/")) strcat(dmn_nm_fll_out,"/");
@@ -4602,8 +4603,10 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
     (void)nco_dfn_dmn(dmn_nm_fll_out,dmn_cnt,dmn_id_out,dmn_cmn,var_trv->nbr_dmn);
 
     /* Die informatively if record dimension is not first dimension in netCDF3 output */
-    if(idx_dmn > 0 && dmn_out_id[idx_dmn] == rec_dmn_out_id && fl_fmt != NC_FORMAT_NETCDF4 && DEFINE_DIM[idx_dmn]){
-      (void)fprintf(stdout,"%s: ERROR User defined the output record dimension to be \"%s\". Yet in the variable \"%s\" this is dimension number %d. The output file adheres to the netCDF3 API which only supports the record dimension as the first (i.e., least rapidly varying) dimension. Consider using ncpdq to permute the location of the record dimension in the output file.\n",nco_prg_nm_get(),rec_dmn_nm,var_nm,idx_dmn+1);  
+    /* 20160122: This would be a helpful error message yet it currently triggers five false-positive ncpdq failures
+       Suspect incorrect conditions tested, if-clause entered, and program exits and causes regression test failures */
+    if(False && idx_dmn > 0 && dmn_out_id[idx_dmn] == rec_dmn_out_id && DEFINE_DIM[idx_dmn] && fl_fmt != NC_FORMAT_NETCDF4){
+      (void)fprintf(stdout,"%s: ERROR User defined output record dimension to be \"%s\". Yet in the variable \"%s\" this is dimension number %d. The output file adheres to the netCDF3 API which only supports the record dimension as the first (i.e., least rapidly varying) dimension. Consider using ncpdq to permute the location of the record dimension in the output file.\n",nco_prg_nm_get(),rec_dmn_nm,var_nm,idx_dmn+1);  
       nco_exit(EXIT_FAILURE);
     } /* end if err */
 
@@ -4617,14 +4620,22 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
   if(var_trv->flg_rdr){
     /* Must be ncpdq */
     assert(nco_prg_id == ncpdq);
-    for(int dmn_out_idx=0;dmn_out_idx<nbr_dmn_var;dmn_out_idx++)
-      dmn_idx_in_out[var_trv->dmn_idx_out_in[dmn_out_idx]]=dmn_out_idx;
+    for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++)
+      dmn_idx_in_out[var_trv->dmn_idx_out_in[idx_dmn]]=idx_dmn;
+
+    for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++)
+      dmn_out_id_tmp[idx_dmn]=dmn_out_id[idx_dmn];
 
-    for(int dmn_out_idx=0;dmn_out_idx<nbr_dmn_var;dmn_out_idx++)
-      dmn_out_id_tmp[dmn_out_idx]=dmn_out_id[dmn_out_idx];
+    for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++)
+      dmn_out_id[dmn_idx_in_out[idx_dmn]]=dmn_out_id_tmp[idx_dmn];
 
-    for(int dmn_out_idx=0;dmn_out_idx<nbr_dmn_var;dmn_out_idx++)
-      dmn_out_id[dmn_idx_in_out[dmn_out_idx]]=dmn_out_id_tmp[dmn_out_idx];
+    if (nco_dbg_lvl_get() >= nco_dbg_dev){
+      (void)fprintf(stdout, "%s: DEBUG %s dimensions for %s:\n",nco_prg_nm_get(),fnc_nm,var_trv->nm_fll);
+      for (int idx_dmn=0; idx_dmn<nbr_dmn_var;idx_dmn++){
+        char *dmm_nm_fll=nco_get_dmn_nm_fll(dmn_out_id[idx_dmn],dmn_cmn,nbr_dmn_var);
+        (void)fprintf(stdout, "%s %d\n",dmm_nm_fll,dmn_cmn[idx_dmn].id);
+      }
+    }
   } /* !var_trv->rdr */
 
   if(nco_prg_id == ncecat && rec_dmn_nm && var_trv->enm_prc_typ == prc_typ){ 
@@ -4704,8 +4715,8 @@ nco_cpy_var_dfn_trv                 /* [fnc] Define specified variable in output
   } /* !ncwa */
 
   if(nco_dbg_lvl_get() == nco_dbg_dev){
-    (void)fprintf(stdout,"%s: DEBUG %s Defined variable <%s><%s> : ",nco_prg_nm_get(),fnc_nm,grp_out_fll,var_nm);
-    for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++) (void)fprintf(stdout,"<%s>#%d SIZE=%ld : ",dmn_cmn[idx_dmn].nm_fll,dmn_out_id[idx_dmn],dmn_cmn[idx_dmn].sz);
+    (void)fprintf(stdout,"%s: DEBUG %s Defined variable %s/%s: ",nco_prg_nm_get(),fnc_nm,grp_out_fll,var_nm);
+    for(int idx_dmn=0;idx_dmn<nbr_dmn_var;idx_dmn++) (void)fprintf(stdout,"name,ID,sz = %s,%d,%ld : ",dmn_cmn[idx_dmn].nm_fll,dmn_out_id[idx_dmn],dmn_cmn[idx_dmn].sz);
     (void)fprintf(stdout,"\n");
   } /* endif dbg */ 
 
@@ -4872,50 +4883,18 @@ nco_dfn_dmn                            /* [fnc] Define dimension size and ID in
 
 } /* nco_dmn_dfn */
 
-void
-nco_dmn_rdr_trv                        /* [fnc] Transfer dimension structures to be re-ordered (ncpdq) into GTT */
-(int **dmn_idx_out_in,                 /* I [idx] Dimension correspondence, output->input, output of nco_var_dmn_rdr_mtd() */
- const int nbr_var_prc,                /* I [nbr] Size of above array (number of processed variables) */
- var_sct **var_prc_out,                /* I [sct] Processed variables */
- trv_tbl_sct * const trv_tbl)          /* I/O [sct] Traversal table */
+char *
+nco_get_dmn_nm_fll                     /* [fnc] Return dimension name with input id (debug) */
+(const int dmn_id,                     /* I [id] ID of dimension */
+ const dmn_cmn_sct * const dmn_cmn,    /* I [sct] Dimension structure array */
+ const int nbr_dmn)                    /* I [nbr] Number of dimensions (size of above array) */
 {
-  /* Purpose: Transfer dimension structures to be re-ordered (ncpdq) into GTT */
-
-  assert(nco_prg_id_get() == ncpdq);
-
-  /* Loop processed variables */
-  for(int idx_var_prc=0;idx_var_prc<nbr_var_prc;idx_var_prc++){
-
-    /* Loop table */
-    for(unsigned idx_var=0;idx_var<trv_tbl->nbr;idx_var++){
-      trv_sct var_trv=trv_tbl->lst[idx_var];
-
-      /* If GTT variable object is to extract */
-      if(var_trv.nco_typ == nco_obj_typ_var && var_trv.flg_xtr){ 
-
-        /* Match by full variable name  */
-        if(!strcmp(var_prc_out[idx_var_prc]->nm_fll,var_trv.nm_fll)){
-
-          /* Mark re-order flag */
-          trv_tbl->lst[idx_var].flg_rdr=True;
-
-          assert(var_trv.nbr_dmn==var_prc_out[idx_var_prc]->nbr_dim);
-
-          /* Loop variable dimensions */
-          for(int idx_var_dmn=0;idx_var_dmn<var_trv.nbr_dmn;idx_var_dmn++){
-
-            /* Transfer */
-            trv_tbl->lst[idx_var].dmn_idx_out_in[idx_var_dmn]=dmn_idx_out_in[idx_var_prc][idx_var_dmn];
-
-          } /* Loop variable dimensions */
-        } /* Match by full variable name  */
-      } /* If GTT variable object is to extract */
-    } /* Loop table */
-  } /* Loop processed variables */
-
-  return;
+  /* Loop dimensions */
+  for(int idx_dmn=0;idx_dmn<nbr_dmn;idx_dmn++)
+    if(dmn_id == dmn_cmn[idx_dmn].id) return dmn_cmn[idx_dmn].nm_fll;
 
-} /* end nco_dmn_rdr_trv() */
+  return "ERROR";
+} /* nco_get_dmn_nm_fll() */
 
 void
 nco_var_dmn_rdr_mtd_trv /* [fnc] Set new dimensionality in metadata of each re-ordered variable */
@@ -4979,6 +4958,17 @@ nco_var_dmn_rdr_mtd_trv /* [fnc] Set new dimensionality in metadata of each re-o
       rec_dmn_nm_out=(char *)strdup(rec_dmn_nm->lst[0].nm);
     } /* !rec_dmn_nm->lst */
 
+#ifdef FXM_PVN
+    nco_bool dmn_rvr_rdr_[NC_MAX_DIMS]; /* [flg] Reverse dimension */
+    /* Define a local dmn_rvr_rdr array upon reverse flag defined in dimensions for variable */
+    for(int idx_dmn=0;idx_dmn<var_trv->nbr_dmn;idx_dmn++){
+      dmn_rvr_rdr_[idx_dmn]=False;
+      if(var_trv->var_dmn[idx_dmn].flg_rvr == True){
+        dmn_rvr_rdr_[idx_dmn]=True;
+      }
+    }
+#endif
+
     /* nco_var_dmn_rdr_mtd() does re-order heavy lifting */
     rec_dmn_nm_out_crr=nco_var_dmn_rdr_mtd(var_prc[idx_var_prc],var_prc_out[idx_var_prc],dmn_rdr,dmn_rdr_nbr,dmn_idx_out_in,dmn_rvr_rdr,dmn_rvr_in);
 
@@ -5993,64 +5983,82 @@ nco_dmn_avg_mk                         /* [fnc] Build dimensions to average(ncwa
           /* Dimension name relative */
           char *dmn_nm=trv_obj.var_dmn[idx_var_dmn].dmn_nm;
 
+          char *sng_dmn=NULL;
+
+          trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].flg_rvr=False;
+
+          /* Option -a '-' (minus), reverse dimesnion Strip-out '-' and compare name */
+          if (usr_sng[0] == '-'){
+            sng_dmn=(char *)strdup(usr_sng+1L);
+            if (!strcmp(sng_dmn,dmn_nm)){
+              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].flg_rvr=True;
+            }
+          }else{ /* Not -a '-', duplicate user string to use in nco_pth_mch() */
+            sng_dmn=(char *)strdup(usr_sng);
+          }
+
           /* Must meet necessary flags */
-          nco_bool pth_mth=nco_pth_mch(dmn_nm_fll,dmn_nm,usr_sng); 
+          nco_bool pth_mth=nco_pth_mch(dmn_nm_fll,dmn_nm,sng_dmn); 
 
-          if(pth_mth){
-	    int idx_dmn_out; /* [idx] Index for output dimensions */
+          /* If does not meet criteria, reverse flag */
+          if(!pth_mth){
+            trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].flg_rvr=False;
+          }
 
-	    /* Is dimension already in output array?
-	       Match by dimension ID since dimension IDs are unique */
+          sng_dmn=(char *)nco_free(sng_dmn);
+
+          if(pth_mth){
+            int idx_dmn_out; /* [idx] Index for output dimensions */
+            
+            /* Is dimension already in output array? Match by dimension ID since dimension IDs are unique */
             for(idx_dmn_out=0;idx_dmn_out<nbr_avg_dmn;idx_dmn_out++)
               if(dmn_id == (*dmn_avg)[idx_dmn_out]->id) break;
-	    
-	    /* If this dimension is not yet in output array */
-	    if(idx_dmn_out == nbr_avg_dmn){
-	      
-	      /* Change flag to mark that dimension is to be averaged instead of to keep on output */
-	      trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].flg_dmn_avg=True;
-	      
-	      /* Add one more element to array  */
-	      (*dmn_avg)=(dmn_sct **)nco_realloc((*dmn_avg),(nbr_avg_dmn+1)*sizeof(dmn_sct *));
-	      (*dmn_avg)[nbr_avg_dmn]=(dmn_sct *)nco_malloc(sizeof(dmn_sct));
-	      
-	      /* Get size from GTT. NOTE use index idx_var_dmn */
-	      if(trv_obj.var_dmn[idx_var_dmn].is_crd_var){
-		dmn_cnt=trv_obj.var_dmn[idx_var_dmn].crd->lmt_msa.dmn_cnt;
-		dmn_sz=trv_obj.var_dmn[idx_var_dmn].crd->sz;
-		(*dmn_avg)[nbr_avg_dmn]->is_crd_dmn=True;
-	      }else{
-		dmn_cnt=trv_obj.var_dmn[idx_var_dmn].ncd->lmt_msa.dmn_cnt;
-		dmn_sz=trv_obj.var_dmn[idx_var_dmn].ncd->sz;
-		(*dmn_avg)[nbr_avg_dmn]->is_crd_dmn=False;
-	      } /* end else */
-	      
-	      (*dmn_avg)[nbr_avg_dmn]->nm=(char *)strdup(trv_obj.var_dmn[idx_var_dmn].dmn_nm);
-	      (*dmn_avg)[nbr_avg_dmn]->nm_fll=(char *)strdup(trv_obj.var_dmn[idx_var_dmn].dmn_nm_fll);
-	      (*dmn_avg)[nbr_avg_dmn]->id=trv_obj.var_dmn[idx_var_dmn].dmn_id;
-	      (*dmn_avg)[nbr_avg_dmn]->nc_id=nc_id;
-	      (*dmn_avg)[nbr_avg_dmn]->xrf=NULL;
-	      (*dmn_avg)[nbr_avg_dmn]->val.vp=NULL;
-	      (*dmn_avg)[nbr_avg_dmn]->is_rec_dmn=dmn_trv->is_rec_dmn;
-	      (*dmn_avg)[nbr_avg_dmn]->cnt=dmn_cnt;
-	      (*dmn_avg)[nbr_avg_dmn]->sz=dmn_sz;
-	      (*dmn_avg)[nbr_avg_dmn]->srt=0L;
-	      (*dmn_avg)[nbr_avg_dmn]->end=dmn_cnt-1L;
-	      (*dmn_avg)[nbr_avg_dmn]->srd=1L;
-	      
-	      (*dmn_avg)[nbr_avg_dmn]->cid=-1;
-	      (*dmn_avg)[nbr_avg_dmn]->cnk_sz=0L;
-	      (*dmn_avg)[nbr_avg_dmn]->type=(nc_type)-1;
-	      
-	      /* Broadcast flag average/keep using dimension ID; variables share dimensions */
-	      (void)nco_dmn_id_mk(dmn_id,flg_rdd,trv_tbl);
-	      
-	      /* Increment number of dimensions found */
-	      nbr_avg_dmn++;
-	      
-	    } /* If this dimension is not in output array */
-	  } /* Must meet necessary flags */
-	} /* Loop variable dimensions */ 
+            
+            /* If this dimension is not yet in output array */
+            if(idx_dmn_out == nbr_avg_dmn){
+              
+              /* Change flag to mark that dimension is to be averaged instead of to keep on output */
+              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].flg_dmn_avg=True;
+              
+              /* Add one more element to array  */
+              (*dmn_avg)=(dmn_sct **)nco_realloc((*dmn_avg),(nbr_avg_dmn+1)*sizeof(dmn_sct *));
+              (*dmn_avg)[nbr_avg_dmn]=(dmn_sct *)nco_malloc(sizeof(dmn_sct));
+              
+              /* Get size from GTT. NOTE use index idx_var_dmn */
+              if(trv_obj.var_dmn[idx_var_dmn].is_crd_var){
+                dmn_cnt=trv_obj.var_dmn[idx_var_dmn].crd->lmt_msa.dmn_cnt;
+                dmn_sz=trv_obj.var_dmn[idx_var_dmn].crd->sz;
+                (*dmn_avg)[nbr_avg_dmn]->is_crd_dmn=True;
+              }else{
+                dmn_cnt=trv_obj.var_dmn[idx_var_dmn].ncd->lmt_msa.dmn_cnt;
+                dmn_sz=trv_obj.var_dmn[idx_var_dmn].ncd->sz;
+                (*dmn_avg)[nbr_avg_dmn]->is_crd_dmn=False;
+              } /* end else */
+              
+              (*dmn_avg)[nbr_avg_dmn]->nm=(char *)strdup(trv_obj.var_dmn[idx_var_dmn].dmn_nm);
+              (*dmn_avg)[nbr_avg_dmn]->nm_fll=(char *)strdup(trv_obj.var_dmn[idx_var_dmn].dmn_nm_fll);
+              (*dmn_avg)[nbr_avg_dmn]->id=trv_obj.var_dmn[idx_var_dmn].dmn_id;
+              (*dmn_avg)[nbr_avg_dmn]->nc_id=nc_id;
+              (*dmn_avg)[nbr_avg_dmn]->xrf=NULL;
+              (*dmn_avg)[nbr_avg_dmn]->val.vp=NULL;
+              (*dmn_avg)[nbr_avg_dmn]->is_rec_dmn=dmn_trv->is_rec_dmn;
+              (*dmn_avg)[nbr_avg_dmn]->cnt=dmn_cnt;
+              (*dmn_avg)[nbr_avg_dmn]->sz=dmn_sz;
+              (*dmn_avg)[nbr_avg_dmn]->srt=0L;
+              (*dmn_avg)[nbr_avg_dmn]->end=dmn_cnt-1L;
+              (*dmn_avg)[nbr_avg_dmn]->srd=1L;
+              (*dmn_avg)[nbr_avg_dmn]->cid=-1;
+              (*dmn_avg)[nbr_avg_dmn]->cnk_sz=0L;
+              (*dmn_avg)[nbr_avg_dmn]->type=(nc_type)-1;
+        
+              /* Broadcast flag average/keep using dimension ID; variables share dimensions */
+              (void)nco_dmn_id_mk(dmn_id,flg_rdd,trv_tbl);
+        
+              /* Increment number of dimensions found */
+              nbr_avg_dmn++;
+            } /* If this dimension is not in output array */
+          } /* Must meet necessary flags */
+        } /* Loop variable dimensions */ 
       } /* Variable to extract */
     } /* Loop table */
   } /* Loop input dimension name list */
@@ -6682,7 +6690,7 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
         for(int lmt_idx=0;lmt_idx<lmt_nbr;lmt_idx++){
 
           /* Match input relative name to dimension relative name */ 
-          if(strcmp(lmt[lmt_idx]->nm,var_trv.var_dmn[idx_var_dmn].dmn_nm) == 0){
+          if(!strcmp(lmt[lmt_idx]->nm,var_trv.var_dmn[idx_var_dmn].dmn_nm)){
 
             /* Divide limits into two different cases */
 
@@ -7592,9 +7600,7 @@ nco_lmt_aux                           /* [fnc] Apply auxiliary -X limits (Auxili
     trv_tbl->lst[idx_tbl].var_dmn[idx_dmn].ncd->lmt_msa.lmt_crr=-1;
 
     /* Loop limits */
-    for(int idx_lmt=0;idx_lmt<nbr_nbr;idx_lmt++)
-    {
-
+    for(int idx_lmt=0;idx_lmt<nbr_nbr;idx_lmt++){
       /* Increment number of dimension limits for this dimension */
       trv_tbl->lst[idx_tbl].var_dmn[idx_dmn].ncd->lmt_msa.lmt_dmn_nbr++;
 
@@ -7623,14 +7629,10 @@ nco_lmt_aux                           /* [fnc] Apply auxiliary -X limits (Auxili
 
     } /* Loop limits */
 
-
-
     /* Apply MSA for each Dimension in new cycle (that now has all its limits in place) */
 
     /* Loop limits */
-    for(int idx_lmt=0;idx_lmt<nbr_nbr;idx_lmt++)
-    {
-
+    for(int idx_lmt=0;idx_lmt<nbr_nbr;idx_lmt++){
       dmn_trv_sct *ncd=trv_tbl->lst[idx_tbl].var_dmn[idx_dmn].ncd;
 
       /* Adapted from original MSA loop in nco_msa_lmt_all_ntl(); differences are marked GTT specific */
@@ -8227,6 +8229,26 @@ nco_bld_nsm                           /* [fnc] Build ensembles */
 } /* nco_bld_nsm() */
 
 void
+nco_wrt_atr
+(const int nc_id,                    /* I [id] netCDF input file ID */
+ const int grp_out_id,               /* I [id] netCDF output group ID */
+ const int var_out_id,               /* I [id] netCDF output variable ID */
+ const trv_sct *var_trv)             /* I [sct] traversal variable */
+{
+  /* Copy variable's attributes */
+  int var_id; /* [id] Variable ID */
+  int grp_id; /* [id] Group ID */
+
+  /* Obtain group ID */
+  (void)nco_inq_grp_full_ncid(nc_id,var_trv->grp_nm_fll,&grp_id);
+
+  /* Get variable ID */
+  (void)nco_inq_varid(grp_id,var_trv->nm,&var_id);
+
+  (void)nco_att_cpy(grp_id,grp_out_id,var_id,var_out_id,True);
+} /* nco_wrt_atr() */
+
+void
 nco_nsm_dfn_wrt                      /* [fnc] Define OR write ensemble fixed variables */
 (const int nc_id,                    /* I [ID] netCDF input file ID */
  const int nc_out_id,                /* I [ID] netCDF output file ID */
@@ -8261,13 +8283,17 @@ nco_nsm_dfn_wrt                      /* [fnc] Define OR write ensemble fixed var
       /* Get variable  */
       trv_sct *var_trv=trv_tbl_var_nm_fll(trv_tbl->nsm[idx_nsm].skp_nm_fll[idx_skp],trv_tbl);
 
-      /* Define variable  */
-      if(flg_def) (void)nco_cpy_var_dfn_trv(nc_id,nc_out_id,cnk,grp_out_fll,dfl_lvl,gpe,NULL,var_trv,NULL,0,trv_tbl);
-
       /* Obtain group IDs */
       (void)nco_inq_grp_full_ncid(nc_id,var_trv->grp_nm_fll,&grp_id_in);
       (void)nco_inq_grp_full_ncid(nc_out_id,grp_out_fll,&grp_id_out);
 
+      /* Define variable  */
+      if(flg_def){
+        int var_out_id=nco_cpy_var_dfn_trv(nc_id, nc_out_id, cnk, grp_out_fll, dfl_lvl, gpe, NULL, var_trv, NULL, 0, trv_tbl);
+        /* Copy attributes */
+        (void)nco_wrt_atr(nc_id,grp_id_out,var_out_id,var_trv);
+      } /* endif */
+
       /* Copy variable data */
       if(!flg_def) (void)nco_cpy_var_val_mlt_lmt_trv(grp_id_in,grp_id_out,(FILE *)NULL,NULL,var_trv);
 
@@ -9953,3 +9979,18 @@ nco_nsm_wrt_att                  /* [fnc] Save ncge metadata attribute */
     } /* end if group and flg_xtr */
   } /* end loop to define group attributes */
 } /* nco_nsm_wrt_att() */
+
+void
+nco_var_xtr_trv                       /* [fnc] Print all variables to extract (debug) */
+(const trv_tbl_sct * const trv_tbl)   /* I [sct] Traversal table */
+{
+  int nbr_xtr=0;
+  /* Loop table */
+  for(unsigned tbl_idx=0;tbl_idx<trv_tbl->nbr;tbl_idx++){
+    /* Filter variables to extract  */
+    if(trv_tbl->lst[tbl_idx].nco_typ == nco_obj_typ_var && trv_tbl->lst[tbl_idx].flg_xtr){
+      (void)fprintf(stdout, "%s\n",trv_tbl->lst[tbl_idx].nm_fll);
+      nbr_xtr++;
+    } /* Filter variables  */
+  } /* Loop table */
+} /* nco_var_xtr_trv() */
diff --git a/src/nco/nco_grp_utl.h b/src/nco/nco_grp_utl.h
index 2266933..3ffd6f9 100644
--- a/src/nco/nco_grp_utl.h
+++ b/src/nco/nco_grp_utl.h
@@ -425,13 +425,6 @@ nco_cpy_var_dfn_trv                    /* [fnc] Define specified variable in out
  trv_tbl_sct * const trv_tbl);         /* I/O [sct] GTT (Group Traversal Table) */
 
 void
-nco_dmn_rdr_trv                        /* [fnc] Transfer dimension structures to be re-ordered (ncpdq) into GTT */
-(int **dmn_idx_out_in,                 /* I [idx] Dimension correspondence, output->input, output of nco_var_dmn_rdr_mtd() */
- const int nbr_var_prc,                /* I [nbr] Size of above array (number of processed variables) */
- var_sct **var_prc_out,                /* I [sct] Processed variables */
- trv_tbl_sct * const trv_tbl);         /* I/O [sct] Traversal table */
-
-void
 nco_var_dmn_rdr_mtd_trv               /* [fnc] Determine and set new dimensionality in metadata of each re-ordered variable */
 (trv_tbl_sct * const trv_tbl,         /* I/O [sct] GTT (Group Traversal Table) */
  const int nbr_var_prc,               /* I [nbr] Number of processed variables */
@@ -919,6 +912,23 @@ nco_nsm_wrt_att                      /* [fnc] Save ncge metadata attribute */
  const gpe_sct * const gpe,          /* I [sct] GPE structure */
  trv_tbl_sct * const trv_tbl);       /* I/O [sct] GTT (Group Traversal Table) */
 
+void
+nco_wrt_atr
+(const int nc_id,                    /* I [id] netCDF input file ID */
+ const int grp_out_id,               /* I [id] netCDF output group ID */
+ const int var_out_id,               /* I [id] netCDF output variable ID */
+ const trv_sct *var_trv);            /* I [sct] traversal variable */
+
+char*
+nco_get_dmn_nm_fll                     /* [fnc] Return dimension name with input id (debug) */
+(const int dmn_id,                     /* I [id] ID of dimension */
+ const dmn_cmn_sct * const dmn_cmn,    /* I [sct] Dimension structure array */
+ const int nbr_dmn);                   /* I [nbr] Number of dimensions (size of above array) */
+
+void
+nco_var_xtr_trv                       /* [fnc] Print all variables to extract (debug) */
+(const trv_tbl_sct * const trv_tbl);  /* I [sct] Traversal table */
+
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif /* __cplusplus */
diff --git a/src/nco/nco_lst_utl.c b/src/nco/nco_lst_utl.c
index a680259..1455c98 100644
--- a/src/nco/nco_lst_utl.c
+++ b/src/nco/nco_lst_utl.c
@@ -692,10 +692,10 @@ nco_rx_comma2hash /* [fnc] Replace commas with hashes when within braces */
   /* Loop over each character in string until first NUL encountered */
   while(*cp){
     /* Find open brace */
-    if(*cp=='{') openbrace=True;
-    if(openbrace && *cp==',') cp_cnv=cp;
+    if(*cp == '{') openbrace=True;
+    if(openbrace && *cp == ',') cp_cnv=cp;
     /* Find close brace */
-    if(*cp=='}'){ 
+    if(*cp == '}'){
       /* Change comma following open brace, if any, to hash */
       if(cp_cnv) *cp_cnv='#';
       /* Reset comma location following open brace */
diff --git a/src/nco/nco_msa.c b/src/nco/nco_msa.c
index 1942c46..41b27e8 100644
--- a/src/nco/nco_msa.c
+++ b/src/nco/nco_msa.c
@@ -439,7 +439,9 @@ nco_msa_clc_cnt
 
   /* If slabs remain in user-specified order */
   if(lmt_lst->MSA_USR_RDR){
-    for(idx=0;idx<size;idx++) cnt+=lmt_lst->lmt_dmn[idx]->cnt;
+    for(idx=0;idx<size;idx++){
+      cnt+=lmt_lst->lmt_dmn[idx]->cnt;
+     }
     lmt_lst->dmn_cnt=cnt;
   }else{
     indices=(long *)nco_malloc(size*sizeof(long));
@@ -848,7 +850,7 @@ nco_msa_wrp_splt_trv   /* [fnc] Split wrapped dimensions (GTT version) */
 
     if(dmn_trv->lmt_msa.lmt_dmn[idx]->srt > dmn_trv->lmt_msa.lmt_dmn[idx]->end){
 
-      if(nco_dbg_lvl_get() == nco_dbg_old) (void)fprintf(stdout,"%s: INFO %s dimension <%s> has wrapped limits (%li->%li):\n",nco_prg_nm_get(),fnc_nm,dmn_trv->nm_fll,dmn_trv->lmt_msa.lmt_dmn[idx]->srt,dmn_trv->lmt_msa.lmt_dmn[idx]->end);
+      if(nco_dbg_lvl_get() == nco_dbg_dev) (void)fprintf(stdout,"%s: INFO %s dimension <%s> has wrapped limits (%li->%li):\n",nco_prg_nm_get(),fnc_nm,dmn_trv->nm_fll,dmn_trv->lmt_msa.lmt_dmn[idx]->srt,dmn_trv->lmt_msa.lmt_dmn[idx]->end);
 
       lmt_wrp=(lmt_sct *)nco_malloc(2*sizeof(lmt_sct));
 
@@ -891,7 +893,7 @@ nco_msa_wrp_splt_trv   /* [fnc] Split wrapped dimensions (GTT version) */
         lmt_wrp[1].srd=srd;
       } /* end else */
 
-      if(nco_dbg_lvl_get() == nco_dbg_old){
+      if(nco_dbg_lvl_get() == nco_dbg_dev){
         (void)fprintf(stdout,"%s: INFO %s wrapped limits for <%s> found: ",nco_prg_nm_get(),fnc_nm,dmn_trv->nm_fll);
         (void)fprintf(stdout,"%d:\n",dmn_trv->lmt_msa.lmt_dmn_nbr);
       }
@@ -923,8 +925,10 @@ nco_msa_wrp_splt_trv   /* [fnc] Split wrapped dimensions (GTT version) */
       /* Update current index of dimension limits for this table dimension  */
       dmn_trv->lmt_msa.lmt_crr++;
 
-      if(nco_dbg_lvl_get() == nco_dbg_old) (void)fprintf(stdout,"%s: INFO %s dimension <%s> new limits inserted (%li->%li) - (%li->%li):\n",nco_prg_nm_get(),fnc_nm,dmn_trv->nm_fll,dmn_trv->lmt_msa.lmt_dmn[idx]->srt,dmn_trv->lmt_msa.lmt_dmn[idx]->end,dmn_trv->lmt_msa.lmt_dmn[lmt_new_idx]->srt,dmn_trv->lmt_msa.lmt_dmn[lmt_new_idx]->end);
-
+      if (nco_dbg_lvl_get() == nco_dbg_dev){
+        (void)fprintf(stdout, "%s: INFO %s dimension <%s> new limits inserted (%li->%li) - (%li->%li):\n", 
+          nco_prg_nm_get(), fnc_nm, dmn_trv->nm_fll, dmn_trv->lmt_msa.lmt_dmn[idx]->srt, dmn_trv->lmt_msa.lmt_dmn[idx]->end, dmn_trv->lmt_msa.lmt_dmn[lmt_new_idx]->srt, dmn_trv->lmt_msa.lmt_dmn[lmt_new_idx]->end);
+      }
     } /* endif srt > end */
   } /* end loop over size */
 
@@ -954,7 +958,9 @@ nco_msa_clc_cnt_trv     /* [fnc] Calculate size of  multiple hyperslab (GTT vers
 
   /* If slabs remain in user-specified order */
   if(dmn_trv->lmt_msa.MSA_USR_RDR){
-    for(idx=0;idx<size;idx++) cnt+=dmn_trv->lmt_msa.lmt_dmn[idx]->cnt;
+    for(idx=0;idx<size;idx++){
+      cnt+=dmn_trv->lmt_msa.lmt_dmn[idx]->cnt;
+     }
     dmn_trv->lmt_msa.dmn_cnt=cnt;
   }else{
     indices=(long *)nco_malloc(size*sizeof(long));
@@ -1172,8 +1178,8 @@ nco_msa_wrp_splt_cpy    /* [fnc] Split wrapped dimensions (make deep copy of new
       /* Current number of dimension limits for this table dimension  */
       int lmt_dmn_nbr=lmt_lst->lmt_dmn_nbr;
 
-      /* Index of new limit  */
-      int lmt_new_idx=idx+1;
+      /* Index of new limit  (insert at last index) */
+      int lmt_new_idx=lmt_lst->lmt_crr;
 
       /* Make space for 1 more limit  */
       lmt_lst->lmt_dmn=(lmt_sct **)nco_realloc(lmt_lst->lmt_dmn,(lmt_dmn_nbr+1)*sizeof(lmt_sct *));
@@ -1181,7 +1187,7 @@ nco_msa_wrp_splt_cpy    /* [fnc] Split wrapped dimensions (make deep copy of new
       /* Alloc the extra limit  */
       lmt_lst->lmt_dmn[lmt_new_idx]=(lmt_sct *)nco_malloc(sizeof(lmt_sct));
 
-      /* Initialize the extra limit */
+      /* Initialize the extra limit (insert at last index) */
       (void)nco_lmt_init(lmt_lst->lmt_dmn[lmt_new_idx]);
 
       /* Insert the limits to table (allocated; idx was already there; lmt_new_idx was alloced here)   */
diff --git a/src/nco/nco_mss_val.c b/src/nco/nco_mss_val.c
index 726cb2f..40ae739 100644
--- a/src/nco/nco_mss_val.c
+++ b/src/nco/nco_mss_val.c
@@ -391,18 +391,20 @@ nco_mss_val_get_dbl /* [fnc] Return missing_value of variable, if any, as double
     has_mss_val=True;
     /* Oddly, ARM uses NC_CHAR for type of missing_value, so make allowances for this */
     (void)nco_get_att(nc_id,var_id,att_nm,mss_val_dbl,NC_DOUBLE);
+    //(void)fprintf(stderr,"%s: INFO NC_DOUBLE version of \"%s\" attribute for %s is %g\n",nco_prg_nm_get(),att_nm,var_nm,*mss_val_dbl);
+    if(!isfinite(*mss_val_dbl)) (void)fprintf(stderr,"%s: WARNING NC_DOUBLE version of \"%s\" attribute for %s fails isfinite(), value is %s\n",nco_prg_nm_get(),att_nm,var_nm,(isnan(*mss_val_dbl)) ? "NaN" : ((isinf(*mss_val_dbl)) ? "Infinity" : ""));
     break;
   } /* end loop over att */
 
-  /* Always warn when NCO looks for _FillValue but file has missing_value, and/or
-     always warn when NCO looks for missing_value but file has _FillValue.
+  /* Warn when NCO looks for _FillValue but file has missing_value, and/or
+     warn when NCO looks for missing_value but file has _FillValue.
      20101129: This is a long warning, only print when nco_dbg_lvl > 0 */
   if(nco_dbg_lvl_get() >= nco_dbg_std && has_fll_val && !has_mss_val && WRN_FIRST){
     char sa[1000];
     char sa1[1000];
     char sa2[1000]; 
     WRN_FIRST=False;
-    (void)sprintf(sa,"%s: WARNING Variable %s has attribute \"%s\" but not \"%s\". To comply with netCDF conventions, NCO ignores values that equal the %s attribute when performing arithmetic.",nco_prg_nm_get(),var_nm,nco_not_mss_val_sng_get(), nco_mss_val_sng_get(),nco_mss_val_sng_get()); 
+    (void)sprintf(sa,"%s: WARNING Variable %s has attribute \"%s\" but not \"%s\". To comply with netCDF conventions, NCO ignores values that equal the %s attribute when performing arithmetic.",nco_prg_nm_get(),var_nm,nco_not_mss_val_sng_get(),nco_mss_val_sng_get(),nco_mss_val_sng_get()); 
     (void)sprintf(sa1," Confusingly, values equal to the missing_value should also be neglected. However, it is tedious and (possibly) computationally expensive to check each value against multiple missing values during arithmetic on large variables. So NCO thinks that processing variables with a \"%s\" attribute and no \"%s\" attribute may produce undesired arithmetic results (i.e., where values that were intended to be neglected were not, in fact, neglected).",nco_not_mss_val_sng_get() [...]
     (void)sprintf(sa2, " We suggest you rename all \"%s\" attributes to \"%s\" or include both \"%s\" and \"%s\" attributes (with the _same values_) for all variables that have either attribute. Because it is long, this message is only printed once per operator even though multiple variables may have the same attribute configuration. More information on missing values is given at:\nhttp://nco.sf.net/nco.html#mss_val\nExamples of renaming attributes are at:\nhttp://nco.sf.net/nco.html#xmp [...]
     (void)fprintf(stderr,"%s%s%s",sa,sa1,sa2); 
diff --git a/src/nco/nco_netcdf.c b/src/nco/nco_netcdf.c
index a892f5d..d6ba1d8 100644
--- a/src/nco/nco_netcdf.c
+++ b/src/nco/nco_netcdf.c
@@ -446,8 +446,8 @@ nco_fmt_sng /* [fnc] Convert netCDF file format enum to string */
   switch(fl_fmt){
   case NC_FORMAT_CLASSIC:
     return "NC_FORMAT_CLASSIC";
-  case NC_FORMAT_64BIT:
-    return "NC_FORMAT_64BIT";
+  case NC_FORMAT_64BIT_OFFSET:
+    return "NC_FORMAT_64BIT_OFFSET";
   case NC_FORMAT_NETCDF4:
     return "NC_FORMAT_NETCDF4";
   case NC_FORMAT_NETCDF4_CLASSIC:
@@ -470,14 +470,14 @@ nco_fmt_hdn_sng /* [fnc] Convert netCDF file format enum to string for hidden at
   switch(fl_fmt){
   case NC_FORMAT_CLASSIC:
     return "classic";
-  case NC_FORMAT_64BIT:
+  case NC_FORMAT_64BIT_OFFSET:
     return "64-bit offset";
   case NC_FORMAT_NETCDF4:
     return "netCDF-4";
   case NC_FORMAT_NETCDF4_CLASSIC:
     return "netCDF-4 classic model";
   case NC_FORMAT_CDF5:
-    return "64-bit-variable";
+    return "64-bit data";
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
 
@@ -490,23 +490,43 @@ nco_fmt_xtn_sng /* [fnc] Convert netCDF extended file format enum to string */
 (const int fl_fmt_xtn) /* I [enm] netCDF extended file format */
 {
   /* Purpose: Convert netCDF extended file format enum to string */
-  switch(fl_fmt_xtn){
-  case NC_FORMAT_NC3:
-    return "NC_FORMAT_NC3";
-  case NC_FORMAT_NC_HDF5:
-    return "NC_FORMAT_HDF5";
-  case NC_FORMAT_NC_HDF4:
-    return "NC_FORMAT_HDF4";
-  case NC_FORMAT_PNETCDF:
-    return "NC_FORMAT_PNETCDF";
-  case NC_FORMAT_DAP2:
-    return "NC_FORMAT_DAP2";
-  case NC_FORMAT_DAP4:
-    return "NC_FORMAT_DAP4";
-  case NC_FORMAT_UNDEFINED:
-    return "NC_FORMAT_UNDEFINED";
-  default: nco_dfl_case_nc_type_err(); break;
-  } /* end switch */
+#if NC_LIB_VERSION < 440
+    switch(fl_fmt_xtn){
+    case NC_FORMAT_NC3:
+      return "NC_FORMAT_NC3";
+    case NC_FORMAT_NC_HDF5:
+      return "NC_FORMAT_HDF5";
+    case NC_FORMAT_NC_HDF4:
+      return "NC_FORMAT_HDF4";
+    case NC_FORMAT_PNETCDF:
+      return "NC_FORMAT_PNETCDF";
+    case NC_FORMAT_DAP2:
+      return "NC_FORMAT_DAP2";
+    case NC_FORMAT_DAP4:
+      return "NC_FORMAT_DAP4";
+    case NC_FORMAT_UNDEFINED:
+      return "NC_FORMAT_UNDEFINED";
+    default: nco_dfl_case_nc_type_err(); break;
+    } /* end switch */
+#else /* !NC_LIB_VERSION */
+    switch(fl_fmt_xtn){
+    case NC_FORMATX_NC3:
+      return "NC_FORMATX_NC3";
+    case NC_FORMATX_NC_HDF5:
+      return "NC_FORMATX_HDF5";
+    case NC_FORMATX_NC_HDF4:
+      return "NC_FORMATX_HDF4";
+    case NC_FORMATX_PNETCDF:
+      return "NC_FORMATX_PNETCDF";
+    case NC_FORMATX_DAP2:
+      return "NC_FORMATX_DAP2";
+    case NC_FORMATX_DAP4:
+      return "NC_FORMATX_DAP4";
+    case NC_FORMATX_UNDEFINED:
+      return "NC_FORMATX_UNDEFINED";
+    default: nco_dfl_case_nc_type_err(); break;
+    } /* end switch */
+#endif /* !NC_LIB_VERSION */
 
   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
   return (char *)NULL;
@@ -1525,7 +1545,7 @@ nco_inq_var_packing /* [fnc] Check whether variable is packed on disk */
  int * const packing) /* O [flg] Variable is packed on disk */
 {
   /* Purpose: Check whether variable is packed on disk
-     Designed to behave like netCDF-library call for packing (which does not exist)
+     Designed to behave like (non-existent) netCDF-library call for packing
      Based on nco_pck_dsk_inq()
      Difference is that:
      nco_pck_dsk_inq() fills in members of variable structure
diff --git a/src/nco/nco_netcdf.h b/src/nco/nco_netcdf.h
index f42331f..082546f 100644
--- a/src/nco/nco_netcdf.h
+++ b/src/nco/nco_netcdf.h
@@ -65,11 +65,34 @@
    This barrier helps segregate NCO from wrappers
    Re-define minimal sub-set of tokens for nco_netcdf.c as necessary
    This is small exception to the barrier */
+#ifndef NC_VERSION_MAJOR
+# define NC_VERSION_MAJOR 3
+#endif /* !NC_VERSION_MAJOR */
+#ifndef NC_VERSION_MINOR
+# define NC_VERSION_MINOR 6
+#endif /* !NC_VERSION_MINOR */
+#ifndef NC_VERSION_PATCH
+# define NC_VERSION_PATCH 0
+#endif /* !NC_VERSION_PATCH */
+#ifndef NC_VERSION_NOTE
+# define NC_VERSION_NOTE  "" /* May be blank */
+#endif /* !NC_VERSION_NOTE */
+#ifndef NC_VERSION
+# define NC_VERSION "3.6.0"
+#endif /* !NC_VERSION */
+  /* Define NC_LIB_VERSION as three-digit number for arithmetic comparisons by CPP */
+#ifndef NC_LIB_VERSION
+# define NC_LIB_VERSION ( NC_VERSION_MAJOR * 100 + NC_VERSION_MINOR * 10 + NC_VERSION_PATCH )
+#endif /* !NC_LIB_VERSION */
+
 #ifndef NC_FORMAT_CLASSIC
 # define NC_FORMAT_CLASSIC (1)
 #endif
+#ifndef NC_FORMAT_64BIT_OFFSET
+# define NC_FORMAT_64BIT_OFFSET   (2)
+#endif
 #ifndef NC_FORMAT_64BIT
-# define NC_FORMAT_64BIT   (2)
+# define NC_FORMAT_64BIT (NC_FORMAT_64BIT_OFFSET)
 #endif
 #ifndef NC_FORMAT_NETCDF4
 # define NC_FORMAT_NETCDF4 (3)
@@ -77,6 +100,9 @@
 #ifndef NC_FORMAT_NETCDF4_CLASSIC
 # define NC_FORMAT_NETCDF4_CLASSIC  (4) /* create netcdf-4 files, with NC_CLASSIC_MODEL. */
 #endif
+#ifndef NC_FORMAT_64BIT_DATA
+# define NC_FORMAT_64BIT_DATA   (5)
+#endif
 #ifndef NC_ENDIAN_NATIVE
 # define NC_ENDIAN_NATIVE 0
 #endif
@@ -122,7 +148,7 @@
 #endif
 
 /* Three compatibility tokens from pnetcdf.h introduced to NCO 20140604 
-   None are used yet */
+   First actually used 20160114 */
 #ifndef NC_64BIT_DATA
 # define NC_64BIT_DATA	0x0010 /* CDF-5 format, (64-bit) supported */
 #endif
diff --git a/src/nco/nco_ppc.c b/src/nco/nco_ppc.c
index 0078a64..ec6ed4c 100644
--- a/src/nco/nco_ppc.c
+++ b/src/nco/nco_ppc.c
@@ -216,7 +216,7 @@ nco_ppc_set_dflt /* Set PPC value for all non-coordinate variables for --ppc def
     ppc_val=(int)strtol(ppc_arg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
     if(*sng_cnv_rcd) nco_sng_cnv_err(ppc_arg,"strtol",sng_cnv_rcd);
     if(ppc_val <= 0){
-      (void)fprintf(stdout,"%s ERROR Number of Significant Digits (NSD) must be postive. Default is specified as %d. HINT: Decimal Significant Digit (DSD) rounding does accept negative arguments (number of digits in front of the decimal point). However, the DSD argument must be prefixed by a period or \"dot\", e.g., \"--ppc foo=.-2\", to distinguish it from NSD quantization.\n",nco_prg_nm_get(),ppc_val);
+      (void)fprintf(stdout,"%s ERROR Number of Significant Digits (NSD) must be positive. Default is specified as %d. HINT: Decimal Significant Digit (DSD) rounding does accept negative arguments (number of digits in front of the decimal point). However, the DSD argument must be prefixed by a period or \"dot\", e.g., \"--ppc foo=.-2\", to distinguish it from NSD quantization.\n",nco_prg_nm_get(),ppc_val);
       nco_exit(EXIT_FAILURE);
     } /* endif */    
   } /* end if */
@@ -259,7 +259,7 @@ nco_ppc_set_var
     ppc_val=(int)strtol(ppc_arg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
     if(*sng_cnv_rcd) nco_sng_cnv_err(ppc_arg,"strtol",sng_cnv_rcd);
     if(ppc_val <= 0){
-      (void)fprintf(stdout,"%s ERROR Number of Significant Digits (NSD) must be postive. Specified value for %s is %d. HINT: Decimal Significant Digit (DSD) rounding does accept negative arguments (number of digits in front of the decimal point). However, the DSD argument must be prefixed by a period or \"dot\", e.g., \"--ppc foo=.-2\", to distinguish it from NSD quantization.\n",nco_prg_nm_get(),var_nm,ppc_val);
+      (void)fprintf(stdout,"%s ERROR Number of Significant Digits (NSD) must be positive. Specified value for %s is %d. HINT: Decimal Significant Digit (DSD) rounding does accept negative arguments (number of digits in front of the decimal point). However, the DSD argument must be prefixed by a period or \"dot\", e.g., \"--ppc foo=.-2\", to distinguish it from NSD quantization.\n",nco_prg_nm_get(),var_nm,ppc_val);
       nco_exit(EXIT_FAILURE);
     } /* endif */    
   } /* end else */
@@ -657,18 +657,39 @@ nco_ppc_bitmask /* [fnc] Mask-out insignificant bits of significand */
     /* Left shift zeros into bits to be rounded */
     msk_f32_u32_zro <<= bit_xpl_nbr_zro;
     msk_f32_u32_one=~msk_f32_u32_zro;
-    if(!has_mss_val){
-      for(idx=0L;idx<sz;idx+=2L) u32_ptr[idx]&=msk_f32_u32_zro;
-      for(idx=1L;idx<sz;idx+=2L)
-	if(u32_ptr[idx] != 0U) /* Never quantize upwards floating point values of zero */
-	  u32_ptr[idx]|=msk_f32_u32_one;
-    }else{
-      const float mss_val_flt=*mss_val.fp;
-      for(idx=0L;idx<sz;idx+=2L)
-	if(op1.fp[idx] != mss_val_flt) u32_ptr[idx]&=msk_f32_u32_zro;
-      for(idx=1L;idx<sz;idx+=2L)
-	if(op1.fp[idx] != mss_val_flt && u32_ptr[idx] != 0U) u32_ptr[idx]|=msk_f32_u32_one;
-    } /* end else */
+    if(nco_baa_cnv_get() == nco_baa_grm){
+      /* Bit-Groom: alternately shave and set LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx+=2L) u32_ptr[idx]&=msk_f32_u32_zro;
+	for(idx=1L;idx<sz;idx+=2L)
+	  if(u32_ptr[idx] != 0U) /* Never quantize upwards floating point values of zero */
+	    u32_ptr[idx]|=msk_f32_u32_one;
+      }else{
+	const float mss_val_flt=*mss_val.fp;
+	for(idx=0L;idx<sz;idx+=2L)
+	  if(op1.fp[idx] != mss_val_flt) u32_ptr[idx]&=msk_f32_u32_zro;
+	for(idx=1L;idx<sz;idx+=2L)
+	  if(op1.fp[idx] != mss_val_flt && u32_ptr[idx] != 0U) u32_ptr[idx]|=msk_f32_u32_one;
+      } /* end else */
+    }else if(nco_baa_cnv_get() == nco_baa_shv){
+      /* Bit-Shave: always shave LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx++) u32_ptr[idx]&=msk_f32_u32_zro;
+      }else{
+	const float mss_val_flt=*mss_val.fp;
+	for(idx=0L;idx<sz;idx++)
+	  if(op1.fp[idx] != mss_val_flt) u32_ptr[idx]&=msk_f32_u32_zro;
+      } /* end else */
+    }else if(nco_baa_cnv_get() == nco_baa_set){
+      /* Bit-Set: always set LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx++) u32_ptr[idx]&=msk_f32_u32_one;
+      }else{
+	const float mss_val_flt=*mss_val.fp;
+	for(idx=0L;idx<sz;idx++)
+	  if(op1.fp[idx] != mss_val_flt) u32_ptr[idx]&=msk_f32_u32_one;
+      } /* end else */
+    }else abort();
     break;
   case NC_DOUBLE:
     bit_xpl_nbr_sgn=bit_xpl_nbr_sgn_dbl;
@@ -681,18 +702,39 @@ nco_ppc_bitmask /* [fnc] Mask-out insignificant bits of significand */
     /* Left shift zeros into bits to be rounded */
     msk_f64_u64_zro <<= bit_xpl_nbr_zro;
     msk_f64_u64_one=~msk_f64_u64_zro;
-    if(!has_mss_val){
-      for(idx=0L;idx<sz;idx+=2L) u64_ptr[idx]&=msk_f64_u64_zro;
-      for(idx=1L;idx<sz;idx+=2L)
-	if(u64_ptr[idx] != 0UL) /* Never quantize upwards floating point values of zero */
-	  u64_ptr[idx]|=msk_f64_u64_one;
-    }else{
-      const double mss_val_dbl=*mss_val.dp;
-      for(idx=0L;idx<sz;idx+=2L)
-	if(op1.dp[idx] != mss_val_dbl) u64_ptr[idx]&=msk_f64_u64_zro;
-      for(idx=1L;idx<sz;idx+=2L)
-	if(op1.dp[idx] != mss_val_dbl && u64_ptr[idx] != 0UL) u64_ptr[idx]|=msk_f64_u64_one;
-    } /* end else */
+    if(nco_baa_cnv_get() == nco_baa_grm){
+      /* Bit-Groom: alternately shave and set LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx+=2L) u64_ptr[idx]&=msk_f64_u64_zro;
+	for(idx=1L;idx<sz;idx+=2L)
+	  if(u64_ptr[idx] != 0UL) /* Never quantize upwards floating point values of zero */
+	    u64_ptr[idx]|=msk_f64_u64_one;
+      }else{
+	const double mss_val_dbl=*mss_val.dp;
+	for(idx=0L;idx<sz;idx+=2L)
+	  if(op1.dp[idx] != mss_val_dbl) u64_ptr[idx]&=msk_f64_u64_zro;
+	for(idx=1L;idx<sz;idx+=2L)
+	  if(op1.dp[idx] != mss_val_dbl && u64_ptr[idx] != 0UL) u64_ptr[idx]|=msk_f64_u64_one;
+      } /* end else */
+    }else if(nco_baa_cnv_get() == nco_baa_shv){
+      /* Bit-Shave: always shave LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx++) u64_ptr[idx]&=msk_f64_u64_zro;
+      }else{
+	const double mss_val_dbl=*mss_val.dp;
+	for(idx=0L;idx<sz;idx++)
+	  if(op1.dp[idx] != mss_val_dbl) u64_ptr[idx]&=msk_f64_u64_zro;
+      } /* end else */
+    }else if(nco_baa_cnv_get() == nco_baa_set){
+      /* Bit-Set: always set LSBs */
+      if(!has_mss_val){
+	for(idx=0L;idx<sz;idx++) u64_ptr[idx]&=msk_f64_u64_one;
+      }else{
+	const double mss_val_dbl=*mss_val.dp;
+	for(idx=0L;idx<sz;idx++)
+	  if(op1.dp[idx] != mss_val_dbl) u64_ptr[idx]&=msk_f64_u64_one;
+      } /* end else */
+    }else abort();
     break;
   case NC_INT: /* Do nothing for non-floating point types ...*/
   case NC_SHORT:
diff --git a/src/nco/nco_ppc.h b/src/nco/nco_ppc.h
index b7c16d6..ee3b511 100644
--- a/src/nco/nco_ppc.h
+++ b/src/nco/nco_ppc.h
@@ -29,14 +29,6 @@
 #include "nco_mmr.h" /* Memory management */
 #include "nco_sng_utl.h" /* String utilities */
 
-/* 20151207: Reports that Cygwin math.h does not define M_LN10 or M_LN2 */
-#ifndef M_LN10
-# define M_LN10      2.30258509299404568401799145468436421   /* loge(10)       */
-#endif /* M_LN10 */
-#ifndef M_LN2
-# define M_LN2       0.693147180559945309417232121458176568  /* loge(2)        */
-#endif /* M_LN2 */
-
 /* Minimum number of explicit significand bits to preserve when zeroing/bit-masking floating point values
    Codes will preserve at least two explicit bits, IEEE significand representation contains one implicit bit
    Thus preserve a least three bits which is approximately one sigificant decimal digit
diff --git a/src/nco/nco_prn.c b/src/nco/nco_prn.c
index cb7752b..73f8ae4 100644
--- a/src/nco/nco_prn.c
+++ b/src/nco/nco_prn.c
@@ -349,7 +349,7 @@ nco_prn_att /* [fnc] Print all attributes of single variable or group */
 	  rcd_prn=snprintf(val_sng,(size_t)NCO_ATM_SNG_LNG,att_sng_pln,val_dbl);
 	  (void)sng_trm_trl_zro(val_sng,prn_flg->nbr_zro);
 	}else{
-	  if(isnan(val_dbl)) (void)sprintf(val_sng,"NaNf"); else if(isinf(val_dbl)) (void)sprintf(val_sng,"%sInfinity",(val_dbl < 0.0) ? "-" : "");
+	  if(isnan(val_dbl)) (void)sprintf(val_sng,"NaN"); else if(isinf(val_dbl)) (void)sprintf(val_sng,"%sInfinity",(val_dbl < 0.0) ? "-" : "");
 	} /* endelse */
 	(void)fprintf(stdout,"%s%s",val_sng,(lmn != att_szm1) ? spr_sng : "");
       } /* end loop */
diff --git a/src/nco/nco_prn.h b/src/nco/nco_prn.h
index fa36ad2..c11ac32 100644
--- a/src/nco/nco_prn.h
+++ b/src/nco/nco_prn.h
@@ -18,6 +18,7 @@
 #endif /* !HAVE_CONFIG_H */
 
 /* Standard header files */
+#include <math.h> /* sin cos cos sin 3.14159 isfinite isinf isnan */
 #include <stdio.h> /* stderr, FILE, NULL, printf */
 #include <string.h> /* strcmp() */
 
diff --git a/src/nco/nco_rgr.c b/src/nco/nco_rgr.c
index e589e0b..196579b 100644
--- a/src/nco/nco_rgr.c
+++ b/src/nco/nco_rgr.c
@@ -331,6 +331,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"snwe")){
       cnv_nbr=sscanf(rgr_lst[rgr_var_idx].val,"%lf,%lf,%lf,%lf",&rgr->lat_sth,&rgr->lat_nrt,&rgr->lon_wst,&rgr->lon_est);
       assert(cnv_nbr == 4);
+      if(cnv_nbr != 4) abort(); /* CEWI Use cnv_nbr at least once outside of assert() to avoid gcc 4.8.2 set-but-not-used warning */
       continue;
     } /* !snwe */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"wesn")){
@@ -935,13 +936,13 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   dmn_sz_out_int=(int *)nco_malloc(rgr_map.dst_grid_rank*nco_typ_lng((nc_type)NC_INT));
   rcd=nco_get_vara(in_id,dmn_sz_out_int_id,dmn_srt,dmn_cnt,dmn_sz_out_int,(nc_type)NC_INT);
 
-  /* Check-for and workaround faulty Tempest and MPAS-O grid sizes */
+  /* Check-for and workaround faulty Tempest and MPAS-O/I grid sizes */
   if(flg_grd_in_1D && (rgr_map.src_grid_size != dmn_sz_in_int[0])){
-    (void)fprintf(stdout,"%s: WARNING %s reports input grid dimension sizes disagree rgr_map.src_grid_size = %ld != %d = dmn_sz_in[0]. Problem may be caused by incorrect src_grid_dims variable. This is a known issue with some Tempest mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.src_grid_size,dmn_sz_in_int[0]);
+    (void)fprintf(stdout,"%s: WARNING %s reports input grid dimension sizes disagree rgr_map.src_grid_size = %ld != %d = dmn_sz_in[0]. Problem may be caused by incorrect src_grid_dims variable. This is a known issue with some Tempest mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.src_grid_size,dmn_sz_in_int[0]);
       dmn_sz_in_int[0]=rgr_map.src_grid_size;
   } /* !bug */
   if(flg_grd_out_1D && (rgr_map.dst_grid_size != dmn_sz_out_int[0])){
-    (void)fprintf(stdout,"%s: WARNING %s reports output grid dimension sizes disagree rgr_map.dst_grid_size = %ld != %d = dmn_sz_out[0]. Problem may be caused by incorrect dst_grid_dims variable. This is a known issue with some Tempest mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.dst_grid_size,dmn_sz_out_int[0]);
+    (void)fprintf(stdout,"%s: WARNING %s reports output grid dimension sizes disagree rgr_map.dst_grid_size = %ld != %d = dmn_sz_out[0]. Problem may be caused by incorrect dst_grid_dims variable. This is a known issue with some Tempest mapfiles generated prior to ~20150901, and in some ESMF mapfiles for MPAS-O/I. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.dst_grid_size,dmn_sz_out_int[0]);
     dmn_sz_out_int[0]=rgr_map.dst_grid_size;
   } /* !bug */
  
@@ -1305,6 +1306,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_ttl+=lat_wgt_out[idx];
     lat_wgt_ttl_xpc=sin(dgr2rdn*lat_bnd_out[2*(lat_nbr_out-1)+1])-sin(dgr2rdn*lat_bnd_out[0]);
     if(nco_grd_lat_typ != nco_grd_lat_unk) assert(1.0-lat_wgt_ttl/lat_wgt_ttl_xpc < eps_rlt);
+    if(lat_wgt_ttl_xpc < 0.0) abort();  /* CEWI Use lat_wgt_ttl_xpc at least once outside of assert() to avoid gcc 4.8.2 set-but-not-used warning */
   } /* !flg_grd_out_rct */
     
   /* When possible, ensure area_out is non-zero
@@ -1498,7 +1500,15 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int dmn_id_lon; /* [id] Dimension ID */
   if(flg_grd_in_1D){
     long col_nbr_in_dat; /* [nbr] Number of columns in input datafile */
-    rcd=nco_inq_dimid(in_id,col_nm_in,&dmn_id_col);
+    if((rcd=nco_inq_dimid_flg(in_id,col_nm_in,&dmn_id_col)) == NC_NOERR) ; /* Default or command-line option worked, otherwise search usual suspects */
+    else if((rcd=nco_inq_dimid_flg(in_id,"lndgrid",&dmn_id_col)) == NC_NOERR) col_nm_in=strdup("lndgrid"); /* CLM */
+    else if((rcd=nco_inq_dimid_flg(in_id,"nCells",&dmn_id_col)) == NC_NOERR) col_nm_in=strdup("nCells"); /* MPAS-O/I */
+    else if((rcd=nco_inq_dimid_flg(in_id,"nEdges",&dmn_id_col)) == NC_NOERR) col_nm_in=strdup("nEdges"); /* MPAS-O/I */
+    else if((rcd=nco_inq_dimid_flg(in_id,"sounding_id",&dmn_id_col)) == NC_NOERR) col_nm_in=strdup("sounding_id"); /* OCO2 */
+    else{
+      (void)fprintf(stdout,"%s: ERROR %s reports datafile does not contain unstructured dimension name that matches a usual suspect (ncol, lndgrid, nCells, nEdges, sounding_id). HINT: Provide horizontal dimension name with \"-r col_nm=foo\"\n",nco_prg_nm_get(),fnc_nm);
+      nco_exit(EXIT_FAILURE);
+    } /* !col_nm_in */
     rcd=nco_inq_dimlen(in_id,dmn_id_col,&col_nbr_in_dat);
     if(col_nbr_in != col_nbr_in_dat){
       (void)fprintf(stdout,"%s: ERROR %s reports mapfile and data file dimension sizes disagree: mapfile col_nbr_in = %ld != %ld = col_nbr_in from datafile. HINT: Check that source grid (i.e., \"grid A\") used to create mapfile matches grid on which data are stored in input datafile.\n",nco_prg_nm_get(),fnc_nm,col_nbr_in,col_nbr_in_dat);
@@ -1516,12 +1526,15 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       else if((rcd=nco_inq_dimid_flg(in_id,"south_north",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("south_north");
       else if((rcd=nco_inq_dimid_flg(in_id,"south_north_stag",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("south_north_stag");
       else if((rcd=nco_inq_dimid_flg(in_id,"YDim:location",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("YDim:location");
+      else if((rcd=nco_inq_dimid_flg(in_id,"natrack",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("natrack");
       else if((rcd=nco_inq_dimid_flg(in_id,"nj",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("nj");
       else if((rcd=nco_inq_dimid_flg(in_id,"nlat",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("nlat");
+      else if((rcd=nco_inq_dimid_flg(in_id,"nscan",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("nscan");
       else if((rcd=nco_inq_dimid_flg(in_id,"nTimes",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("nTimes");
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoTrack",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("GeoTrack");
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoTrack:L2_Standard_atmospheric&surface_product",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("GeoTrack:L2_Standard_atmospheric&surface_product");
       else if((rcd=nco_inq_dimid_flg(in_id,"Cell_Along_Swath:mod04",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("Cell_Along_Swath:mod04");
+      else if((rcd=nco_inq_dimid_flg(in_id,"CO_Latitude",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("CO_Latitude");
       else{
 	(void)fprintf(stdout,"%s: ERROR %s reports unable to find latitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of latitude dimension name with --rgr lat_nm=name\n",nco_prg_nm_get(),fnc_nm);
 	nco_exit(EXIT_FAILURE);
@@ -1544,6 +1557,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       else if((rcd=nco_inq_dimid_flg(in_id,"XDim:location",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("XDim:location");
       else if((rcd=nco_inq_dimid_flg(in_id,"ni",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("ni");
       else if((rcd=nco_inq_dimid_flg(in_id,"nlon",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("nlon");
+      else if((rcd=nco_inq_dimid_flg(in_id,"npix",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("npix");
+      else if((rcd=nco_inq_dimid_flg(in_id,"npixel",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("npixel");
+      else if((rcd=nco_inq_dimid_flg(in_id,"nxtrack",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("nxtrack");
       else if((rcd=nco_inq_dimid_flg(in_id,"nXtrack",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("nXtrack");
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoXTrack",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("GeoXTrack");
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoXTrack:L2_Standard_atmospheric&surface_product",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("GeoXTrack:L2_Standard_atmospheric&surface_product");
@@ -1563,21 +1579,26 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   /* Do not extract grid variables (that are also extensive variables) like lon, lat, and area
      If necessary, use remap data to diagnose them from scratch
      Other extensive variables (like counts, population) will be extracted and summed not averaged */
-  const int var_xcl_lst_nbr=32; /* [nbr] Number of objects on exclusion list */
+  const int var_xcl_lst_nbr=37; /* [nbr] Number of objects on exclusion list */
   /* Exception list source:
+     AMSR: Latitude, Longitude
      CAM, CERES, CMIP5: lat, lon
      CAM, CMIP5: gw, lat_bnds, lon_bnds
      CAM-SE: area
      CICE: latt_bounds, lont_bounds, latu_bounds, lonu_bounds, TLAT, TLON, ULAT, ULON (NB: CICE uses ?LON and POP uses ?LONG)
      ESMF: gridcell_area
+     GPM: S1_Latitude, S1_Longitude
+     HIRDLS: Latitude
      MAR: LAT, LON
+     MLS: CO_Latitude
      MPAS-O/I: areaCell, latCell, lonCell
      NCO: lat_vertices, lon_vertices
      POP: TLAT, TLONG, ULAT, ULONG  (NB: CICE uses ?LON and POP uses ?LONG) (POP does not archive spatial bounds)
+     TRMM: Latitude, Longitude
      UV-CDAT regridder: bounds_lat, bounds_lon
      Unknown: XLAT_M, XLONG_M
      WRF: XLAT, XLONG */
-    const char *var_xcl_lst[]={"/area","/areaCell","/gridcell_area","/gw","/LAT","/lat","/latCell","/latitude","/TLAT","/ULAT","/XLAT","/XLAT_M","/lat_bnds","/lat_vertices","/latt_bounds","/latu_bounds","/bounds_lat","/LON","/lon","/lonCell","/longitude","/TLON","/TLONG","/ULON","/ULONG","/XLONG","/XLONG_M","/lon_bnds","/lon_vertices","/lont_bounds","/lonu_bounds","/bounds_lon"};
+  const char *var_xcl_lst[]={"/area","/areaCell","/gridcell_area","/gw","/LAT","/lat","/latCell","/Latitude","/latitude","/CO_Latitude","/S1_Latitude","/TLAT","/ULAT","/XLAT","/XLAT_M","/lat_bnds","/lat_vertices","/latt_bounds","/latu_bounds","/bounds_lat","/LON","/lon","/lonCell","/Longitude","/longitude","/S1_Longitude","/TLON","/TLONG","/ULON","/ULONG","/XLONG","/XLONG_M","/lon_bnds","/lon_vertices","/lont_bounds","/lonu_bounds","/bounds_lon"};
   int var_cpy_nbr=0; /* [nbr] Number of copied variables */
   int var_rgr_nbr=0; /* [nbr] Number of regridded variables */
   int var_xcl_nbr=0; /* [nbr] Number of deleted variables */
@@ -1653,7 +1674,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	/* 20150927: Extensive variable treatments are still in alpha-development
 	   Currently testing on AIRS TSurfStd_ct (by summing not averaging)
 	   In future may consider variables that need more complex (non-summing) extensive treatment
-	   MPAS-O has a zillion of these [xyz]Cell, cellsOnCell, fCell, indexToCellID, maxLevelCell, meshDensity
+	   MPAS-O/I has a zillion of these [xyz]Cell, cellsOnCell, fCell, indexToCellID, maxLevelCell, meshDensity
 	   Not to mention the variables that depend on nEdges and nVertices... */
         if(!strcmp(trv.nm,rgr->xtn_var[xtn_idx])){
           trv_tbl->lst[idx_tbl].flg_xtn=True;
@@ -1735,11 +1756,11 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* Define new horizontal dimensions before all else */
   if(flg_grd_out_1D){
-    rcd=nco_def_dim(out_id,col_nm_out,col_nbr_out,&dmn_id_col);
+    rcd+=nco_def_dim(out_id,col_nm_out,col_nbr_out,&dmn_id_col);
   } /* !flg_grd_out_1D */
   if(flg_grd_out_2D){
-    rcd=nco_def_dim(out_id,lat_nm_out,lat_nbr_out,&dmn_id_lat);
-    rcd=nco_def_dim(out_id,lon_nm_out,lon_nbr_out,&dmn_id_lon);
+    rcd+=nco_def_dim(out_id,lat_nm_out,lat_nbr_out,&dmn_id_lat);
+    rcd+=nco_def_dim(out_id,lon_nm_out,lon_nbr_out,&dmn_id_lon);
   } /* !flg_grd_out_2D */
   rcd=nco_inq_dimid_flg(out_id,bnd_tm_nm_out,&dmn_id_bnd_tm);
   /* If dimension has not been defined, define it */
@@ -1760,67 +1781,67 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* Define new coordinates and variables in regridded file */
   if(flg_grd_out_1D){
-    (void)nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&lat_out_id);
+    rcd+=nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&lat_out_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&lon_out_id);
+    rcd+=nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&lon_out_id);
     var_crt_nbr++;
     dmn_ids_out[0]=dmn_id_col;
     dmn_ids_out[1]=dmn_id_bnd;
-    (void)nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_bnd_id);
+    rcd+=nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_bnd_id);
     var_crt_nbr++;
     dmn_ids_out[0]=dmn_id_col;
     dmn_ids_out[1]=dmn_id_bnd;
-    (void)nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_bnd_id);
+    rcd+=nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_bnd_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&area_out_id);
+    rcd+=nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&area_out_id);
     var_crt_nbr++;
     if(flg_frc_out_wrt){
-      (void)nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&frc_out_id);
+      rcd+=nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_col,&frc_out_id);
       var_crt_nbr++;
     } /* !flg_frc_out_wrt */
   } /* !flg_grd_out_1D */
   if(flg_grd_out_crv){
     dmn_ids_out[0]=dmn_id_lat;
     dmn_ids_out[1]=dmn_id_lon;
-    (void)nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_out_id);
+    rcd+=nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_out_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_out_id);
+    rcd+=nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_out_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&area_out_id);
+    rcd+=nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&area_out_id);
     var_crt_nbr++;
     if(flg_frc_out_wrt){
-      (void)nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&frc_out_id);
+      rcd+=nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&frc_out_id);
       var_crt_nbr++;
     } /* !flg_frc_out_wrt */
     dmn_ids_out[0]=dmn_id_lat;
     dmn_ids_out[1]=dmn_id_lon;
     dmn_ids_out[2]=dmn_id_bnd;
-    (void)nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_3D,dmn_ids_out,&lat_bnd_id);
+    rcd+=nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_3D,dmn_ids_out,&lat_bnd_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_3D,dmn_ids_out,&lon_bnd_id);
+    rcd+=nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_3D,dmn_ids_out,&lon_bnd_id);
     var_crt_nbr++;
   } /* !flg_grd_out_crv */
   if(flg_grd_out_rct){
-    (void)nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_lat,&lat_out_id);
+    rcd+=nco_def_var(out_id,lat_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_lat,&lat_out_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_lon,&lon_out_id);
+    rcd+=nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_lon,&lon_out_id);
     var_crt_nbr++;
     dmn_ids_out[0]=dmn_id_lat;
     dmn_ids_out[1]=dmn_id_bnd;
-    (void)nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_bnd_id);
+    rcd+=nco_def_var(out_id,lat_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lat_bnd_id);
     var_crt_nbr++;
     dmn_ids_out[0]=dmn_id_lon;
     dmn_ids_out[1]=dmn_id_bnd;
-    (void)nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_bnd_id);
+    rcd+=nco_def_var(out_id,lon_bnd_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&lon_bnd_id);
     var_crt_nbr++;
-    (void)nco_def_var(out_id,lat_wgt_nm,crd_typ_out,dmn_nbr_1D,&dmn_id_lat,&lat_wgt_id);
+    rcd+=nco_def_var(out_id,lat_wgt_nm,crd_typ_out,dmn_nbr_1D,&dmn_id_lat,&lat_wgt_id);
     var_crt_nbr++;
     dmn_ids_out[0]=dmn_id_lat;
     dmn_ids_out[1]=dmn_id_lon;
-    (void)nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&area_out_id);
+    rcd+=nco_def_var(out_id,area_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&area_out_id);
     var_crt_nbr++;
     if(flg_frc_out_wrt){
-      (void)nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&frc_out_id);
+      rcd+=nco_def_var(out_id,frc_nm_out,crd_typ_out,dmn_nbr_2D,dmn_ids_out,&frc_out_id);
       var_crt_nbr++;
     } /* !flg_frc_out_wrt */
   } /* !flg_grd_out_rct */
@@ -1845,6 +1866,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd+=nco_inq_unlimdims(in_id,&dmn_nbr_rec,dmn_ids_rec);
   } /* !dmn_nbr_rec */
   
+  int flg_pck; /* [flg] Variable is packed on disk  */
+  nco_bool has_mss_val; /* [flg] Has numeric missing value attribute */
+  double mss_val_dbl;
   /* Define regridded and copied variables in output file */
   for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
     trv_tbl->lst[idx_tbl].flg_mrv=True;
@@ -1862,13 +1886,18 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	  /* Regrid */
 	  rcd=nco_inq_vardimid(in_id,var_id_in,dmn_id_in);
 	  dmn_in_fst=0;
+	  rcd=nco_inq_var_packing(in_id,var_id_in,&flg_pck);
+	  if(flg_pck) (void)fprintf(stdout,"%s: WARNING %s reports variable \"%s\" is packed so results unpredictable. HINT: If regridded values seems weird, retry after unpacking input file with, e.g., \"ncpdq -U in.nc out.nc\"\n",nco_prg_nm_get(),fnc_nm,var_nm);
+	  has_mss_val=nco_mss_val_get_dbl(in_id,var_id_in,&mss_val_dbl);
+	  if(has_mss_val && !isfinite(mss_val_dbl)) (void)fprintf(stdout,"%s: WARNING %s reports variable \"%s\" has %s attribute that fails isfinite() (value is %s) so results are unpredictable. HINT: If regridding fails or values seem weird, retry after converting %s to normal number with, e.g., \"ncatted -a %s,%s,m,f,1.0e36 in.nc out.nc\"\n",nco_prg_nm_get(),fnc_nm,var_nm,nco_mss_val_sng_get(),(isnan(mss_val_dbl)) ? "NaN" : ((isinf(mss_val_dbl)) ? "Infinity" : ""),nco_mss_val_sng_get(),nco_m [...]
+	  if(flg_pck) (void)fprintf(stdout,"%s: WARNING %s reports variable \"%s\" is packed so results unpredictable. HINT: If regridded values seem weird, retry after unpacking input file with, e.g., \"ncpdq -U in.nc out.nc\"\n",nco_prg_nm_get(),fnc_nm,var_nm);
 	  for(dmn_idx=0;dmn_idx<dmn_nbr_in;dmn_idx++){
 	    rcd=nco_inq_dimname(in_id,dmn_id_in[dmn_idx],dmn_nm);
 	    //dmn_idx_in_out_pre_rgr[dmn_idx]=dmn_idx;
 	    /* Is horizontal dimension last, i.e., most-rapidly-varying? */
 	    if(flg_grd_in_1D && !strcmp(dmn_nm,col_nm_in)){
 	      if(dmn_idx != dmn_nbr_in-1){
-		/* Unstructured input grid has col in non-MRV location (expect this with, e.g., MPAS-O native grid dimension-ordering */
+		/* Unstructured input grid has col in non-MRV location (expect this with, e.g., MPAS-O/I native grid dimension-ordering */
 		(void)fprintf(stdout,"%s: WARNING %s reports unstructured grid spatial coordinate %s is (zero-based) dimension %d of input variable to be regridded %s which has %d dimensions. NCO regridder has only experimental support for unstructured spatial dimensions that are not the last dimension of input variable.\nHINT: Consider re-arranging input file dimensions to place horizontal dimension(s) last with, e.g., \'ncpdq -a time,lev,%s in.nc out.nc\' prior to calling regridder\n",nco_prg_nm_get [...]
 		trv_tbl->lst[idx_tbl].flg_mrv=False;
 	      } /* !dmn_idx */
@@ -1965,6 +1994,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* end idx_tbl */
 
   /* Free pre-allocated array space */
+  /* col_nm_in will not otherwise be free'd if it was guessed as usual suspect */
+  if(col_nm_in != rgr->col_nm_in) col_nm_in=(char *)nco_free(col_nm_in);
   if(dmn_id_in) dmn_id_in=(int *)nco_free(dmn_id_in);
   if(dmn_id_out) dmn_id_out=(int *)nco_free(dmn_id_out);
   if(dmn_srt) dmn_srt=(long *)nco_free(dmn_srt);
@@ -2378,7 +2409,6 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   double *var_val_dbl_in=NULL;
   double *var_val_dbl_out=NULL;
   double *wgt_vld_out=NULL;
-  double mss_val_dbl;
   double var_val_crr;
   int *tally=NULL; /* [nbr] Number of valid (non-missing) values */
   size_t idx_in; /* [idx] Input grid index */
@@ -2386,7 +2416,6 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int lvl_idx; /* [idx] Level index */
   int lvl_nbr; /* [nbr] Number of levels */
   int thr_idx; /* [idx] Thread index */
-  nco_bool has_mss_val; /* [flg] Has numeric missing value attribute */
   size_t dst_idx; 
   size_t var_sz_in; /* [nbr] Number of elements in variable (will be self-multiplied) */
   size_t var_sz_out; /* [nbr] Number of elements in variable (will be self-multiplied) */
@@ -2789,7 +2818,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
        ncks -O -D 1 -t 1 -v T --rgr nfr=y --rgr idx_dbg=0 --rgr grid=${DATA}/sld/rgr/grd_wrf.nc ${DATA}/hdf/wrfout_v2_Lambert_notime.nc ~/foo.nc # Infer grid
        ESMF_RegridWeightGen -s ${DATA}/sld/rgr/grd_wrf.nc -d ${DATA}/grids/180x360_SCRIP.20150901.nc -w ${DATA}/sld/rgr/map_wrf_to_dst_aave.nc --method conserve --src_regional --ignore_unmapped # Template map
        ncks -O -D 1 -t 1 -v T --map=${DATA}/sld/rgr/map_wrf_to_dst_aave.nc ${DATA}/hdf/wrfout_v2_Lambert_notime.nc ~/foo.nc # Regrid manually
-       sld_nco.sh -v T -s ${DATA}/hdf/wrfout_v2_Lambert_notime.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -o ${DATA}/sld/rgr # Regrid automatically
+       ncremap -v T -i ${DATA}/hdf/wrfout_v2_Lambert_notime.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -o ${DATA}/sld/rgr # Regrid automatically
        GenerateOverlapMesh --a ${DATA}/sld/rgr/grd_wrf.nc --b ${DATA}/grids/180x360_SCRIP.20150901.nc --out ${DATA}/sld/rgr/msh_ovr_wrf_to_180x360.g */
     if(False) (void)fprintf(stderr,"%s: INFO %s reports curvilinear grid reached end-of-the-line\n",nco_prg_nm_get(),fnc_nm);
     nco_exit(EXIT_FAILURE);
@@ -2993,7 +3022,7 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
  double * const area) /* [sr] Gridcell area */
 {
   /* Purpose: Compute area of spherical polygon */
-  /* Use L'Huilier's Theorem not Girard's Formula
+  /* In general, prefer L'Huilier's Theorem to Girard's Formula
      http://mathworld.wolfram.com/LHuiliersTheorem.html
      Girard's formula depends on pi-minus-angle and angle is usually quite small in our applications so precision would be lost
      L'Huilier's theorem depends only on angles (a,b,c) and semi-perimeter (s) and is well-conditioned for small angles
@@ -3002,6 +3031,15 @@ nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
      SE is also the solid angle subtended by the spherical triangle and that's, well, astonishing and pretty cool
      Wikipedia shows a better SE formula for triangles which are ill-conditioned for L'Huillier's formula because a = b ~ 0.5c
      https://en.wikipedia.org/wiki/Spherical_trigonometry#Area_and_spherical_excess 
+     See also interesting discussion of L'Huillier by Charles Karney who suggests his own alternative:
+     http://osgeo-org.1560.x6.nabble.com/Area-of-a-spherical-polygon-td3841625.html
+     The discussion mentions Mil94
+     Robert D. Miller, Computing the area of a spherical polygon, Graphic Gems IV, chapter II.4, pages 132-137.
+     http://books.google.com/books?id=CCqzMm_-WucC&pg=PA132&lpg=PA132&dq=miller+area+spherical+polygon+gems&source=bl&ots=mrnvZ6NJcm&sig=CMg8eaD8dzP5snMaPeCQzgoFWUk&hl=sv&ei=4G-YTKv5GsWZOI-mmZQP&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBQQ6AEwAA#v=onepage&q&f=false  
+     Mil94 contains similar ideas to my method for spherical polygons (decomposing into adjacent multiple triangles from single vertex)
+     However, his method places the single vertex at the pole, then adds signed areas to obtain the full polygon area
+     Unclear whether his method suffers from degraded precision because of roundoff error and long side-lengths
+     
      So-called "proper" spherical triangle are those for which all angles are less than pi, so a+b+c<3*pi
      Cartesian coordinates of (lat,lon)=(theta,phi) are (x,y,z)=(cos(theta)*cos(phi),cos(theta)*sin(phi),sin(theta)) 
      Dot-product rule for vectors gives interior angle/arc length between two points:
@@ -3469,33 +3507,55 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
      NCAR:
      /glade/p/cesm/cseg/mapping/grids
 
-     Generate global RLL grids:
+     Global RLL grids:
      ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr grid=${DATA}/grids/180x360_SCRIP.20150901.nc --rgr latlon=180,360 --rgr lat_typ=eqa --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
      ncks -O -D 1 --rgr grd_ttl='Equiangular grid 90x180' --rgr grid=${DATA}/grids/90x180_SCRIP.20150901.nc --rgr latlon=90,180 --rgr lat_typ=eqa --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
 
-     Generate maps for global RLL grids:
+     Maps for global RLL grids:
      ESMF_RegridWeightGen -s ${DATA}/grids/180x360_SCRIP.20150901.nc -d ${DATA}/grids/90x180_SCRIP.20150901.nc -w ${DATA}/maps/map_180x360_to_90x180.20150901.nc --method conserve
      ESMF_RegridWeightGen -s ${DATA}/grids/90x180_SCRIP.20150901.nc -d ${DATA}/grids/180x360_SCRIP.20150901.nc -w ${DATA}/maps/map_90x180_to_180x360.20150901.nc --method conserve
 
-     Generate ACME grids:
+     ACME grids:
      ncks -O -D 1 --rgr grd_ttl='FV-scalar grid 129x256' --rgr grid=${DATA}/grids/129x256_SCRIP.20150910.nc --rgr latlon=129,256 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr  ~/nco/data/in.nc ~/foo.nc
      ncks -O -D 1 --rgr grd_ttl='FV-scalar grid 257x512' --rgr grid=${DATA}/grids/257x512_SCRIP.20150910.nc --rgr latlon=257,512 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr  ~/nco/data/in.nc ~/foo.nc
      ncks -O -D 1 --rgr grd_ttl='FV-scalar grid 801x1600' --rgr grid=${DATA}/grids/801x1600_SCRIP.20150910.nc --rgr latlon=801,1600 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr  ~/nco/data/in.nc ~/foo.nc
 
-     Generate ACME maps:
+     ACME maps:
      ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/129x256_SCRIP.20150910.nc -w ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150910.nc --method conserve
      ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/257x512_SCRIP.20150910.nc -w ${DATA}/maps/map_ne30np4_to_fv257x512_bilin.20150910.nc --method bilinear
      ESMF_RegridWeightGen -s ${DATA}/grids/ne120np4_pentagons.100310.nc -d ${DATA}/grids/257x512_SCRIP.20150910.nc -w ${DATA}/maps/map_ne120np4_to_fv257x512_aave.20150910.nc --method conserve
      ESMF_RegridWeightGen -s ${DATA}/grids/ne120np4_pentagons.100310.nc -d ${DATA}/grids/801x1600_SCRIP.20150910.nc -w ${DATA}/maps/map_ne120np4_to_fv801x1600_bilin.20150910.nc --method bilinear
 
-     Generate regional RLL grids:
+     AMWG grids:
+     ncks -O -D 1 --rgr grd_ttl='CAM FV-scalar grid 97x144 for horizontal resolution 1.9x2.5 degrees' --rgr grid=${DATA}/grids/97x144_SCRIP.20160301.nc --rgr latlon=97,144 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
+     ncks -O -D 1 --rgr grd_ttl='CAM FV-scalar grid 193x288 for horizontal resolution 0.9x1.25 degrees' --rgr grid=${DATA}/grids/193x288_SCRIP.20160301.nc --rgr latlon=193,288 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
+
+     AMWG maps:
+     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/97x144_SCRIP.20160301.nc -w ${DATA}/maps/map_ne30np4_to_fv97x144_bilin.20160301.nc --method bilinear
+     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/193x288_SCRIP.20160301.nc -w ${DATA}/maps/map_ne30np4_to_fv193x288_bilin.20160301.nc --method bilinear
+     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/97x144_SCRIP.20160301.nc -w ${DATA}/maps/map_ne30np4_to_fv97x144_aave.20160301.nc --method conserve
+     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/193x288_SCRIP.20160301.nc -w ${DATA}/maps/map_ne30np4_to_fv193x288_aave.20160301.nc --method conserve
+
+     ncremap -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/97x144_SCRIP.20160301.nc -m ${DATA}/maps/map_ne30np4_to_fv97x144_bilin.20160301.nc -w tempest -a bilinear
+     ncremap -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/193x288_SCRIP.20160301.nc -m ${DATA}/maps/map_ne30np4_to_fv193x288_bilin.20160301.nc -w tempest -a bilinear
+     ncremap -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/97x144_SCRIP.20160301.nc -m ${DATA}/maps/map_ne30np4_to_fv97x144_aave.20160301.nc -w tempest -a conserve
+     ncremap -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/193x288_SCRIP.20160301.nc -m ${DATA}/maps/map_ne30np4_to_fv193x288_aave.20160301.nc -w tempest -a conserve
+
+     Regional RLL grids:
      ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr grid=${DATA}/sld/rgr/grd_dst.nc --rgr latlon=100,100 --rgr snwe=30.0,70.0,-120.0,-90.0 ~/nco/data/in.nc ~/foo.nc
 
-     Generate global RLL skeleton:
+     Global RLL skeleton:
      ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr skl=${DATA}/sld/rgr/skl_180x360.nc --rgr grid=${DATA}/grids/180x360_SCRIP.20150901.nc --rgr latlon=180,360 --rgr lat_typ=eqa --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
 
-     Generate curvilinear grids:
-     ncks -O -D 1 --rgr grd_ttl='Curvilinear grid 10x20' --rgr lon_crv=1.0 --rgr grid=${DATA}/sld/rgr/grd_crv.nc --rgr latlon=10,20 --rgr snwe=-5.0,5.0,-10.0,10.0 ~/nco/data/in.nc ~/foo.nc */
+     Curvilinear grids:
+     ncks -O -D 1 --rgr grd_ttl='Curvilinear grid 10x20. Degenerate case.' --rgr crv=Y --rgr lon_crv=0.0 --rgr skl=${DATA}/sld/rgr/skl_crv.nc --rgr grid=${DATA}/sld/rgr/grd_crv.nc --rgr latlon=10,20 --rgr snwe=-5.0,5.0,-10.0,10.0 ~/nco/data/in.nc ~/foo.nc
+     ncks -O -D 1 --rgr grd_ttl='Curvilinear grid 10x20. Curvilinearity = 1.0 lon' --rgr lon_crv=1.0 --rgr skl=${DATA}/sld/rgr/skl_crv.nc --rgr grid=${DATA}/sld/rgr/grd_crv.nc --rgr latlon=10,20 --rgr snwe=-5.0,5.0,-10.0,10.0 ~/nco/data/in.nc ~/foo.nc
+
+     1-D Latitude (no longitude) grids:
+     ncks -O -D 1 --rgr grd_ttl='Latitude-only zonal grid' --rgr skl=${DATA}/sld/rgr/skl_lat_10dgr_uni.nc --rgr grid=${DATA}/sld/rgr/grd_lat_10dgr_uni.nc --rgr latlon=18,1 --rgr snwe=-90,90,0,360  ~/nco/data/in.nc ~/foo.nc
+     ncks -O -D 1 --rgr grd_ttl='Latitude-only zonal grid' --rgr skl=${DATA}/sld/rgr/skl_lat_05dgr_cap.nc --rgr grid=${DATA}/sld/rgr/grd_lat_05dgr_cap.nc --rgr latlon=37,1 --rgr snwe=-90,90,0,360  ~/nco/data/in.nc ~/foo.nc
+     ncremap -i ${DATA}/sld/rgr/skl_lat_10dgr_uni.nc -d ${DATA}/sld/rgr/skl_lat_05dgr_cap.nc -m ${DATA}/maps/map_lat10uni_to_lat05cap_aave.nc -o ~/rgr/lat10to05.nc
+     ESMF_RegridWeightGen -s ${DATA}/sld/rgr/grd_lat_10dgr_uni.nc -d ${DATA}/sld/rgr/grd_lat_05dgr_cap.nc -w ${DATA}/maps/map_lat10uni_to_lat05cap_aave.nc --method conserve */
 
   const char fnc_nm[]="nco_grd_mk()"; /* [sng] Function name */
 
@@ -4612,16 +4672,19 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
   int dmn_id_lon; /* [id] Dimension ID */
 
   /* Locate dimensions that must be present in unstructured files */
-  if((rcd=nco_inq_dimid_flg(in_id,"ncol",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("ncol"); 
-  else if((rcd=nco_inq_dimid_flg(in_id,"lndgrid",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("lndgrid");
-  else if((rcd=nco_inq_dimid_flg(in_id,"nCells",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("nCells");
+  if((rcd=nco_inq_dimid_flg(in_id,"ncol",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("ncol"); /* CAM */
+  else if((rcd=nco_inq_dimid_flg(in_id,"lndgrid",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("lndgrid"); /* CLM */
+  else if((rcd=nco_inq_dimid_flg(in_id,"nCells",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("nCells"); /* MPAS-O/I */
+  else if((rcd=nco_inq_dimid_flg(in_id,"nEdges",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("nEdges"); /* MPAS-O/I */
+  else if((rcd=nco_inq_dimid_flg(in_id,"sounding_id",&dmn_id_col)) == NC_NOERR) col_dmn_nm=strdup("sounding_id"); /* OCO2 */
   if(col_dmn_nm) flg_grd_1D=True;
 
   /* Locate dimensions that must be present in rectangular files */
   if((rcd=nco_inq_dimid_flg(in_id,"latitude",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("latitude");
   else if((rcd=nco_inq_dimid_flg(in_id,"lat",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("lat");
-  else if((rcd=nco_inq_dimid_flg(in_id,"Latitude",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("Latitude");
+  else if((rcd=nco_inq_dimid_flg(in_id,"Latitude",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("Latitude"); /* HIRDLS */
   else if((rcd=nco_inq_dimid_flg(in_id,"Lat",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("Lat");
+  else if((rcd=nco_inq_dimid_flg(in_id,"CO_Latitude",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("CO_Latitude"); /* MLS */
 
   if((rcd=nco_inq_dimid_flg(in_id,"longitude",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("longitude");
   else if((rcd=nco_inq_dimid_flg(in_id,"lon",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("lon");
@@ -4641,12 +4704,15 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
       else if((rcd=nco_inq_dimid_flg(in_id,"phony_dim_0",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("phony_dim_0"); /* OMI */
       else if((rcd=nco_inq_dimid_flg(in_id,"y",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("phony_dim_0"); /* MAR */
       else if((rcd=nco_inq_dimid_flg(in_id,"lat2d",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("phony_dim_0"); /* RACMO */
+      else if((rcd=nco_inq_dimid_flg(in_id,"natrack",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("natrack"); /* MODIS DeepBlue SeaWiFS L2 */
       else if((rcd=nco_inq_dimid_flg(in_id,"nj",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("nj"); /* CICE */
       else if((rcd=nco_inq_dimid_flg(in_id,"nlat",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("nlat"); /* POP */
+      else if((rcd=nco_inq_dimid_flg(in_id,"nscan",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("nscan"); /* AMSR, TRMM */
     } /* !lat_dmn_nm */
     if(!lon_dmn_nm){
       if((rcd=nco_inq_dimid_flg(in_id,"west_east",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("west_east"); /* WRF */
       else if((rcd=nco_inq_dimid_flg(in_id,"XDim:location",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("XDim:location"); /* AIRS L3 */
+      else if((rcd=nco_inq_dimid_flg(in_id,"nxtrack",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("nxtrack"); /* MODIS DeepBlue SeaWiFS L2 */
       else if((rcd=nco_inq_dimid_flg(in_id,"nXtrack",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("nXtrack"); /* OMI L2 */
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoXTrack",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("GeoXTrack"); /* AIRS L2 DAP NC */
       else if((rcd=nco_inq_dimid_flg(in_id,"GeoXTrack:L2_Standard_atmospheric&surface_product",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("GeoXTrack:L2_Standard_atmospheric&surface_product"); /* AIRS L2 HDF */
@@ -4656,6 +4722,8 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
       else if((rcd=nco_inq_dimid_flg(in_id,"lon2d",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("phony_dim_1"); /* RACMO */
       else if((rcd=nco_inq_dimid_flg(in_id,"ni",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("ni"); /* CICE */
       else if((rcd=nco_inq_dimid_flg(in_id,"nlon",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("nlon"); /* POP */
+      else if((rcd=nco_inq_dimid_flg(in_id,"npix",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("npix"); /* AMSR */
+      else if((rcd=nco_inq_dimid_flg(in_id,"npixel",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("npixel"); /* TRMM */
     } /* !lon_dmn_nm */
     if(lat_dmn_nm && lon_dmn_nm) flg_grd_crv=True;
   } /* !lat_dmn_nm */
@@ -4674,25 +4742,31 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
   if((rcd=nco_inq_dimid_flg(in_id,"nv",&dmn_id_bnd)) == NC_NOERR) bnd_dmn_nm=strdup("nv"); /* fxm */
   else if((rcd=nco_inq_dimid_flg(in_id,"nvertices",&dmn_id_bnd)) == NC_NOERR) bnd_dmn_nm=strdup("nvertices"); /* CICE */
   
-  /* Locate fields that must be present in input file */
+  /* Locate fields that must be present in input file
+     Currently these variables must be in root group
+     This fails for, e.g., OMI L2 which has coordinates /GEOLOCATION_DATA/[Latitude,Longitude]
+     fxm: Generalize with traversal table so usual suspect coordinates may be in any group */
   if((rcd=nco_inq_varid_flg(in_id,"latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("latitude");
-  else if((rcd=nco_inq_varid_flg(in_id,"Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("Latitude");
+  else if((rcd=nco_inq_varid_flg(in_id,"Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("Latitude"); /* AMSR, HIRDLS, TRMM */
   else if((rcd=nco_inq_varid_flg(in_id,"lat",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("lat"); /* CAM */
   else if((rcd=nco_inq_varid_flg(in_id,"Lat",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("Lat");
   else if((rcd=nco_inq_varid_flg(in_id,"XLAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("XLAT"); /* WRF */
   else if((rcd=nco_inq_varid_flg(in_id,"XLAT_M",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("XLAT_M"); /* Unknown */
   else if((rcd=nco_inq_varid_flg(in_id,"LAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("LAT"); /* MAR */
   else if((rcd=nco_inq_varid_flg(in_id,"TLAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("TLAT"); /* CICE, POP */
+  else if((rcd=nco_inq_varid_flg(in_id,"CO_Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("CO_Latitude"); /* MLS */
+  else if((rcd=nco_inq_varid_flg(in_id,"S1_Latitude",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("S1_Latitude"); /* GPM */
   else if((rcd=nco_inq_varid_flg(in_id,"ULAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("ULAT"); /* CICE, POP */
   else if((rcd=nco_inq_varid_flg(in_id,"latCell",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("latCell"); /* MPAS-O/I */
 
   if((rcd=nco_inq_varid_flg(in_id,"longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("longitude");
-  else if((rcd=nco_inq_varid_flg(in_id,"Longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("Longitude");
+  else if((rcd=nco_inq_varid_flg(in_id,"Longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("Longitude"); /* AMSR, TRMM */
   else if((rcd=nco_inq_varid_flg(in_id,"lon",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("lon"); /* CAM */
   else if((rcd=nco_inq_varid_flg(in_id,"Lon",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("Lon");
   else if((rcd=nco_inq_varid_flg(in_id,"XLONG",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("XLONG"); /* WRF */
   else if((rcd=nco_inq_varid_flg(in_id,"XLONG_M",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("XLONG_M"); /* Unknown */
   else if((rcd=nco_inq_varid_flg(in_id,"LON",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("LON"); /* MAR */
+  else if((rcd=nco_inq_varid_flg(in_id,"S1_Longitude",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("S1_Longitude"); /* GPM */
   else if((rcd=nco_inq_varid_flg(in_id,"TLON",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("TLON"); /* CICE */
   else if((rcd=nco_inq_varid_flg(in_id,"TLONG",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("TLONG"); /* POP */
   else if((rcd=nco_inq_varid_flg(in_id,"ULON",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("ULON"); /* CICE */
@@ -4833,6 +4907,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
   else if((rcd=nco_inq_varid_flg(in_id,"grid_area",&area_id)) == NC_NOERR) area_nm_in=strdup("grid_area");
   else if((rcd=nco_inq_varid_flg(in_id,"tarea",&area_id)) == NC_NOERR) area_nm_in=strdup("tarea"); /* CICE */
   else if((rcd=nco_inq_varid_flg(in_id,"uarea",&area_id)) == NC_NOERR) area_nm_in=strdup("uarea"); /* CICE */
+
   if((rcd=nco_inq_varid_flg(in_id,"mask",&msk_id)) == NC_NOERR) msk_nm_in=strdup("mask");
   else if((rcd=nco_inq_varid_flg(in_id,"Mask",&msk_id)) == NC_NOERR) msk_nm_in=strdup("Mask");
   else if((rcd=nco_inq_varid_flg(in_id,"grid_imask",&msk_id)) == NC_NOERR) msk_nm_in=strdup("grid_imask");
@@ -4840,7 +4915,8 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 
   /* Mask field requires special handling for non-conformant models */
   if(msk_id != NC_MIN_INT){
-    /* 20151201: All models tested define mask as NC_INT except CICE which uses NC_FLOAT */
+    /* 20151201: All models tested define mask as NC_INT except CICE which uses NC_FLOAT
+       20160111: No observations tested define mask except AMSR which uses NC_SHORT to store bitmasks. Bitmask is 1 for missing data, and up to 128 for various quality levels of valid data. Hence, almost better to ignore AMSR mask variable. */
     rcd=nco_inq_vartype(in_id,msk_id,&msk_typ);
     msk_unn.vp=(void *)nco_malloc(grd_sz_nbr*nco_typ_lng(msk_typ));
   } /* !msk */
@@ -4871,7 +4947,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     rcd=nco_get_vara(in_id,lon_ctr_id,dmn_srt,dmn_cnt,lon_ctr,crd_typ);
     /* CICE lists missing value for lat/lon_ctr arrays (TLAT, TLONG) and re-uses that for bounds arrays */
     has_mss_val_ctr=nco_mss_val_get_dbl(in_id,lat_ctr_id,&mss_val_ctr_dbl);
-
+    
     /* 20150923: Also input, if present in curvilinear file, corners, area, and mask
        area and mask are same size as lat and lon */
     if(area_id != NC_MIN_INT) rcd=nco_get_vara(in_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
@@ -4950,6 +5026,13 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     if(lon_bnd_id != NC_MIN_INT) rcd=nco_get_vara(in_id,lon_bnd_id,dmn_srt,dmn_cnt,lon_bnd,crd_typ);
   } /* !flg_grd_2D */
 
+  /* 20160115: AMSR coordinates are packed as NC_SHORT with scale_value=0.01f. What to do? Is it worth unpacking everything? */
+  int flg_pck; /* [flg] Variable is packed on disk  */
+  rcd=nco_inq_var_packing(in_id,lat_ctr_id,&flg_pck);
+  if(flg_pck) (void)fprintf(stdout,"%s: WARNING %s reports lat_ctr variable \"%s\" is packed so results unpredictable. HINT: If grid-generation causes problems, retry after unpacking input file with, e.g., \"ncpdq -U in.nc out.nc\"\n",nco_prg_nm_get(),fnc_nm,lat_nm_in);
+  rcd=nco_inq_var_packing(in_id,lon_ctr_id,&flg_pck);
+  if(flg_pck) (void)fprintf(stdout,"%s: WARNING %s reports lon_ctr variable \"%s\" is packed so results unpredictable. HINT: If grid-generation causes problems, retry after unpacking input file with, e.g., \"ncpdq -U in.nc out.nc\"\n",nco_prg_nm_get(),fnc_nm,lon_nm_in);
+
   /* Close input netCDF file */
   nco_close(in_id);
 
@@ -5013,13 +5096,17 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	  lon_ctr_fk[idx_fk]=lon_ctr[idx_rl];
 	} /* !lon */
       } /* !lat */
+      /* Formulae to extrapolate sides and corners of fake grid are written as a starting lat/lon plus or minus adjustment
+	 Adjustment is positive-definite if grid monotonically increases in latitude and longitude from LL to UR 
+	 20160111: Use macros/functions to determine longitude adjustments that are always less than 180
+	 This ensures all longitudes contributing to extrapolated longitude are from same branch cut */
       /* Bottom row */
       lat_idx=0; /* lat idx of extrapolated point on fake grid */
       for(lon_idx=1;lon_idx<lon_nbr+1;lon_idx++){ /* lon idx of extrapolated point on fake grid */
 	idx_fk=lat_idx*(lon_nbr+2)+lon_idx; /* 1D-offset of extrapolated point on bottom row of fake grid */
 	idx_rl=lat_idx*lon_nbr+lon_idx-1; /* 1D-offset of neighboring point on bottom row of real grid */
 	lat_ctr_fk[idx_fk]=lat_ctr[idx_rl]-(lat_ctr[idx_rl+lon_nbr]-lat_ctr[idx_rl]);
-	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]-(lon_ctr[idx_rl+lon_nbr]-lon_ctr[idx_rl]);
+	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]-nco_lon_dff_brnch(lon_ctr[idx_rl+lon_nbr],lon_ctr[idx_rl]);
       } /* !lon */
       /* Top row */
       lat_idx=lat_nbr+1; /* lat idx of extrapolated point on fake grid */
@@ -5027,7 +5114,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	idx_fk=lat_idx*(lon_nbr+2)+lon_idx; /* 1D-offset of extrapolated point on top row of fake grid */
 	idx_rl=(lat_nbr-1)*lon_nbr+lon_idx-1; /* 1D-offset of neighboring point on top row of real grid */
 	lat_ctr_fk[idx_fk]=lat_ctr[idx_rl]+(lat_ctr[idx_rl]-lat_ctr[idx_rl-lon_nbr]);
-	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]+(lon_ctr[idx_rl]-lon_ctr[idx_rl-lon_nbr]);
+	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]+nco_lon_dff_brnch(lon_ctr[idx_rl],lon_ctr[idx_rl-lon_nbr]);
       } /* !lon */
       /* Left side */
       lon_idx=0; /* lon idx of extrapolated point on fake grid */
@@ -5035,7 +5122,7 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	idx_fk=lat_idx*(lon_nbr+2)+lon_idx; /* 1D-offset of extrapolated point on left side of fake grid */
 	idx_rl=(lat_idx-1)*lon_nbr+lon_idx; /* 1D-offset of neighboring point on left side of real grid */
 	lat_ctr_fk[idx_fk]=lat_ctr[idx_rl]-(lat_ctr[idx_rl+1]-lat_ctr[idx_rl]);
-	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]-(lon_ctr[idx_rl+1]-lon_ctr[idx_rl]);
+	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]-nco_lon_dff_brnch(lon_ctr[idx_rl+1],lon_ctr[idx_rl]);
       } /* !lat */
       /* Right side */
       lon_idx=lon_nbr+1; /* lon idx of extrapolated point on fake grid */
@@ -5043,20 +5130,20 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	idx_fk=lat_idx*(lon_nbr+2)+lon_idx; /* 1D-offset of extrapolated point on right side of fake grid */
 	idx_rl=(lat_idx-1)*lon_nbr+lon_idx-2; /* 1D-offset of neighboring point on right side of real grid */
 	lat_ctr_fk[idx_fk]=lat_ctr[idx_rl]+(lat_ctr[idx_rl]-lat_ctr[idx_rl-1]);
-	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]+(lon_ctr[idx_rl]-lon_ctr[idx_rl-1]);
+	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl]+nco_lon_dff_brnch(lon_ctr[idx_rl],lon_ctr[idx_rl-1]);
       } /* !lat */
       /* LL */
       lat_ctr_fk[0]=lat_ctr_fk[lon_nbr+2]-(lat_ctr_fk[2*(lon_nbr+2)]-lat_ctr_fk[lon_nbr+2]);
-      lon_ctr_fk[0]=lon_ctr_fk[1]-(lon_ctr_fk[2]-lon_ctr_fk[1]);
+      lon_ctr_fk[0]=lon_ctr_fk[1]-nco_lon_dff_brnch(lon_ctr_fk[2],lon_ctr_fk[1]);
       /* LR */
       lat_ctr_fk[lon_nbr+1]=lat_ctr_fk[2*(lon_nbr+2)-1]-(lat_ctr_fk[3*(lon_nbr+2)-1]-lat_ctr_fk[2*(lon_nbr+2)-1]);
-      lon_ctr_fk[lon_nbr+1]=lon_ctr_fk[lon_nbr]+(lon_ctr_fk[lon_nbr]-lon_ctr_fk[lon_nbr-1]);
+      lon_ctr_fk[lon_nbr+1]=lon_ctr_fk[lon_nbr]+nco_lon_dff_brnch(lon_ctr_fk[lon_nbr],lon_ctr_fk[lon_nbr-1]);
       /* UR */
       lat_ctr_fk[(lat_nbr+2)*(lon_nbr+2)-1]=lat_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-1]+(lat_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-1]-lat_ctr_fk[lat_nbr*(lon_nbr+2)-1]);
-      lon_ctr_fk[(lat_nbr+2)*(lon_nbr+2)-1]=lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-2]+(lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-2]-lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-3]);
+      lon_ctr_fk[(lat_nbr+2)*(lon_nbr+2)-1]=lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-2]+nco_lon_dff_brnch(lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-2],lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)-3]);
       /* UL */
       lat_ctr_fk[(lat_nbr+1)*(lon_nbr+2)]=lat_ctr_fk[lat_nbr*(lon_nbr+2)]+(lat_ctr_fk[lat_nbr*(lon_nbr+2)]-lat_ctr_fk[(lat_nbr-1)*(lon_nbr+2)]);
-      lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)]=lon_ctr_fk[lat_nbr*(lon_nbr+2)+1]-(lon_ctr_fk[lat_nbr*(lon_nbr+2)+2]-lon_ctr_fk[lat_nbr*(lon_nbr+2)+1]);
+      lon_ctr_fk[(lat_nbr+1)*(lon_nbr+2)]=lon_ctr_fk[lat_nbr*(lon_nbr+2)+1]-nco_lon_dff_brnch(lon_ctr_fk[lat_nbr*(lon_nbr+2)+2],lon_ctr_fk[lat_nbr*(lon_nbr+2)+1]);
 
       if(nco_dbg_lvl_get() >= nco_dbg_std){
 	long idx_dbg;
@@ -5064,6 +5151,8 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	(void)fprintf(stderr,"%s: INFO %s idx_dbg = %li, Fake Center [lat,lon]=[%g,%g]\n",nco_prg_nm_get(),fnc_nm,idx_dbg,lat_ctr_fk[idx_dbg],lon_ctr_fk[idx_dbg]);
       } /* !dbg */
       
+      const int idx_ccw=0; /* [idx] Index of starting vertice for CCW check (Point A = tail side AB) */
+      const int rcr_lvl=1; /* [nbr] Recursion level */
       long int lat_idx_fk; /* [idx] Index into fake (extrapolated) latitude  array */
       long int lon_idx_fk; /* [idx] Index into fake (extrapolated) longitude array */
       long int idx_fk_crn_ll_ctr_ll;
@@ -5082,6 +5171,11 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
       long int idx_fk_crn_ul_ctr_lr;
       long int idx_fk_crn_ul_ctr_ur;
       long int idx_fk_crn_ul_ctr_ul;
+      nco_bool flg_ccw; /* [flg] Gridcell is CCW */
+      double *crn_lat;
+      double *crn_lon;
+      crn_lat=(double *)nco_malloc(grd_crn_nbr*sizeof(double));
+      crn_lon=(double *)nco_malloc(grd_crn_nbr*sizeof(double));
       for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
 	for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
 	  /* 9-point template valid at all interior (non-edge) points in real grid, and at all points (including edges) in fake grid
@@ -5117,22 +5211,58 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	  idx_fk_crn_ul_ctr_ur=idx_fk+(lon_nbr+2); // (lat_idx+1)*lon_nbr+lon_idx
 	  idx_fk_crn_ul_ctr_ul=idx_fk+(lon_nbr+2)-1; // (lat_idx+1)*lon_nbr+lon_idx-1;
 	  
+	  /* 20160111: Algorithm requires that all longitudes in template be on same "branch cut"
+	     If, say, LL longitude is 179.0 and LR longitude is -179.0 then their sum and average are zero, not 180.0 or -180.0 as desired */
+	  crn_lat[0]=lat_ctr_fk[idx_fk_crn_ll_ctr_ll];
+	  crn_lat[1]=lat_ctr_fk[idx_fk_crn_ll_ctr_lr];
+	  crn_lat[2]=lat_ctr_fk[idx_fk_crn_ll_ctr_ur];
+	  crn_lat[3]=lat_ctr_fk[idx_fk_crn_ll_ctr_ul];
+	  crn_lon[0]=lon_ctr_fk[idx_fk_crn_ll_ctr_ll];
+	  crn_lon[1]=lon_ctr_fk[idx_fk_crn_ll_ctr_lr];
+	  crn_lon[2]=lon_ctr_fk[idx_fk_crn_ll_ctr_ur];
+	  crn_lon[3]=lon_ctr_fk[idx_fk_crn_ll_ctr_ul];
+	  //	  flg_ccw=nco_ccw_chk(crn_lat,crn_lon,grd_crn_nbr,idx_ccw,rcr_lvl);
+
+	  //	  if(flg_ccw) nco_crn2ctr(crn_lat,crn_lon,crn_nbr,lat_crn+idx_crn_ll,lon_crn+idx_crn_ll);
+
 	  idx_crn_ll=grd_crn_nbr*idx_rl+0;
 	  lat_crn[idx_crn_ll]=0.25*(lat_ctr_fk[idx_fk_crn_ll_ctr_ll]+lat_ctr_fk[idx_fk_crn_ll_ctr_lr]+lat_ctr_fk[idx_fk_crn_ll_ctr_ur]+lat_ctr_fk[idx_fk_crn_ll_ctr_ul]);
-	  lon_crn[idx_crn_ll]=0.25*(lon_ctr_fk[idx_fk_crn_ll_ctr_ll]+lon_ctr_fk[idx_fk_crn_ll_ctr_lr]+lon_ctr_fk[idx_fk_crn_ll_ctr_ur]+lon_ctr_fk[idx_fk_crn_ll_ctr_ul]);
+	  lon_crn[idx_crn_ll]=nco_lon_crn_avg_brnch(lon_ctr_fk[idx_fk_crn_ll_ctr_ll],lon_ctr_fk[idx_fk_crn_ll_ctr_lr],lon_ctr_fk[idx_fk_crn_ll_ctr_ur],lon_ctr_fk[idx_fk_crn_ll_ctr_ul]);
 	  idx_crn_lr=grd_crn_nbr*idx_rl+1;
 	  lat_crn[idx_crn_lr]=0.25*(lat_ctr_fk[idx_fk_crn_lr_ctr_ll]+lat_ctr_fk[idx_fk_crn_lr_ctr_lr]+lat_ctr_fk[idx_fk_crn_lr_ctr_ur]+lat_ctr_fk[idx_fk_crn_lr_ctr_ul]);
-	  lon_crn[idx_crn_lr]=0.25*(lon_ctr_fk[idx_fk_crn_lr_ctr_ll]+lon_ctr_fk[idx_fk_crn_lr_ctr_lr]+lon_ctr_fk[idx_fk_crn_lr_ctr_ur]+lon_ctr_fk[idx_fk_crn_lr_ctr_ul]);
+	  lon_crn[idx_crn_lr]=nco_lon_crn_avg_brnch(lon_ctr_fk[idx_fk_crn_lr_ctr_ll],lon_ctr_fk[idx_fk_crn_lr_ctr_lr],lon_ctr_fk[idx_fk_crn_lr_ctr_ur],lon_ctr_fk[idx_fk_crn_lr_ctr_ul]);
 	  idx_crn_ur=grd_crn_nbr*idx_rl+2;
 	  lat_crn[idx_crn_ur]=0.25*(lat_ctr_fk[idx_fk_crn_ur_ctr_ll]+lat_ctr_fk[idx_fk_crn_ur_ctr_lr]+lat_ctr_fk[idx_fk_crn_ur_ctr_ur]+lat_ctr_fk[idx_fk_crn_ur_ctr_ul]);
-	  lon_crn[idx_crn_ur]=0.25*(lon_ctr_fk[idx_fk_crn_ur_ctr_ll]+lon_ctr_fk[idx_fk_crn_ur_ctr_lr]+lon_ctr_fk[idx_fk_crn_ur_ctr_ur]+lon_ctr_fk[idx_fk_crn_ur_ctr_ul]);
+	  lon_crn[idx_crn_ur]=nco_lon_crn_avg_brnch(lon_ctr_fk[idx_fk_crn_ur_ctr_ll],lon_ctr_fk[idx_fk_crn_ur_ctr_lr],lon_ctr_fk[idx_fk_crn_ur_ctr_ur],lon_ctr_fk[idx_fk_crn_ur_ctr_ul]);
 	  idx_crn_ul=grd_crn_nbr*idx_rl+3;
 	  lat_crn[idx_crn_ul]=0.25*(lat_ctr_fk[idx_fk_crn_ul_ctr_ll]+lat_ctr_fk[idx_fk_crn_ul_ctr_lr]+lat_ctr_fk[idx_fk_crn_ul_ctr_ur]+lat_ctr_fk[idx_fk_crn_ul_ctr_ul]);
-	  lon_crn[idx_crn_ul]=0.25*(lon_ctr_fk[idx_fk_crn_ul_ctr_ll]+lon_ctr_fk[idx_fk_crn_ul_ctr_lr]+lon_ctr_fk[idx_fk_crn_ul_ctr_ur]+lon_ctr_fk[idx_fk_crn_ul_ctr_ul]);
+	  lon_crn[idx_crn_ul]=nco_lon_crn_avg_brnch(lon_ctr_fk[idx_fk_crn_ul_ctr_ll],lon_ctr_fk[idx_fk_crn_ul_ctr_lr],lon_ctr_fk[idx_fk_crn_ul_ctr_ur],lon_ctr_fk[idx_fk_crn_ul_ctr_ul]);
+
+	  crn_lat[0]=lat_crn[idx_crn_ll];
+	  crn_lat[1]=lat_crn[idx_crn_lr];
+	  crn_lat[2]=lat_crn[idx_crn_ur];
+	  crn_lat[3]=lat_crn[idx_crn_ul];
+	  crn_lon[0]=lon_crn[idx_crn_ll];
+	  crn_lon[1]=lon_crn[idx_crn_lr];
+	  crn_lon[2]=lon_crn[idx_crn_ur];
+	  crn_lon[3]=lon_crn[idx_crn_ul];
+	  flg_ccw=nco_ccw_chk(crn_lat,crn_lon,grd_crn_nbr,idx_ccw,rcr_lvl);
+	  if(!flg_ccw) (void)fprintf(stdout,"%s: %s WARNING reports non-CCW gridcell at idx=%li, (lat,lon)_idx=(%li,%li), (lat,lon) = (%g, %g)\n",nco_prg_nm_get(),fnc_nm,idx_rl,lat_idx,lon_idx,lat_ctr[lat_idx],lon_ctr[lon_idx]);
+	  lat_crn[idx_crn_ll]=crn_lat[0];
+	  lat_crn[idx_crn_lr]=crn_lat[1];
+	  lat_crn[idx_crn_ur]=crn_lat[2];
+	  lat_crn[idx_crn_ul]=crn_lat[3];
+	  lon_crn[idx_crn_ll]=crn_lon[0];
+	  lon_crn[idx_crn_lr]=crn_lon[1];
+	  lon_crn[idx_crn_ur]=crn_lon[2];
+	  lon_crn[idx_crn_ul]=crn_lon[3];
+
 	} /* !lon */
       } /* !lat */
       if(lat_ctr_fk) lat_ctr_fk=(double *)nco_free(lat_ctr_fk);
       if(lon_ctr_fk) lon_ctr_fk=(double *)nco_free(lon_ctr_fk);
+      if(crn_lon) crn_lon=(double *)nco_free(crn_lon);
+      if(crn_lat) crn_lat=(double *)nco_free(crn_lat);
     } /* !(lat_bnd_id && lon_bnd_id) */
     
     /* As of 20151205, use same sanity check for both inferred and copied curvilinear grids
@@ -5529,7 +5659,9 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
     for(idx=0;idx<grd_sz_nbr;idx++) msk[idx]=1;
   }else{
     /* Change missing value mask points to 0 integer mask for SCRIP grids, which have no missing value convention
-       Application: CICE mask is NC_FLOAT and uses NC_FLOAT missing value */
+       Applications: 
+       CICE mask is NC_FLOAT and uses NC_FLOAT missing value
+       AMSR mask is NC_SHORT and has no missing value */
     switch(msk_typ){
     case NC_FLOAT:
       if(has_mss_val_msk){
@@ -5558,6 +5690,17 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
 	for(idx=0;idx<grd_sz_nbr;idx++) msk[idx]=msk_unn.ip[idx];
       } /* !mss_val */
       break;
+    case NC_SHORT:
+      if(has_mss_val_msk){
+	const float mss_val_sht=mss_val_msk_dbl;
+	for(idx=0;idx<grd_sz_nbr;idx++)
+	  if(msk_unn.sp[idx] == mss_val_sht) msk[idx]=0; else msk[idx]=msk_unn.sp[idx];
+      }else{
+	for(idx=0;idx<grd_sz_nbr;idx++) msk[idx]=msk_unn.sp[idx];
+	/* 20160111: AMSR kludge fxm */
+	//	for(idx=0;idx<grd_sz_nbr;idx++) if(msk[idx] == 1) msk[idx]=0;
+      } /* !mss_val */
+      break;
     default:
       (void)fprintf(stderr,"%s: ERROR %s unknown mask type\n",nco_prg_nm_get(),fnc_nm);
       nco_dfl_case_generic_err();
@@ -5793,3 +5936,214 @@ nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
   return rcd;
 
 } /* !nco_grd_nfr() */
+
+double /* O [dgr] Longitude difference (lon_r-lon_l) */
+nco_lon_dff_brnch /* [fnc] Subtract longitudes with branch-cut rules */
+(double lon_r, /* I [dgr] Longitude on right of gridcell (subtractor) */
+ double lon_l) /* I [dgr] Longitude on  left of gridcell (subtractee) */
+{
+  /* Purpose: Return difference of two longitudes in degrees
+     Assume longitudes are within 180 degrees of eachother
+     Default orientation is monotonically increasing longitude from left to right */
+  const char fnc_nm[]="nco_lon_dff_brnch()";
+  const double lon_dff=lon_r-lon_l; /* [dgr] Longitude difference (lon_r-lon_l) */
+  if(lon_dff >= 180.0){
+    (void)fprintf(stdout,"%s: WARNING %s reports lon_r, lon_l, lon_dff = %g, %g, %g\n",nco_prg_nm_get(),fnc_nm,lon_r,lon_l,lon_dff);
+    return lon_dff-360.0;
+  }else if(lon_dff <= -180.0){
+    return lon_dff+360.0;
+  } /* !lon_dff */
+
+  return lon_dff;
+} /* !nco_lon_dff_brnch() */
+
+double /* O [dgr] Longitude average (lon_r-lon_l) */
+nco_lon_crn_avg_brnch /* [fnc] Average quadrilateral longitude with branch-cut rules */
+(double lon_ll, /* I [dgr] Longitude at lower left  of gridcell */
+ double lon_lr, /* I [dgr] Longitude at lower right of gridcell */
+ double lon_ur, /* I [dgr] Longitude at upper right of gridcell */
+ double lon_ul) /* I [dgr] Longitude at upper left  of gridcell */
+{
+  /* Purpose: Return average of four corner longitudes of quadrilateral
+     Assume longitudes are within 180 degrees of eachother
+     Default orientation is monotonically increasing longitude from left to right 
+     WLOG, adjust all longitudes to be on same branch as lon_ll */
+  const char fnc_nm[]="nco_lon_crn_avg_brnch()";
+  double lon_dff; /* [dgr] Longitude difference */
+
+  lon_dff=lon_lr-lon_ll;
+  if(lon_dff >= 180.0){
+    if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stdout,"%s: INFO %s reports lon_lr, lon_ll, lon_dff = %g, %g, %g\n",nco_prg_nm_get(),fnc_nm,lon_lr,lon_ll,lon_dff);
+    lon_lr-=360.0;
+  }else if(lon_dff <= -180.0){
+    lon_lr+=360.0;
+  } /* !lon_dff */
+
+  lon_dff=lon_ur-lon_ll;
+  if(lon_dff >= 180.0){
+    if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stdout,"%s: INFO %s reports lon_ur, lon_ll, lon_dff = %g, %g, %g\n",nco_prg_nm_get(),fnc_nm,lon_ur,lon_ll,lon_dff);
+    lon_ur-=360.0;
+  }else if(lon_dff <= -180.0){
+    lon_ur+=360.0;
+  } /* !lon_dff */
+
+  lon_dff=lon_ul-lon_ll;
+  if(lon_dff >= 180.0){
+    if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stdout,"%s: INFO %s reports lon_ul, lon_ll, lon_dff = %g, %g, %g\n",nco_prg_nm_get(),fnc_nm,lon_ul,lon_ll,lon_dff);
+    lon_ul-=360.0;
+  }else if(lon_dff <= -180.0){
+    lon_ul+=360.0;
+  } /* !lon_dff */
+  
+  return 0.25*(lon_ll+lon_lr+lon_ur+lon_ul);
+} /* !nco_lon_crn_avg_brnch() */
+
+nco_bool /* O [flg] Input corners were CCW */
+nco_ccw_chk /* [fnc] Convert quadrilateral gridcell corners to CCW orientation */
+(double * const crn_lat, /* [dgr] Latitude corners of gridcell */
+ double * const crn_lon, /* [dgr] Latitude corners of gridcell */
+ const int crn_nbr, /* [nbr] Number of corners per gridcell */
+ int idx_ccw, /* [idx] Index of starting vertice for CCW check (Point A = tail side AB) */
+ const int rcr_lvl) /* [nbr] Recursion level */
+{
+  /* Purpose: Determine whether corner vertices are oriented CCW
+     If not, alter order so they are returned in CCW order
+     Function can call itself, and rcr_lvl indicates recursion level:
+     rcr_lvl=1: Called by host code, i.e., nco_grd_nfr()
+     rcr_lvl=2: Called by itself, i.e., nco_ccw_chk()
+     Algorithm:
+     Start crn_idx=0, i.e., quadrilateral LL corner
+     Vector A runs from crn_idx=0 to crn_idx=1, i.e., quadrilateral LL->LR
+     Vector B runs from crn_idx=1 to crn_idx=2, i.e., quadrilateral LR->UR
+     Compute cross-product A x B = C
+     C is normal to plane containining A and B
+     Dot-product of C with radial vector to head A = tail B is positive if A and B are CCW
+     if(ABC is CCW){
+       if(CDA is CCW) 
+         Done 
+       else 
+         Copy D:=A (make CDA degenerate, triangularize quadrilateral)
+       endif
+     }else(ABC is not CCW){
+       Assume entire quadrilateral is CW
+       Take mirror image of quadrilateral by switching B with D
+       If(new ABC is CCW){
+         If(CDA is CCW) 
+           Done 
+	 else 
+	   Copy D:=A (make CDA degenerate, triangularize quadrilateral)
+         endif
+       }else{
+         Fail (return False, meaning point should be masked)
+     }
+     All cases return True (i.e., CCW) from rcr_lvl=1 except last
+     Last case returns False, and calling code should mask such an aberrant point */ 
+  const char fnc_nm[]="nco_ccw_chk()";
+  const int CRN_NBR_MSVC=4;
+  double A_tail_x,A_tail_y,A_tail_z;
+  double A_head_x,A_head_y,A_head_z;
+  double A_x,A_y,A_z;
+  double B_tail_x,B_tail_y,B_tail_z;
+  double B_head_x,B_head_y,B_head_z;
+  double B_x,B_y,B_z;
+  double C_x,C_y,C_z;
+  double R_x,R_y,R_z;
+  double lat_rdn;
+  double lon_rdn;
+  /* fxm dumb MSVC compiler chokes unless array size is compile-time constant */
+  double sin_lat[CRN_NBR_MSVC];
+  double sin_lon[CRN_NBR_MSVC];
+  double cos_lat[CRN_NBR_MSVC];
+  double cos_lon[CRN_NBR_MSVC];
+  double dot_prd;
+  int crn_idx; /* [idx] Corner idx */
+  int A_tail_idx,A_head_idx;
+  int B_tail_idx,B_head_idx;
+  nco_bool flg_ccw; /* [flg] Input is CCW */
+
+  assert(crn_nbr == CRN_NBR_MSVC);
+  for(crn_idx=0;crn_idx<crn_nbr;crn_idx++){
+    lat_rdn=crn_lat[crn_idx]*M_PI/180.0;
+    lon_rdn=crn_lon[crn_idx]*M_PI/180.0;
+    sin_lat[crn_idx]=sin(lat_rdn);
+    cos_lat[crn_idx]=cos(lat_rdn);
+    sin_lon[crn_idx]=sin(lon_rdn);
+    cos_lon[crn_idx]=cos(lon_rdn);
+  } /* !crn_idx */
+
+  /* Calls from host code (i.e., nco_grd_nfr()) start at lower-left of quadrilateral ABCD = Point A = vertex 0
+     Calls from self can start from quadrilateral Point A or C 
+     To check triangle CDA, start at upper-right of quadrilateral ABCD = Point C = vertex 2 */
+  A_tail_idx=idx_ccw;
+  A_head_idx=B_tail_idx=(A_tail_idx+1)%crn_nbr;
+  B_head_idx=(B_tail_idx+1)%crn_nbr;
+  A_tail_x=cos_lat[A_tail_idx]*cos_lon[A_tail_idx];
+  A_tail_y=cos_lat[A_tail_idx]*sin_lon[A_tail_idx];
+  A_tail_z=sin_lat[A_tail_idx];
+  A_head_x=B_tail_x=R_x=cos_lat[A_head_idx]*cos_lon[A_head_idx];
+  A_head_y=B_tail_y=R_y=cos_lat[A_head_idx]*sin_lon[A_head_idx];
+  A_head_z=B_tail_z=R_z=sin_lat[A_head_idx];
+  B_head_x=cos_lat[B_head_idx]*cos_lon[B_head_idx];
+  B_head_y=cos_lat[B_head_idx]*sin_lon[B_head_idx];
+  B_head_z=sin_lat[B_head_idx];
+  A_x=A_head_x-A_tail_x;
+  A_y=A_head_y-A_tail_y;
+  A_z=A_head_z-A_tail_z;
+  B_x=B_head_x-B_tail_x;
+  B_y=B_head_y-B_tail_y;
+  B_z=B_head_z-B_tail_z;
+  /* Cross-Product C = A x B */
+  C_x=A_y*B_z-B_y*A_z;
+  C_y=-A_x*B_z+B_x*A_z;
+  C_z=A_x*B_y-B_x*A_y;
+  /* Dot-Product R dot C */
+  dot_prd=C_x*R_x+C_y*R_y+C_z*R_z;
+
+  if(dot_prd > 0.0) flg_ccw=True; else flg_ccw=False;
+
+  if(flg_ccw && crn_nbr == 4 && rcr_lvl == 1){
+    /* Original ABC is CCW, now check CDA */
+    idx_ccw=2;
+    flg_ccw=nco_ccw_chk(crn_lat,crn_lon,crn_nbr,idx_ccw,rcr_lvl+1);
+    if(!flg_ccw && nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stdout,"%s: WARNING %s reports triangle ABC is and CDA is not CCW in quadrilateral gridcell with LL (lat,lon) = (%g, %g), dot_prd = %g. Setting D:=A to triangularize quadrilateral.\n",nco_prg_nm_get(),fnc_nm,*crn_lat+0,*crn_lon+0,dot_prd);
+    /* Triangularize quadrilateral D:=A */
+    crn_lat[3]=crn_lat[0];
+    crn_lon[3]=crn_lon[0];
+    return True;
+  }else if(!flg_ccw && crn_nbr == 4 && rcr_lvl == 1){
+    /* Original ABC is not CCW
+       20160124: Simplistic fix: reverse gridpoint order
+       This only works for quadrilaterals without degenerate points */
+    double crn_tmp;
+    if(!flg_ccw && nco_dbg_lvl_get() >= nco_dbg_io) (void)fprintf(stdout,"%s: INFO %s reports triangle ABC is non-CCW in quadrilateral gridcell with LL (lat,lon) = (%g, %g), dot_prd = %g. Mirror-imaging...\n",nco_prg_nm_get(),fnc_nm,*crn_lat+0,*crn_lon+0,dot_prd);
+    crn_tmp=crn_lat[1];
+    crn_lat[1]=crn_lat[3];
+    crn_lat[3]=crn_tmp;
+    crn_tmp=crn_lon[1];
+    crn_lon[1]=crn_lon[3];
+    crn_lon[3]=crn_tmp;
+    /* Check new triangle ABC */
+    idx_ccw=0;
+    flg_ccw=nco_ccw_chk(crn_lat,crn_lon,crn_nbr,idx_ccw,rcr_lvl+1);
+    if(flg_ccw){
+      /* Inverted ABC is CCW, now check CDA */
+      idx_ccw=2;
+      flg_ccw=nco_ccw_chk(crn_lat,crn_lon,crn_nbr,idx_ccw,rcr_lvl+1);
+      if(flg_ccw){
+	return True;
+      }else{
+	if(!flg_ccw && nco_dbg_lvl_get() >= nco_dbg_io) (void)fprintf(stdout,"%s: INFO %s reports triangle ABC is CCW after inversion, but triangle CDA is not at quadrilateral gridcell with LL (lat,lon) = (%g, %g), dot_prd = %g. Setting D:=A to triangularize quadrilateral.\n",nco_prg_nm_get(),fnc_nm,*crn_lat+0,*crn_lon+0,dot_prd);
+	/* Triangularize quadrilateral D:=A */
+	crn_lat[3]=crn_lat[0];
+	crn_lon[3]=crn_lon[0];
+	return True;
+      } /* flg_ccw */
+    }else{
+      /* Original and Inverted ABC are not CCW */
+      if(!flg_ccw && nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stdout,"%s: WARNING %s reports triangle ABC remains non-CCW after first inversion\n",nco_prg_nm_get(),fnc_nm);
+      return False;
+    } /* !flg_ccw */
+  } /* flg_ccw */
+    
+  return flg_ccw;
+} /* !nco_ccw_chk() */
diff --git a/src/nco/nco_rgr.h b/src/nco/nco_rgr.h
index 25b337e..757a007 100644
--- a/src/nco/nco_rgr.h
+++ b/src/nco/nco_rgr.h
@@ -206,6 +206,26 @@ extern "C" {
   nco_tps_cmd_sng /* [fnc] Convert Tempest remap command enum to command name */
   (const nco_rgr_cmd_typ nco_rgr_cmd); /* I [enm] Tempest remap command enum */
 
+  double /* O [dgr] Longitude difference (lon_r-lon_l) */
+  nco_lon_dff_brnch /* [fnc] Subtract longitudes with branch-cut rules */
+  (double lon_r, /* I [dgr] Longitude on right of gridcell (subtractor) */
+   double lon_l); /* I [dgr] Longitude on  left of gridcell (subtractee) */
+
+  double /* O [dgr] Longitude average (lon_r-lon_l) */
+  nco_lon_crn_avg_brnch /* [fnc] Average quadrilateral longitude with branch-cut rules */
+  (double lon_ll, /* I [dgr] Longitude at lower left  of gridcell */
+   double lon_lr, /* I [dgr] Longitude at lower right of gridcell */
+   double lon_ur, /* I [dgr] Longitude at upper right of gridcell */
+   double lon_ul); /* I [dgr] Longitude at upper left  of gridcell */
+
+  nco_bool /* O [flg] Input corners were CCW */
+  nco_ccw_chk /* [fnc] Convert quadrilateral gridcell corners to CCW orientation */
+  (double * const crn_lat, /* [dgr] Latitude corners of gridcell */
+   double * const crn_lon, /* [dgr] Latitude corners of gridcell */
+   const int crn_nbr, /* [nbr] Number of corners per gridcell */
+   int idx_ccw, /* [idx] Index of starting vertice for CCW check (Point A = tail side AB) */
+   const int rcr_lvl); /* [nbr] Recursion level */
+
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif /* __cplusplus */
diff --git a/src/nco/nco_rth_utl.c b/src/nco/nco_rth_utl.c
index effb877..93a486c 100644
--- a/src/nco/nco_rth_utl.c
+++ b/src/nco/nco_rth_utl.c
@@ -72,6 +72,7 @@ nco_opr_nrm /* [fnc] Normalization of arithmetic operations for ncra/nces */
     }else{ /* !var_prc[idx]->is_crd_var */
       switch(nco_op_typ_cpy){
       case nco_op_avg: /* Normalize sum by tally to create mean */
+      case nco_op_mebs: /* Normalize sum by tally to create mean */
       case nco_op_sqrt: /* Normalize sum by tally to create mean */
       case nco_op_sqravg: /* Normalize sum by tally to create mean */
       case nco_op_rms: /* Normalize sum of squares by tally to create mean square */
@@ -83,15 +84,18 @@ nco_opr_nrm /* [fnc] Normalization of arithmetic operations for ncra/nces */
         break;
       case nco_op_min: /* Minimum is already in buffer, do nothing */
       case nco_op_max: /* Maximum is already in buffer, do nothing */
+      case nco_op_mibs: /* Minimum absolute value is already in buffer, do nothing */
       case nco_op_mabs: /* Maximum absolute value is already in buffer, do nothing */
         break;
+      case nco_op_tabs: /* Total absolute value is already in buffer, stuff missing values into elements with zero tally */
       case nco_op_ttl: /* Total is already in buffer, stuff missing values into elements with zero tally */
         (void)nco_var_tll_zro_mss_val(var_prc_out[idx]->type,var_prc_out[idx]->sz,var_prc[idx]->has_mss_val,var_prc_out[idx]->mss_val,var_prc[idx]->tally,var_prc_out[idx]->val);
         break;
       default:
+	nco_dfl_case_generic_err();
         break;
       } /* end switch */
-      /* Some operations require additional processing */
+      /* A few operations require additional processing */
       switch(nco_op_typ_cpy) {
       case nco_op_rms: /* Take root of mean of sum of squares to create root mean square */
       case nco_op_rmssdn: /* Take root of sdn mean of sum of squares to create root mean square for sdn */
@@ -101,7 +105,18 @@ nco_opr_nrm /* [fnc] Normalization of arithmetic operations for ncra/nces */
       case nco_op_sqravg: /* Square mean to create square of the mean (for sdn) */
         (void)nco_var_mlt(var_prc_out[idx]->type,var_prc_out[idx]->sz,var_prc_out[idx]->has_mss_val,var_prc_out[idx]->mss_val,var_prc_out[idx]->val,var_prc_out[idx]->val);
         break;
+      case nco_op_avg:
+      case nco_op_ttl:
+      case nco_op_min:
+      case nco_op_max:
+      case nco_op_mibs:
+      case nco_op_mabs:
+      case nco_op_mebs:
+      case nco_op_tabs:
+      case nco_op_avgsqr:
+        break;
       default:
+	nco_dfl_case_generic_err();
         break;
       } /* end switch */
     } /* !var_prc[idx]->is_crd_var */
@@ -158,10 +173,8 @@ nco_opr_drv /* [fnc] Intermediate control of arithmetic operations for ncra/nces
     break;	
   case nco_op_mebs: /* Mean absolute value */
     /* Always take the absolute value of the fresh input
-       Then, on first loop, copy variable from var_prc to var_prc_out like min and max
-       Following loops, do comparative maximum after taking absolute value */
+       Every loop add and increment tally like avg, sqrt, sqravg */
     (void)nco_var_abs(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->val);
-    if(idx_rec == 0) (void)nco_var_copy(var_prc->type,var_prc->sz,var_prc->val,var_prc_out->val); 
     (void)nco_var_add_tll_ncra(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->tally,var_prc->wgt_crr,var_prc->wgt_sum,var_prc->val,var_prc_out->val);
     break;	
   case nco_op_mibs: /* Mean absolute value */
@@ -171,6 +184,11 @@ nco_opr_drv /* [fnc] Intermediate control of arithmetic operations for ncra/nces
     (void)nco_var_abs(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->val);
     if(idx_rec == 0) (void)nco_var_copy(var_prc->type,var_prc->sz,var_prc->val,var_prc_out->val); else (void)nco_var_min_bnr(var_prc_out->type,var_prc_out->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->val,var_prc_out->val);
     break;	
+  case nco_op_tabs: /* Total absolute value */
+    /* Same as ttl but take absolute first */
+    (void)nco_var_abs(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->val);
+    if(idx_rec == 0) (void)nco_var_copy_tll(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->tally,var_prc->val,var_prc_out->val); else (void)nco_var_add_tll_ncra(var_prc->type,var_prc->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->tally,var_prc->wgt_crr,var_prc->wgt_sum,var_prc->val,var_prc_out->val);
+    break;
   case nco_op_ttl: /* Total */
     /* NB: Copying input to output on first loop for nco_op_ttl, in similar manner to nco_op_[max/min], can work
        However, copying with nco_var_copy() would not change the tally variable, leaving it equal to zero
@@ -199,6 +217,9 @@ nco_opr_drv /* [fnc] Intermediate control of arithmetic operations for ncra/nces
     /* Sum the squares */
     (void)nco_var_add_tll_ncra(var_prc_out->type,var_prc_out->sz,var_prc->has_mss_val,var_prc->mss_val,var_prc->tally,var_prc->wgt_crr,var_prc->wgt_sum,var_prc->val,var_prc_out->val);
     break;
+  default:
+    nco_dfl_case_generic_err();
+    break; /* [enm] Nil or undefined operation type */
   } /* end switch */
 } /* end nco_opr_drv() */
 
@@ -213,6 +234,7 @@ nco_op_typ_cf_sng /* [fnc] Convert arithmetic operation type enum to string */
   case nco_op_min: return "minimum"; break; /* [enm] Minimum value */
   case nco_op_max: return "maximum"; break; /* [enm] Maximum value */
   case nco_op_ttl: return "sum"; break; /* [enm] Linear sum */
+  case nco_op_tabs: return "sum_absolute_value"; break; /* [enm] Total absolute value */
   case nco_op_mabs: return "maximum_absolute_value"; break; /* [enm] Maximum absolute value */
   case nco_op_mebs: return "mean_absolute_value"; break; /* [enm] Mean absolute value */
   case nco_op_mibs: return "minimum_absolute_value"; break; /* [enm] Minimum absolute value */
@@ -227,7 +249,8 @@ nco_op_typ_cf_sng /* [fnc] Convert arithmetic operation type enum to string */
   case nco_op_dvd:
   case nco_op_nil:
   default:
-    return "BROKEN";
+    nco_dfl_case_generic_err();
+    return "BROKEN"; /* CEWI */
     break; /* [enm] Nil or undefined operation type */
   } /* end switch */
 } /* end nco_op_typ_cf_sng() */
@@ -274,6 +297,7 @@ nco_op_typ_get /* [fnc] Convert user-specified operation into operation key */
   if(!strcmp(nco_op_sng,"sqravg")) return nco_op_sqravg;
   if(!strcmp(nco_op_sng,"sqrt") || !strcmp(nco_op_sng,"square-root")) return nco_op_sqrt;
   if(!strcmp(nco_op_sng,"total") || !strcmp(nco_op_sng,"ttl") || !strcmp(nco_op_sng,"sum")) return nco_op_ttl;
+  if(!strcmp(nco_op_sng,"tabs") || !strcmp(nco_op_sng,"ttlabs") || !strcmp(nco_op_sng,"sumabs")) return nco_op_tabs;
 
   if(!strcmp(nco_op_sng,"add") || !strcmp(nco_op_sng,"+") || !strcmp(nco_op_sng,"addition")) return nco_op_add;
   if(!strcmp(nco_op_sng,"sbt") || !strcmp(nco_op_sng,"-") || !strcmp(nco_op_sng,"dff") || !strcmp(nco_op_sng,"diff") || !strcmp(nco_op_sng,"sub") || !strcmp(nco_op_sng,"subtract") || !strcmp(nco_op_sng,"subtraction")) return nco_op_sbt;
@@ -282,7 +306,7 @@ nco_op_typ_get /* [fnc] Convert user-specified operation into operation key */
 
   (void)fprintf(stderr,"%s: ERROR %s reports unknown user-specified operation type \"%s\"\n",nco_prg_nm,fnc_nm,nco_op_sng);
   (void)fprintf(stderr,"%s: HINT Valid operation type (op_typ) choices:\n",nco_prg_nm);
-  if(nco_prg_id == ncbo) (void)fprintf(stderr,"addition: add,+,addition\nsubtraction: sbt,-,dff,diff,sub,subtract,subtraction\nmultiplication: mlt,*,mult,multiply,multiplication\ndivision: dvd,/,divide,division\n"); else (void)fprintf(stderr,"min or minimum, max or maximum, mabs or maximum_absolute_value, mebs or mean_absolute_value, mibs or maximum_absolute_value, ttl or total or sum, avg or average or mean, sqrt or square-root, sqravg, avgsqr, rms or root-mean-square, rmssdn\n");
+  if(nco_prg_id == ncbo) (void)fprintf(stderr,"addition: add,+,addition\nsubtraction: sbt,-,dff,diff,sub,subtract,subtraction\nmultiplication: mlt,*,mult,multiply,multiplication\ndivision: dvd,/,divide,division\n"); else (void)fprintf(stderr,"min or minimum, max or maximum, mabs or maximum_absolute_value, mebs or mean_absolute_value, mibs or maximum_absolute_value, tabs or ttlabs or sumabs, ttl or total or sum, avg or average or mean, sqrt or square-root, sqravg, avgsqr, rms or root-mean [...]
   nco_exit(EXIT_FAILURE);
   return False; /* Statement should not be reached */
 } /* end nco_op_typ_get() */
diff --git a/src/nco/nco_sng_utl.c b/src/nco/nco_sng_utl.c
index 11a2b13..133d0e9 100644
--- a/src/nco/nco_sng_utl.c
+++ b/src/nco/nco_sng_utl.c
@@ -613,7 +613,9 @@ nco_sng2kvm /* [fnc] Parse string into key-value pair */
   int arg_idx=0; /* [nbr] */
   kvm_sct kvm;
 
-  /* NB: Replace strtok() by strsep()? strtok() does not handle consecutive delimiters well */
+  /* NB: Replace strtok() by strsep()? strtok() does not handle consecutive delimiters well
+     20160216: String values that contain delimiter will fail
+     fxm replace all but first delimiter with temporary character until strtok() finishes */
   tkn_sng=strtok(sng,dlm);
   while(tkn_sng){
     arg_idx++;
diff --git a/src/nco/nco_var_avg.h b/src/nco/nco_var_avg.h
index 378fce6..a0cfccc 100644
--- a/src/nco/nco_var_avg.h
+++ b/src/nco/nco_var_avg.h
@@ -14,6 +14,7 @@
 #define NCO_VAR_AVG_H
 
 /* Standard header files */
+#include <math.h> /* sin cos cos sin 3.14159 isfinite isinf isnan */
 #include <stdio.h> /* stderr, FILE, NULL, printf */
 
 /* 3rd party vendors */
diff --git a/src/nco/nco_var_utl.c b/src/nco/nco_var_utl.c
index b8c915b..b8b75e6 100644
--- a/src/nco/nco_var_utl.c
+++ b/src/nco/nco_var_utl.c
@@ -1004,9 +1004,10 @@ nco_var_free /* [fnc] Free all memory associated with variable structure */
 
   /* String values must be deep-free'd, everything else is a flat buffer */
   if(var->type == (nc_type)NC_STRING){
-    /* 20140212: ncwa may free this memory twice because reduced variable not created correctly in nco_var_avg()
-       Temporarily only free string variables during debugging */
-    if(nco_dbg_lvl_get() == nco_dbg_crr)
+    /* 20140212: ncwa may free this memory twice because reduced variable not created correctly in nco_var_avg() as per TODO nco1127
+       Temporarily only free string variables during debugging
+       20160115: Henry using var_sct for new ncap2 var lists, needs string memory free'd, so deep-free() strings in ncap2, and only deep-free with others during debugging */
+    if(nco_dbg_lvl_get() == nco_dbg_crr || nco_prg_id_get() == ncap)
       if(var->val.vp) var->val.vp=(void *)nco_sng_lst_free((char **)var->val.vp,var->sz);
   }else{
     if(var->val.vp) var->val.vp=nco_free(var->val.vp);
diff --git a/src/nco/ncpdq.c b/src/nco/ncpdq.c
index a381ee5..77a4ff5 100644
--- a/src/nco/ncpdq.c
+++ b/src/nco/ncpdq.c
@@ -677,13 +677,6 @@ main(int argc,char **argv)
   /* Initialize chunking from user-specified inputs */
   if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC) rcd+=nco_cnk_ini(in_id,fl_out,cnk_arg,cnk_nbr,cnk_map,cnk_plc,cnk_min_byt,cnk_sz_byt,cnk_sz_scl,&cnk);
 
-  /* Catenate time-stamped command line to "history" global attribute */
-  if(HISTORY_APPEND) (void)nco_hst_att_cat(out_id,cmd_ln);
-  if(HISTORY_APPEND && FORCE_APPEND) (void)nco_prv_att_cat(fl_in,in_id,out_id);
-  if(gaa_nbr > 0) (void)nco_glb_att_add(out_id,gaa_arg,gaa_nbr);
-  if(HISTORY_APPEND) (void)nco_vrs_att_cat(out_id);
-  if(thr_nbr > 0 && HISTORY_APPEND) (void)nco_thr_att_cat(out_id,thr_nbr);
-
   /* Determine and set new dimensionality in metadata of each re-ordered variable */
   if(IS_REORDER) (void)nco_var_dmn_rdr_mtd_trv(trv_tbl,nbr_var_prc,var_prc,var_prc_out,nbr_var_fix,var_fix,dmn_rdr,dmn_rdr_nbr,dmn_rvr_rdr);
 
diff --git a/src/nco/ncra.c b/src/nco/ncra.c
index 71e8139..db7442e 100644
--- a/src/nco/ncra.c
+++ b/src/nco/ncra.c
@@ -461,6 +461,10 @@ main(int argc,char **argv)
 
     /* Process long options without short option counterparts */
     if(opt == 0){
+      if(!strcmp(opt_crr,"baa") || !strcmp(opt_crr,"bit_alg")){
+	nco_baa_cnv=(unsigned short int)strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
+	if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
+      } /* endif baa */
       if(!strcmp(opt_crr,"bfr_sz_hnt") || !strcmp(opt_crr,"buffer_size_hint")){
         bfr_sz_hnt=strtoul(optarg,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
         if(*sng_cnv_rcd) nco_sng_cnv_err(optarg,"strtoul",sng_cnv_rcd);
@@ -1329,13 +1333,13 @@ main(int argc,char **argv)
         int mbr_srt=trv_tbl->nsm[idx_nsm].mbr_srt;
         int mbr_end=trv_tbl->nsm[idx_nsm].mbr_end;
 
-        /* Loop over members of current ensemble (use start and end members, multi file cases) */
+        /* Loop over ensemble members in current file (use start and end members, multi-file cases) */
         for(int idx_mbr=mbr_srt;idx_mbr<mbr_end;idx_mbr++){
 
           /* Loop over all variables */
           for(int idx_prc=0;idx_prc<nbr_var_prc;idx_prc++){ 
 
-            /* Obtain variable GTT object for the member *variable* in ensemble (the ones to average) */
+            /* Obtain variable GTT object for member variable in ensemble */
             var_trv=trv_tbl_var_nm_fll(var_prc[idx_prc]->nm_fll,trv_tbl);
             assert(var_trv);
 
@@ -1380,7 +1384,7 @@ main(int argc,char **argv)
           } /* end loop over var_prc */
         } /* end loop over mbr */
 
-      } /* Loop over ensembles in current file */
+      } /* !idx_mbr */
 
       (void)trv_tbl_free(trv_tbl1);
 
@@ -1419,13 +1423,12 @@ main(int argc,char **argv)
 
   /* Subcycle argument warning */
   if(nco_prg_id == ncra || nco_prg_id == ncrcat){ /* fxm: Remove this or make DBG when crd_val SSC/MRO is predictable? */
-    /* Loop records */
     for(idx_rec=0;idx_rec<nbr_rec;idx_rec++){
       /* Check subcycle for each record */
       if(lmt_rec[idx_rec]->ssc != 1L && (lmt_rec[idx_rec]->lmt_typ == lmt_crd_val || lmt_rec[idx_rec]->lmt_typ == lmt_udu_sng)){
         (void)fprintf(stderr,"\n%s: WARNING Subcycle argument SSC used in hyperslab specification for %s which will be determined based on coordinate values rather than dimension indices. The behavior of the subcycle hyperslab argument is ambiguous for coordinate-based hyperslabs---it could mean select the first SSC elements that are within the min and max coordinate values beginning with each strided point, or it could mean always select the first _consecutive_ SSC elements beginning wi [...]
       } /* Check subcycle for each record */
-    } /* Loop records */
+    } /* !idx_rec */
   } /* Subcycle argument warning */
 
   /* Normalize, multiply, etc where necessary: ncra and nces normalization blocks are identical, 
diff --git a/src/nco/ncrename.c b/src/nco/ncrename.c
index 77839b9..1ea2faa 100644
--- a/src/nco/ncrename.c
+++ b/src/nco/ncrename.c
@@ -620,6 +620,8 @@ main(int argc,char **argv)
 
   /* Catenate time-stamped command line to "history" global attribute */
   if(HISTORY_APPEND) (void)nco_hst_att_cat(nc_id,cmd_ln);
+  if(gaa_nbr > 0) (void)nco_glb_att_add(nc_id,gaa_arg,gaa_nbr);
+  if(HISTORY_APPEND) (void)nco_vrs_att_cat(nc_id);
 
 #ifdef _OPENMP
   /* fxm: hack to get libxlsmp library linked in */
diff --git a/src/nco/ncwa.c b/src/nco/ncwa.c
index 558d849..ba993db 100644
--- a/src/nco/ncwa.c
+++ b/src/nco/ncwa.c
@@ -1046,13 +1046,14 @@ main(int argc,char **argv)
           } /* end if */
           /* Rather complex conditional statement is shorter than switch() */
           if( /* Normalize by weighted tally if ....  */
-            (nco_op_typ != nco_op_min) && /* ...operation is not min() and... */
-            (nco_op_typ != nco_op_max) && /* ...operation is not max() and... */
-            (nco_op_typ != nco_op_mabs) && /* ...operation is not mabs() and... */
-            (nco_op_typ != nco_op_mibs) && /* ...operation is not mabs() and... */
-            (nco_op_typ != nco_op_ttl || /* ...operation is not ttl() or... */
-	     var_prc[idx]->is_crd_var) /* ...variable is a coordinate */
-            ){ /* Divide numerator by masked, averaged, weights */
+	     var_prc[idx]->is_crd_var || /* ...variable is a coordinate or ...*/
+	     ((nco_op_typ != nco_op_min) && /* ...operation is not min() and... */
+	      (nco_op_typ != nco_op_max) && /* ...operation is not max() and... */
+	      (nco_op_typ != nco_op_mabs) && /* ...operation is not mabs() and... */
+	      (nco_op_typ != nco_op_mibs) && /* ...operation is not mibs() and... */
+	      (nco_op_typ != nco_op_tabs) && /* ...operation is not tabs() and... */
+	      (nco_op_typ != nco_op_ttl)) /* ...operation is not ttl() and... */
+	      ){ /* Divide numerator by masked, averaged, weights */
 	    (void)nco_var_dvd(var_prc_out[idx]->type,var_prc_out[idx]->sz,var_prc_out[idx]->has_mss_val,var_prc_out[idx]->mss_val,wgt_avg->val,var_prc_out[idx]->val);
           } /* endif */
           /* Free wgt_avg, but keep wgt_out, after each use */
@@ -1082,6 +1083,7 @@ main(int argc,char **argv)
           case nco_op_max: /* Maximum is already in buffer, do nothing */	
           case nco_op_mabs: /* Maximum absolute value is already in buffer, do nothing */	
           case nco_op_mibs: /* Minimum absolute value is already in buffer, do nothing */	
+          case nco_op_tabs: /* Total absolute value is already in buffer, do nothing */	
           case nco_op_ttl: /* Total is already in buffer, do nothing */	
             break;
           default:

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