[nco] 01/07: Imported Upstream version 4.5.3

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Fri Nov 6 14:37:59 UTC 2015


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

sebastic pushed a commit to branch master
in repository nco.

commit e5438ea271981359c9fadecb6ec5aef26f2e3f6e
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Nov 6 10:48:10 2015 +0100

    Imported Upstream version 4.5.3
---
 .gitignore                        |    4 +-
 Makefile.am                       |    2 +-
 Makefile.in                       |    2 +-
 bld/Makefile                      |   11 +-
 bld/nco.spec                      |   15 +-
 bld/nco_dst.pl                    |   26 +-
 bm/NCO_rgr.pm                     |  103 +-
 config.h.in                       |    7 +
 configure                         |  121 +-
 configure.ac                      |   61 +-
 data/pdf.nco                      |   46 +
 data/sld_nco.sh                   |  384 +++++
 data/xmp_wnd_msk.nco              |   57 +-
 debian/changelog                  |   18 +-
 doc/ANNOUNCE                      |  197 +--
 doc/ChangeLog                     |  258 +++-
 doc/MANIFEST                      |    1 +
 doc/Makefile.am                   |    3 +
 doc/Makefile.in                   |    4 +
 doc/TODO                          |    3 +-
 doc/VERSION                       |    2 +-
 doc/debian.txt                    |  162 +-
 doc/index.shtml                   |  129 +-
 doc/nces.txt                      |  105 ++
 doc/nco.texi                      |  360 +++--
 man/ncpdq.1                       |    2 +-
 src/nco++/fmc_all_cls.cc          |  221 +++
 src/nco++/fmc_all_cls.hh          |   14 +
 src/nco++/map_srt_tmp.hh          |   76 +
 src/nco++/ncap2.cc                |    4 +
 src/nco++/ncap2_utl.cc            |  144 +-
 src/nco++/ncoGrammer.g            |  152 +-
 src/nco++/ncoLexer.cpp            |    2 +-
 src/nco++/ncoLexer.hpp            |    2 +-
 src/nco++/ncoParser.cpp           |    2 +-
 src/nco++/ncoParser.hpp           |    2 +-
 src/nco++/ncoParserTokenTypes.hpp |    2 +-
 src/nco++/ncoTree.cpp             |  335 ++--
 src/nco++/ncoTree.hpp             |  118 +-
 src/nco/mpncbo.c                  |    1 +
 src/nco/mpncecat.c                |    1 +
 src/nco/mpncflint.c               |    1 +
 src/nco/mpncpdq.c                 |    1 +
 src/nco/mpncra.c                  |    1 +
 src/nco/mpncwa.c                  |    1 +
 src/nco/ncap.c                    |    1 +
 src/nco/ncatted.c                 |    1 +
 src/nco/ncbo.c                    |    1 +
 src/nco/ncecat.c                  |    5 +-
 src/nco/ncflint.c                 |    1 +
 src/nco/ncks.c                    |   21 +-
 src/nco/nco.h                     |   25 +-
 src/nco/nco_att_utl.c             |  158 +-
 src/nco/nco_aux.c                 |   39 +-
 src/nco/nco_aux.h                 |    8 +-
 src/nco/nco_cnf_dmn.c             |    8 +-
 src/nco/nco_cnf_typ.c             |   43 +-
 src/nco/nco_cnf_typ.h             |    4 +
 src/nco/nco_ctl.c                 |    9 +-
 src/nco/nco_dmn_utl.c             |   11 +-
 src/nco/nco_fl_utl.c              |    9 +-
 src/nco/nco_fl_utl.h              |    1 +
 src/nco/nco_grp_utl.c             |   62 +-
 src/nco/nco_rgr.c                 | 3084 ++++++++++++++++++++++++++++++-------
 src/nco/nco_rgr.h                 |   16 +-
 src/nco/ncpdq.c                   |   18 +-
 src/nco/ncra.c                    |    5 +-
 src/nco/ncrename.c                |    1 +
 src/nco/ncwa.c                    |    1 +
 src/nco_c++/Makefile.am           |    1 +
 src/nco_c++/Makefile.in           |    1 +
 71 files changed, 5304 insertions(+), 1393 deletions(-)

diff --git a/.gitignore b/.gitignore
index 97f3a08..673e584 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
 # Git-ignore patterns for ~/nco
 
 # Autoconf/Automake
-
 Makefile.in
 .deps
 .libs
@@ -18,8 +17,9 @@ Makefile.in
 /missing
 /Makefile
 
-# Odd files
+# Odd files, litter
 gmon.out
+PET0.RegridWeightGen.Log
 
 # Editors
 
diff --git a/Makefile.am b/Makefile.am
index 3210fb0..cf00923 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 # $Header$ -*-makefile-*-
 
-#SUBDIRS = data src man doc
+# 20151001: Sub-folder is by default, and not when configure --disable-docs is invoked
 SUBDIRS = data src man @DOC_FOLDER@
 
 # Separately add desired files from nco/bld/ to distribution
diff --git a/Makefile.in b/Makefile.in
index 6dea95d..fa2dc10 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -363,7 +363,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
-#SUBDIRS = data src man doc
+# 20151001: Sub-folder is by default, and not when configure --disable-docs is invoked
 SUBDIRS = data src man @DOC_FOLDER@
 
 # Separately add desired files from nco/bld/ to distribution
diff --git a/bld/Makefile b/bld/Makefile
index e73f905..eed10c3 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -15,15 +15,18 @@
 # Machine build parameters
 #                         Source     Method   Packages Compiler
 # aerosol.ess.uci.edu: NCO          Configure All else LLVM
+# firn.ess.uci.edu   : NCO          Configure All else LLVM
 # givre.ess.uci.edu  : NCO + netCDF Makefile  All else LLVM
 # roulee.ess.uci.edu : NCO + netCDF Makefile  All else GCC
 # neige.ess.uci.edu  : NCO          Makefile  All else GCC
-# dust.ess.uci.edu   : -            -         All
 # glace.ess.uci.edu  : NCO          Configure All else GCC
 # grele.ess.uci.edu  : NCO          Makefile  All else GCC
-# tephra.ess.uci.edu : NCO          Makefile  All else
-# yellowstone.ucar.e : -            Makefile  All else Intel
-# rhea.ccs.ornl.gov  : NCO          Makefile  All else 
+# yellowstone.ucar.e : NCO          Makefile  All else Intel
+# rhea.ccs.ornl.gov  : NCO          Makefile  All else GCC
+# cooley.alcf.anl.g  : NCO          Configure All else GCC
+# edison.nersc.gov   : NCO          Configure All else Intel
+# travis CI          : NCO          Configure All else gcc,clang,g++
+
 
 # Usage (testing):
 # make tst                           # Vanilla regression test
diff --git a/bld/nco.spec b/bld/nco.spec
index 10bd83e..8d2c6db 100644
--- a/bld/nco.spec
+++ b/bld/nco.spec
@@ -1,18 +1,18 @@
-v# Fedora RPMs are up-to-date!
+# Fedora RPMs are up-to-date!
 # http://cvs.fedoraproject.org/viewvc/devel/nco/nco.spec?view=co
 
 Name:           nco
-Version:        4.5.2
+Version:        4.5.3
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.5.2-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.5.3-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.2-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-4.5.2/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.3-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.5.3/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,7 +108,10 @@ fi
 # %{_libdir}/libnco++.so
 
 %changelog
-* Fri Jul 24 2015 Charlie Zender <zender at uci.edu> - 4.5.-1
+* Sun Oct 18 2015 Charlie Zender <zender at uci.edu> - 4.5.3-1
+- new upstream 4.5.3
+
+* Sun Sep 06 2015 Charlie Zender <zender at uci.edu> - 4.5.2-1
 - new upstream 4.5.2
 
 * Fri Jul 10 2015 Charlie Zender <zender at uci.edu> - 4.5.1-1
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index daf5e3b..3c320fe 100755
--- a/bld/nco_dst.pl
+++ b/bld/nco_dst.pl
@@ -7,18 +7,18 @@
 # Export tagged, public versions
 # /usr/bin/scp ${DATA}/nco-4.4.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.2 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.5.2 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.5.2 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.5.2 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.5.2
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.5.2
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.5.3 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.5.3 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.5.3 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.5.3 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.5.3
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.5.3
 
 # 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.2/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.3/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 b1ee6fd..2b0ea14 100644
--- a/bm/NCO_rgr.pm
+++ b/bm/NCO_rgr.pm
@@ -89,7 +89,7 @@ sub tst_rgr {
     if($? == -1){
 	print "failed to execute: ncks --lbr_rcd: $!\n";
     }else{
-    # system() runs a command and returns exit status information as a 16 bit value 
+    # system() runs command and returns exit status information as 16-bit value 
     # Low 7 bits are signal process died from, if any, and high 8 bits are actual exit value
     my $exit_value=$? >> 8;
     
@@ -242,15 +242,15 @@ print "\n";
 	# ncwa -O -y ttl -v area ~/foo.nc ~/foo3.nc
 	# ncks -H -u -C -v area ~/foo3.nc
 	
-	$dsc_sng="Regridding FSNT 1D->2D to test conservation (uses SSH/scp to givre.ess.uci.edu)";
-	$tst_cmd[0]="scp givre.ess.uci.edu:/data/zender/maps/map_ne30np4_to_fv129x256_aave.150418.nc .";
-	$tst_cmd[1]="scp givre.ess.uci.edu:/data/zender/ne30/rgr/ne30_tst.nc .";
-	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_ne30np4_to_fv129x256_aave.150418.nc ne30_tst.nc %tmp_fl_00%";
+	$dsc_sng="Regridding FSNT 1D->2D to test conservation (uses SSH/scp to dust.ess.uci.edu)";
+	$tst_cmd[0]="scp dust.ess.uci.edu:data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc .";
+	$tst_cmd[1]="scp dust.ess.uci.edu:data/ne30/rgr/ne30_tst.nc .";
+	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_ne30np4_to_fv129x256_aave.20150901.nc ne30_tst.nc %tmp_fl_00%";
 #	my $pwd=`pwd`; chomp $pwd; print $pwd;
-#	$dsc_sng="Regridding FSNT to regridding conservation (uses wget to glace.ess.uci.edu)";
-#	$tst_cmd[0]="wget -c -P $drc_dat http://glace.ess.uci.edu/maps/map_ne30np4_to_fv129x256_aave.150418.nc";
-#	$tst_cmd[1]="wget -c -P $drc_dat http://glace.ess.uci.edu/ne30/rgr/ne30_tst.nc";
-#	$tst_cmd[2]="ncks -h -O $fl_fmt $nco_D_flg --map=".$drc_dat."/map_ne30np4_to_fv129x256_aave.150418.nc ".$drc_dat."/ne30_tst.nc %tmp_fl_00%";
+#	$dsc_sng="Regridding FSNT to regridding conservation (uses wget to dust.ess.uci.edu)";
+#	$tst_cmd[0]="wget -c -P $drc_dat http://dust.ess.uci.edu/maps/map_ne30np4_to_fv129x256_aave.20150901.nc";
+#	$tst_cmd[1]="wget -c -P $drc_dat http://dust.ess.uci.edu/ne30/rgr/ne30_tst.nc";
+#	$tst_cmd[2]="ncks -h -O $fl_fmt $nco_D_flg --map=".$drc_dat."/map_ne30np4_to_fv129x256_aave.20150901.nc ".$drc_dat."/ne30_tst.nc %tmp_fl_00%";
 	$tst_cmd[3]="/bin/cp -f %tmp_fl_00% ne30_2D.nc";
 	$tst_cmd[4]="ncwa -O $fl_fmt $nco_D_flg -w area %tmp_fl_00% %tmp_fl_01%";
 	$tst_cmd[5]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v FSNT %tmp_fl_01%";
@@ -267,7 +267,7 @@ print "\n";
 	$#tst_cmd=0; # Reset array
 
 	$dsc_sng="Regridding area 1D->2D to test grid area integral/normalization";
-	$tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg --map=${drc_dat}/map_ne30np4_to_fv129x256_aave.150418.nc $drc_dat/ne30_tst.nc %tmp_fl_00%";
+	$tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg --map=${drc_dat}/map_ne30np4_to_fv129x256_aave.20150901.nc $drc_dat/ne30_tst.nc %tmp_fl_00%";
 	$tst_cmd[1]="ncwa -O $fl_fmt $nco_D_flg -y ttl -v area %tmp_fl_00% %tmp_fl_02%";
 	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v area %tmp_fl_02%";
 	$tst_cmd[3]="area = 12.5663706144 steradian";
@@ -275,10 +275,10 @@ print "\n";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
 
-	$dsc_sng="Regridding FSNT 1D->2D to test bilinear remapping (uses SSH/scp to givre.ess.uci.edu)";
-	$tst_cmd[0]="scp givre.ess.uci.edu:/data/zender/maps/map_ne30np4_to_fv257x512_bilin.150418.nc .";
-	$tst_cmd[1]="scp givre.ess.uci.edu:/data/zender/ne30/rgr/ne30_tst.nc .";
-	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_ne30np4_to_fv257x512_bilin.150418.nc ne30_tst.nc %tmp_fl_00%";
+	$dsc_sng="Regridding FSNT 1D->2D to test bilinear remapping (uses SSH/scp to dust.ess.uci.edu)";
+	$tst_cmd[0]="scp dust.ess.uci.edu:data/maps/map_ne30np4_to_fv257x512_bilin.20150901.nc .";
+	$tst_cmd[1]="scp dust.ess.uci.edu:data/ne30/rgr/ne30_tst.nc .";
+	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_ne30np4_to_fv257x512_bilin.20150901.nc ne30_tst.nc %tmp_fl_00%";
 	$tst_cmd[3]="ncwa -O $fl_fmt $nco_D_flg -w gw %tmp_fl_00% %tmp_fl_01%";
 	$tst_cmd[4]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v FSNT %tmp_fl_01%";
 	$tst_cmd[5]="FSNT = 244.237 W/m2";
@@ -286,9 +286,9 @@ print "\n";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
 
-	$dsc_sng="Regridding FSNT 2D->1D to test conservation (uses SSH/scp to givre.ess.uci.edu)";
-	$tst_cmd[0]="scp givre.ess.uci.edu:/data/zender/maps/map_fv129x256_to_ne30np4_aave.20150602.nc .";
-	$tst_cmd[1]="ncks -O $fl_fmt $nco_D_flg --map=map_fv129x256_to_ne30np4_aave.20150602.nc ne30_2D.nc %tmp_fl_00%";
+	$dsc_sng="Regridding FSNT 2D->1D to test conservation (uses SSH/scp to dust.ess.uci.edu)";
+	$tst_cmd[0]="scp dust.ess.uci.edu:data/maps/map_fv129x256_to_ne30np4_aave.20150901.nc .";
+	$tst_cmd[1]="ncks -O $fl_fmt $nco_D_flg --map=map_fv129x256_to_ne30np4_aave.20150901.nc ne30_2D.nc %tmp_fl_00%";
 	$tst_cmd[2]="ncwa -O $fl_fmt $nco_D_flg -w area %tmp_fl_00% %tmp_fl_01%";
 	$tst_cmd[3]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v FSNT %tmp_fl_01%";
 	$tst_cmd[4]="FSNT = 244.124 W/m2";
@@ -296,10 +296,10 @@ print "\n";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
 
-	$dsc_sng="Regridding FSNT 2D->2D to test conservation (uses SSH/scp to givre.ess.uci.edu)";
-	$tst_cmd[0]="scp givre.ess.uci.edu:/data/zender/maps/map_fv129x256_to_fv257x512_aave.20150529.nc .";
-	$tst_cmd[1]="scp givre.ess.uci.edu:/data/zender/ne30/rgr/ne30_tst.nc .";
-	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_fv129x256_to_fv257x512_aave.20150529.nc ne30_2D.nc %tmp_fl_00%";
+	$dsc_sng="Regridding FSNT 2D->2D to test conservation (uses SSH/scp to dust.ess.uci.edu)";
+	$tst_cmd[0]="scp dust.ess.uci.edu:data/maps/map_fv129x256_to_fv257x512_aave.20150901.nc .";
+	$tst_cmd[1]="scp dust.ess.uci.edu:data/ne30/rgr/ne30_2D.nc .";
+	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_fv129x256_to_fv257x512_aave.20150901.nc ne30_2D.nc %tmp_fl_00%";
 	$tst_cmd[3]="ncwa -O $fl_fmt $nco_D_flg -w area %tmp_fl_00% %tmp_fl_01%";
 	$tst_cmd[4]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v FSNT %tmp_fl_01%";
 	$tst_cmd[5]="FSNT = 244.124 W/m2";
@@ -307,9 +307,9 @@ print "\n";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
 
-	$dsc_sng="Regridding FSNT 1D->1D to test conservation (uses SSH/scp to givre.ess.uci.edu)";
-	$tst_cmd[0]="scp givre.ess.uci.edu:/data/zender/maps/map_ne30np4_to_ne30np4_aave.20150603.nc .";
-	$tst_cmd[1]="scp givre.ess.uci.edu:/data/zender/ne30/rgr/ne30_tst.nc .";
+	$dsc_sng="Regridding FSNT 1D->1D to test identity mapping and conservation (uses SSH/scp to dust.ess.uci.edu)";
+	$tst_cmd[0]="scp dust.ess.uci.edu:data/maps/map_ne30np4_to_ne30np4_aave.20150603.nc .";
+	$tst_cmd[1]="scp dust.ess.uci.edu:data/ne30/rgr/ne30_tst.nc .";
 	$tst_cmd[2]="ncks -O $fl_fmt $nco_D_flg --map=map_ne30np4_to_ne30np4_aave.20150603.nc ne30_tst.nc %tmp_fl_00%";
 	$tst_cmd[3]="ncwa -O $fl_fmt $nco_D_flg -w area %tmp_fl_00% %tmp_fl_01%";
 	$tst_cmd[4]="ncks -O $fl_fmt $nco_D_flg -H -u -C -v FSNT %tmp_fl_01%";
@@ -456,6 +456,8 @@ print "\n";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
 
+    } # $RUN_NETCDF4_TESTS	
+
 #ncatted #13
 # ncatted -O -a '.?_att$',att_var,o,i,999 ~/nco/data/in.nc ~/foo.nc
 # ncks -C -m -v att_var ~/foo.nc | grep float_att | cut -d ' ' -f 11
@@ -466,9 +468,19 @@ print "\n";
 	$tst_cmd[3]="SS_OK";
 	NCO_bm::tst_run(\@tst_cmd);
 	$#tst_cmd=0; # Reset array
-	
-    } # $RUN_NETCDF4_TESTS	
 
+#ncatted #14
+# ncatted -O -a ,att_var,d,, ~/nco/data/in.nc ~/foo.nc
+# ncks -C -m -v att_var ~/foo.nc | wc | cut -d ' ' -f 7
+# Counting lines of output to verify no attributes remain
+	$dsc_sng="Delete all attributes";
+	$tst_cmd[0]="ncatted -O $nco_D_flg -a ,att_var,d,, $in_pth_arg in.nc %tmp_fl_00%";
+	$tst_cmd[1]="ncks -C -m -v att_var %tmp_fl_00% | wc | cut -d ' ' -f 7";
+	$tst_cmd[2]="4";
+	$tst_cmd[3]="SS_OK";
+	NCO_bm::tst_run(\@tst_cmd);
+	$#tst_cmd=0; # Reset array
+	
     } #dodap
     
 # printf("paused @ %s:%d - hit return to continue", __FILE__ , __LINE__); my $wait = <STDIN>;
@@ -1065,7 +1077,6 @@ print "\n";
 	
 #nces #17
 # ncra -Y ncge -h -O -G /gpe_grp mdl_1.nc ~/foo.nc
-	
     $tst_cmd[0]="ncra -Y ncge $omp_flg -h -O -G /gpe_grp $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -C -g /gpe_grp/ecmwf -v tas1 %tmp_fl_00%";
     $dsc_sng="(Groups) GPE 1 file mdl_1.cdl ensemble";
@@ -1076,7 +1087,6 @@ print "\n";
 	
 #nces #18
 #ncra -Y ncge -O mdl_1.nc mdl_2.nc ~/foo.nc
- 
     $dsc_sng="(Groups) Two-file ensembles";
     $tst_cmd[0]="ncra -Y ncge $omp_flg -h -O $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc mdl_2.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -C -g ecmwf -v tas1 %tmp_fl_00%";
@@ -1090,7 +1100,6 @@ print "\n";
 # ncra -Y ncge -h -O mdl_1.nc ~/foo.nc
 # ncks -g cesm -v time ~/foo.nc
 # NB: This test succeeds when it fails, i.e., the NCO command fails as it should because the input files do not conform
-	
     $dsc_sng="(Groups) Ensemble record coordinate variables";
     $tst_cmd[0]="ncra -Y ncge $omp_flg -h -O $fl_fmt $nco_D_flg $in_pth_arg mdl_1.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -m --cdl -g cesm -v time %tmp_fl_00% | grep UNLIMITED";
@@ -1298,6 +1307,18 @@ print "\n";
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array 	
     
+#ncecat #14
+# Test --gag
+# ncecat -O --gag -v one,lat -p ~/nco/data in.nc in.nc in.nc ~/foo.nc
+# ncks -C -H -v one ~/foo.nc
+    $dsc_sng="Test group aggregation with --gag";
+    $tst_cmd[0]="ncecat -h -O $fl_fmt $nco_D_flg --gag -v one,lat $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks $fl_fmt $nco_D_flg -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 	
+    
 #print "paused - hit return to continue"; my $wait=<STDIN>;
     
 #####################
@@ -4203,6 +4224,18 @@ if(0){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array 	
 
+# ncra #39
+# Test MSA running averages
+# ncra -O -C -v one_dmn_rec_var -d time,0,0 -d time,1,1 ~/nco/data/in.nc ~/foo.nc
+# ncks -C -H -s '%g' -v one_dmn_rec_var ~/foo.nc
+    $dsc_sng="Test MSA running average";
+    $tst_cmd[0]="ncra -h -O $fl_fmt $nco_D_flg -C -v one_dmn_rec_var $in_pth_arg in.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncks -C -H -s '%g' -v one_dmn_rec_var %tmp_fl_00%";
+    $tst_cmd[2]="1.5";
+    $tst_cmd[3]="SS_OK";   
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array 	
+
 ####################
 #### ncwa tests #### OK!
 ####################
@@ -5396,6 +5429,18 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     @tst_cmd=(); # really reset array.		
 
+#ncrename #31
+#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)";
+    $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";
+    $tst_cmd[3]="SS_OK";
+    NCO_bm::tst_run(\@tst_cmd);
+    @tst_cmd=(); # really reset array.		
+
 #print "paused - hit return to continue"; my $wait=<STDIN>;
     
 ####################
diff --git a/config.h.in b/config.h.in
index 790ce8d..49eb34d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -15,6 +15,10 @@
 /* Debugging symbols: Produce symbols for debuggers (e.g., dbx, gdb) */
 #undef ENABLE_DEBUG_SYMBOLS
 
+/* Build/install NCO TexInfo-based documentation (info hierarchy and PDF/HTML
+   Users Guide) */
+#undef ENABLE_DOC
+
 /* Compile operators with ESMF support */
 #undef ENABLE_ESMF
 
@@ -411,6 +415,9 @@
 /* Compatibility pvmgetarch token for Apple Mac OSX */
 #undef MACOSX
 
+/* Building TeXInfo documentation requires version greater than 4.8 */
+#undef MAKEINFO_VERSION
+
 /* GSL minor version number */
 #undef NCO_GSL_MINOR_VERSION
 
diff --git a/configure b/configure
index 54b9378..3190a29 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.2.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.5.3.
 #
 # 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.2'
-PACKAGE_STRING='NCO netCDF Operators 4.5.2'
+PACKAGE_VERSION='4.5.3'
+PACKAGE_STRING='NCO netCDF Operators 4.5.3'
 PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -639,9 +639,9 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LFLAGS
 DOC_FOLDER
+HAVE_MAKEINFO
 NCOXX
 NCO_CXX
-HAVE_MAKEINFO
 PATH_TO_NCGEN
 UDUNITS2_PATH
 ENABLE_GSL_FALSE
@@ -828,6 +828,7 @@ enable_udunits2
 enable_debug_custom
 enable_debug_symbols
 enable_optimize_custom
+enable_doc
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1392,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.2 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.5.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1463,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.2:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.5.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1520,6 +1521,8 @@ Optional Features:
                           Activate all known, helpful switches for fastest
                           possible run-time performance (slowest compilation)
                           [[default=no]]
+  --enable-doc            Build/install NCO TexInfo-based documentation (info
+                          hierarchy and PDF/HTML Users Guide)[[default=yes]]
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1626,7 +1629,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NCO netCDF Operators configure 4.5.2
+NCO netCDF Operators configure 4.5.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2492,7 +2495,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.2, which was
+It was created by NCO netCDF Operators $as_me 4.5.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3741,7 +3744,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nco'
- VERSION='4.5.2'
+ VERSION='4.5.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -19046,7 +19049,6 @@ fi
 
 # AC_CHECK_PROGS (variable, progs-to-check-for, [value-if-not-found], [path]
 # Check for antlr executable installed as runantlr (runantlr ~= java antlr.Tool)
-#AC_CHECK_PROGS(HAVE_ANTLR,[runantlr antlr],[],[],${PATH})
 for ac_prog in runantlr antlr
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -19281,10 +19283,9 @@ else
 fi
 
 if test "${enable_esmf}" != 'yes'; then
-
     enable_esmf='no'
-
 fi
+
 # Check for ESMF libraries unless told not to
 # Linking to ESMF library requires six more libraries to fully resolve on Linux:
 # -lesmf -lrt -lgfortran -ldl -lnetcdff -lnetcdf_c++
@@ -20779,9 +20780,51 @@ $as_echo "#define ENABLE_STATIC 1" >>confdefs.h
 fi
 # End Static
 
+# Begin config
+# Treat essential and man files now, defer doc files (that rely on makeinfo) to below
+ac_config_files="$ac_config_files Makefile data/Makefile src/Makefile src/nco/Makefile man/Makefile"
+
+if test "${ac_cv_cxx_have_valarray}" = 'yes' && test "${enable_nco_cxx}" = 'yes' ; then
+    ac_config_files="$ac_config_files src/nco_c++/Makefile"
+
+    NCO_CXX="nco_c++"
+else
+    NCO_CXX=
+fi
+
+
+# Build ncap2 only if ANTLR library was found
+if test "${enable_ncoxx}" = 'yes'  && test "${HAVE_ANTLR}" != 'no' ; then
+    ac_config_files="$ac_config_files src/nco++/Makefile"
+
+    NCOXX="nco++"
+else
+    NCOXX=""
+fi
+
+
+# Begin Doc
+# Mac OS X has outdated TeXInfo, and fails build docs (unless MacPorts is installed)
+# Enable doc-building by default (subject to later checks) unless told otherwise
+# Check whether --enable-doc was given.
+if test "${enable_doc+set}" = set; then :
+  enableval=$enable_doc; enable_doc=${enableval}
+else
+  enable_doc=yes
+fi
+
+# End Doc
+
+# Conditional build of doc/Makefile
+# Build docs iff makeinfo exists and is recent enough
+# This is complex on MacOS:
+# nco.texi uses @textdegree since 20140130
+# @textdegree appeared by TeXInfo/makeinfo 4.12 (released ~20080420)
+# Mac OS X 10.8, 10.9, 10.10 still ship with TeXInfo/makeinfo 4.8 (released ~20050103)
+# MacPorts installs modern TeXInfo/makeinfo 5.2 and 6.0 (released ~20130926, ~2015, respectively)
+
 # 20120705 Test for makeinfo; if not present, do not build doc/Makefile
-# Note: Debian install with 'sudo apt-get install texinfo'
-# AC_CHECK_PROGS (variable, program-to-check-for, [value-if-not-found], [path]
+# This prevents failed builds on many server distributions that by default not to install makeinfo, e.g., RHEL and CentOS
 # Extract the first word of "makeinfo", so it can be a program name with args.
 set dummy makeinfo; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -20820,45 +20863,29 @@ $as_echo "no" >&6; }
 fi
 
 
+DOC_FOLDER=""
+if test "x${enable_doc}" = 'xyes' && test "x${HAVE_MAKEINFO}" = 'xyes' ; then
+    # Ensure makeinfo is recent enough, i.e., version 4.12 or later
+    MAKEINFO_VERSION="`makeinfo --version` | grep makeinfo | cut -d ' ' -f 4"
+    echo "MAKEINFO_VERSION=${MAKEINFO_VERSION}"
 
-# Begin config
-#AC_CONFIG_FILES([Makefile data/Makefile src/Makefile src/nco/Makefile  man/Makefile doc/Makefile])
-ac_config_files="$ac_config_files Makefile data/Makefile src/Makefile src/nco/Makefile man/Makefile"
+$as_echo "#define MAKEINFO_VERSION \${MAKEINFO_VERSION}" >>confdefs.h
 
-if test "${ac_cv_cxx_have_valarray}" = 'yes' \
-    && test "${enable_nco_cxx}" = 'yes' ; then
-    ac_config_files="$ac_config_files src/nco_c++/Makefile"
-
-    NCO_CXX="nco_c++"
-else
-    NCO_CXX=
-fi
+    #    test_result=m4_version_compare([${MAKEINFO_VERSION}],[4.8])
+    test_result='1'
+    if test "${test_result}" = '1'; then
 
+$as_echo "#define ENABLE_DOC 1" >>confdefs.h
 
-#if the antlr library was not found just don't build ncap2
-if test "${enable_ncoxx}" = 'yes'  \
-    && test "${HAVE_ANTLR}" != 'no' ; then
-    ac_config_files="$ac_config_files src/nco++/Makefile"
+	ac_config_files="$ac_config_files doc/Makefile"
 
-    NCOXX="nco++"
-else
-    NCOXX=""
-fi
-#echo "DEBUG: enable_ncoxx: ${enable_ncoxx} and NCOXX = ${NCOXX}"
-
-
-
-# Conditional build of doc/Makefile
-if test "${HAVE_MAKEINFO}" = 'yes' ; then
-    ac_config_files="$ac_config_files doc/Makefile"
-
-    DOC_FOLDER="doc"
-else
-    DOC_FOLDER=""
+	DOC_FOLDER="doc"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: Documentation support enabled" >&5
+$as_echo "$as_me: Documentation support enabled" >&6;}
+    fi
 fi
 
 
-
 # End config
 
 # Prefix Flex output symbols with NCO string to avoid namespace conflict with flex-generated symbols from other programs/libraries
@@ -21426,7 +21453,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.2, which was
+This file was extended by NCO netCDF Operators $as_me 4.5.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21492,7 +21519,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.2
+NCO netCDF Operators config.status 4.5.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 20a5b0d..8315b81 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.2],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[4.5.3],[nco-bugs at lists.sourceforge.net],[nco])
 
 # Print GNU copyright in configure script
 AC_COPYRIGHT
@@ -433,7 +433,6 @@ fi
 
 # AC_CHECK_PROGS (variable, progs-to-check-for, [value-if-not-found], [path]
 # Check for antlr executable installed as runantlr (runantlr ~= java antlr.Tool)
-#AC_CHECK_PROGS(HAVE_ANTLR,[runantlr antlr],[],[],${PATH})
 AC_CHECK_PROGS(HAVE_ANTLR,[runantlr antlr],no,${PATH},[]) 
 
 #echo "DEBUG: HAVE_ANTLR  = ${HAVE_ANTLR}"
@@ -534,10 +533,9 @@ 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)
 if test "${enable_esmf}" != 'yes'; then
-
     enable_esmf='no'
-
 fi
+
 # Check for ESMF libraries unless told not to
 # Linking to ESMF library requires six more libraries to fully resolve on Linux:
 # -lesmf -lrt -lgfortran -ldl -lnetcdff -lnetcdf_c++
@@ -1173,16 +1171,10 @@ if test "${enable_static}" = 'yes'; then
 fi
 # End Static
 
-# 20120705 Test for makeinfo; if not present, do not build doc/Makefile
-# Note: Debian install with 'sudo apt-get install texinfo'
-# AC_CHECK_PROGS (variable, program-to-check-for, [value-if-not-found], [path]
-AC_CHECK_PROG(HAVE_MAKEINFO,makeinfo,yes,no,${PATH}) 
-
 # Begin config
-#AC_CONFIG_FILES([Makefile data/Makefile src/Makefile src/nco/Makefile  man/Makefile doc/Makefile])
-AC_CONFIG_FILES([Makefile data/Makefile src/Makefile src/nco/Makefile  man/Makefile])
-if test "${ac_cv_cxx_have_valarray}" = 'yes' \
-    && test "${enable_nco_cxx}" = 'yes' ; then
+# Treat essential and man files now, defer doc files (that rely on makeinfo) to below
+AC_CONFIG_FILES([Makefile data/Makefile src/Makefile src/nco/Makefile man/Makefile])
+if test "${ac_cv_cxx_have_valarray}" = 'yes' && test "${enable_nco_cxx}" = 'yes' ; then
     AC_CONFIG_FILES(src/nco_c++/Makefile)
     NCO_CXX="nco_c++"
 else
@@ -1190,26 +1182,47 @@ else
 fi
 AC_SUBST(NCO_CXX)
 
-#if the antlr library was not found just don't build ncap2
-if test "${enable_ncoxx}" = 'yes'  \
-    && test "${HAVE_ANTLR}" != 'no' ; then
+# Build ncap2 only if ANTLR library was found
+if test "${enable_ncoxx}" = 'yes'  && test "${HAVE_ANTLR}" != 'no' ; then
     AC_CONFIG_FILES(src/nco++/Makefile)
     NCOXX="nco++"
 else
     NCOXX=""
 fi
-#echo "DEBUG: enable_ncoxx: ${enable_ncoxx} and NCOXX = ${NCOXX}"
-
 AC_SUBST(NCOXX)
 
+# Begin Doc
+# Mac OS X has outdated TeXInfo, and fails build docs (unless MacPorts is installed)
+# Enable doc-building by default (subject to later checks) unless told otherwise
+AC_ARG_ENABLE(doc,AS_HELP_STRING([--enable-doc],[Build/install NCO TexInfo-based documentation (info hierarchy and PDF/HTML Users Guide)[[default=yes]]]),enable_doc=${enableval},enable_doc=yes)
+# End Doc
+
 # Conditional build of doc/Makefile
-if test "${HAVE_MAKEINFO}" = 'yes' ; then
-    AC_CONFIG_FILES(doc/Makefile)
-    DOC_FOLDER="doc"
-else
-    DOC_FOLDER=""
-fi
+# Build docs iff makeinfo exists and is recent enough
+# This is complex on MacOS:
+# nco.texi uses @textdegree since 20140130
+# @textdegree appeared by TeXInfo/makeinfo 4.12 (released ~20080420)
+# Mac OS X 10.8, 10.9, 10.10 still ship with TeXInfo/makeinfo 4.8 (released ~20050103)
+# MacPorts installs modern TeXInfo/makeinfo 5.2 and 6.0 (released ~20130926, ~2015, respectively)
 
+# 20120705 Test for makeinfo; if not present, do not build doc/Makefile
+# This prevents failed builds on many server distributions that by default not to install makeinfo, e.g., RHEL and CentOS
+AC_CHECK_PROG(HAVE_MAKEINFO,makeinfo,yes,no,${PATH}) 
+DOC_FOLDER=""
+if test "x${enable_doc}" = 'xyes' && test "x${HAVE_MAKEINFO}" = 'xyes' ; then
+    # Ensure makeinfo is recent enough, i.e., version 4.12 or later
+    MAKEINFO_VERSION="`makeinfo --version` | grep makeinfo | cut -d ' ' -f 4"
+    echo "MAKEINFO_VERSION=${MAKEINFO_VERSION}"
+    AC_DEFINE(MAKEINFO_VERSION,${MAKEINFO_VERSION},Building TeXInfo documentation requires version greater than 4.8)
+    #    test_result=m4_version_compare([${MAKEINFO_VERSION}],[4.8])
+    test_result='1'
+    if test "${test_result}" = '1'; then
+	AC_DEFINE([ENABLE_DOC],[1],[Build/install NCO TexInfo-based documentation (info hierarchy and PDF/HTML Users Guide)])
+	AC_CONFIG_FILES(doc/Makefile)
+	DOC_FOLDER="doc"
+	AC_MSG_NOTICE([Documentation support enabled])
+    fi
+fi
 AC_SUBST(DOC_FOLDER)
 
 # End config
diff --git a/data/pdf.nco b/data/pdf.nco
new file mode 100644
index 0000000..88f83b1
--- /dev/null
+++ b/data/pdf.nco
@@ -0,0 +1,46 @@
+// $Header$ -*-C++-*-
+
+// Purpose: Compute PDF of timeseries at each spatial point
+
+// /* Usage: 
+//    ncap2 -O -v -S ~/nco/data/pdf.nco ~/nco/data/in.nc ~/foo.nc
+//    ncap2 -D 1 -O -v -S ~/nco/data/pdf.nco /scratch2/scratchdirs/zender/ne30/clm/prect.nc ~/foo.nc
+//    ncks -v 'bin.?' ~/foo.nc | /bin/more */
+
+// Declare various flags as RAM variable or they will clutter output file
+*flg_dbg=0s; // [flg] Debug mode
+
+if(flg_dbg) *bin_nbr=3; else *bin_nbr=100;
+defdim("bin",bin_nbr); // [nbr] Bin dimension
+defdim("bin_grd",bin_nbr+1); // [nbr] Bin grid dimension
+
+*var_max_max=max(PRECT);
+*var_min_min=0.0;
+
+// Set bin boundaries
+var_grd=array(0.0f,var_max_max/bin_nbr,$bin_grd);
+var_min[bin]=var_grd(0:bin_nbr-1); // [m s-1] Minimum value in bin
+var_max[bin]=var_grd(1:bin_nbr); // [m s-1] Maximum value in bin
+
+// Initialize loop variables as RAM variables 
+*bin_cnt[lat,lon,bin]=0s; // [nbr] Number of values in bin
+*bin_flg[time,lat,lon]=0s; // [flg] Value is within current bin
+
+// bin_cnt is RAM variable so use set_miss() to set missing value
+set_miss(bin_cnt,-32768s);
+
+for(*bin_idx=0;bin_idx<bin_nbr;bin_idx++){
+  bin_flg=(PRECT >= var_min(bin_idx) && PRECT < var_max(bin_idx));
+  bin_cnt(:,:,bin_idx)=bin_flg.total($time);
+} // !bin_idx
+
+ram_write(bin_cnt);
+if(flg_dbg){
+  // Write bin_flg and bin_idx only in debug mode
+  ram_write(bin_flg);
+  ram_write(bin_idx);
+ }else{
+  // Delete RAM variables to conserve memory if script grows (good practice, not required)
+  ram_delete(bin_flg);
+  ram_delete(bin_idx);
+ } // end if dbg
diff --git a/data/sld_nco.sh b/data/sld_nco.sh
new file mode 100755
index 0000000..ee3987c
--- /dev/null
+++ b/data/sld_nco.sh
@@ -0,0 +1,384 @@
+#!/bin/sh
+
+# Purpose: Regridding script tailored for Swath-Like-Data (SLD)
+# This script regrids all input SLD files to specified output grid
+
+# Author: C. Zender
+# Created: 20150909
+
+# Source: https://github.com/nco/nco/tree/master/data/sld_nco.c
+
+# 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
+	export HOSTNAME=`/bin/hostname`
+    elif [ -f /usr/bin/hostname ] && [ -x /usr/bin/hostname ] ; then
+	export HOSTNAME=`/usr/bin/hostname`
+    fi # !hostname
+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
+	* ) DATA='/tmp' ; ;; # Other
+    esac # !HOSTNAME
+fi # DATA
+
+# Production usage:
+# chmod a+x ~/sld_nco.sh
+# sld_nco.sh -s AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -o ${DATA}/sld/rgr
+# sld_nco.sh -s AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -i ${DATA}/sld/raw -o ${DATA}/sld/rgr
+# sld_nco.sh -s ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -o ${DATA}/sld/rgr
+# sld_nco.sh -x TSurfStd_ct -s ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -o ${DATA}/sld/rgr
+
+# Debugging and Benchmarking:
+# sld_nco.sh > ~/sld_nco.txt 2>&1 &
+# sld_nco.sh -s AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -i ${DATA}/sld/raw -o ${DATA}/sld/rgr > ~/sld_nco.txt 2>&1 &
+
+# Set script name and run directory
+drc_pwd=${PWD}
+spt_nm=$(basename ${0}) # [sng] Script name
+nco_version=$(ncks --version 2>&1 >/dev/null | grep NCO | awk '{print $5}')
+
+# Set fonts for legibility
+fnt_nrm=`tput sgr0` # Normal
+fnt_bld=`tput bold` # Bold
+fnt_rvr=`tput smso` # Reverse
+
+# Defaults for command-line options and some derived variables
+# Modify these defaults to save typing later
+#caseid='AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc' # [sng] Case ID
+dbg_lvl=0 # [nbr] Debugging level
+drc_in='' # [sng] Input file directory
+drc_out="${DATA}/sld/rgr" # [sng] Output file directory
+esmf_opt='> /dev/null' # [sng] ESMF_RegridWeightGen options
+fml_nm='' # [sng] Family name (e.g., 'amip', 'control', 'experiment')
+gaa_sng="--gaa sld_script=${spt_nm} --gaa sld_hostname=${HOSTNAME} --gaa sld_version=${nco_version}" # [sng] Global attributes to add
+grd_fl='' # [sng] Grid-file
+grd_sng='' # [sng] Grid string
+hdr_pad='1000' # [B] Pad at end of header section
+map_fl='' # [sng] Map-file
+mpi_flg='No' # [sng] Parallelize over nodes
+nco_opt='-O -t 1 --no_tmp_fl' # [sng] NCO defaults (e.g., '-O -6 -t 1')
+nco_usr='' # [sng] NCO user-configurable options (e.g., '-D 1')
+par_typ='bck' # [sng] Parallelism type
+rgr_fl='' # [sng] Regridded file
+rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon' # [sng] Regridding options (e.g., '--rgr col_nm=lndgrid')
+sld_fl='AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc' # [sng] SLD file
+thr_nbr=2 # [nbr] Thread number for regridder
+#var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
+var_lst='' # [sng] Variables to process (empty means all)
+xtn_var='' # [sng] Extensive variables (e.g., 'TSurfStd_ct')
+yyyy_srt='1980' # [yyyy] Start year
+yyyy_end='1983' # [yyyy] End year
+
+# Derived defaults
+grd_dst_dfl="${drc_out}/grd_dst.nc" # [sng] Grid-file (destination) default
+grd_dst_glb="${DATA}/grids/180x360_SCRIP.20150901.nc" # [sng] Grid-file (destination) global
+grd_src="${drc_out}/grd_src.nc" # [sng] Grid-file (source) 
+
+function fnc_usg_prn {
+    # Print usage
+    printf "\nQuick documentation for ${fnt_bld}${spt_nm}${fnt_nrm} (read script for more thorough explanations)\n\n"
+    printf "${fnt_rvr}Basic usage:${fnt_nrm} ${fnt_bld}$spt_nm -s sld_fl -g grd_fl -i drc_in -o drc_out${fnt_nrm}\n\n"
+    echo "Command-line options:"
+#    echo "${fnt_rvr}-c${fnt_nrm} ${fnt_bld}caseid${fnt_nrm}   Case ID string (default ${fnt_bld}${caseid}${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}yyyy_end${fnt_nrm} Ending year in YYYY format (default ${fnt_bld}${yyyy_end}${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_fl${fnt_nrm}   Grid-file (destination) (empty means generate internally) (default ${fnt_bld}${grd_fl}${fnt_nrm})"
+    echo "${fnt_rvr}-G${fnt_nrm} ${fnt_bld}grd_sng${fnt_nrm}  Grid generation 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 look in current directory) (default ${fnt_bld}${drc_in}${fnt_nrm})"
+    echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm}   Map-file (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm})"
+    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}-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_fl${fnt_nrm}   Regridded-file (empty copies SLD filename) (default ${fnt_bld}${rgr_fl}${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}sld_fl${fnt_nrm}   SLD file (mandatory) (default ${fnt_bld}${sld_fl}${fnt_nrm})"
+    echo "${fnt_rvr}-v${fnt_nrm} ${fnt_bld}var_lst${fnt_nrm}  Variable list (empty means all) (default ${fnt_bld}${var_lst}${fnt_nrm})"
+    echo "${fnt_rvr}-x${fnt_nrm} ${fnt_bld}xtn_var${fnt_nrm}  Extensive variables (empty means none) (default ${fnt_bld}${xtn_var}${fnt_nrm})"
+    printf "\n"
+    printf "Examples: ${fnt_bld}$spt_nm -s ${sld_fl} -g ${grd_dst_dfl} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -x TSurfStd_ct -s ${sld_fl} -g ${grd_dst_dfl} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -v TSurfAir -s ${DATA}/hdf/AIRS.2015.01.15.001.L2.RetStd.v6.0.11.0.G15015142014.hdf -g ${grd_dst_glb} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -v CloudFrc_A -s ${DATA}/hdf/AIRS.2002.08.01.L3.RetStd_H031.v4.0.21.0.G06104133732.hdf -g ${grd_dst_glb} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -s ${DATA}/hdf/MOD04_L2.A2000055.0005.006.2014307165927.hdf -g ${grd_dst_glb} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -s ${DATA}/hdf/OMI-Aura_L2-OMIAuraSO2_2012m1222-o44888_v01-00-2014m0107t114720.h5 -g ${grd_dst_glb} -o ${drc_out} ${fnt_nrm}\n"
+    printf "          ${fnt_bld}$spt_nm -v T -s ${DATA}/hdf/wrfout_v2_Lambert_notime.nc -g ${grd_dst_glb} -o ${drc_out} ${fnt_nrm}\n"
+    exit 1
+} # end fnc_usg_prn()
+
+# 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
+
+# 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 :d:f:g:G:h:i:m:n:o:p:R:r:s:v:x: OPT; do
+    case ${OPT} in
+#	c) caseid=${OPTARG} ;; # CASEID
+	d) dbg_lvl=${OPTARG} ;; # Debugging level
+#	e) yyyy_end=${OPTARG} ;; # End year
+	f) fml_nm=${OPTARG} ;; # Family name
+	g) grd_fl=${OPTARG} ;; # Grid-file
+	G) grd_sng=${OPTARG} ;; # Grid generation string
+	i) drc_in=${OPTARG} ;; # Input directory
+	m) map_fl=${OPTARG} ;; # Map-file
+	n) nco_usr=${OPTARG} ;; # NCO options
+	o) drc_out=${OPTARG} ;; # Output directory
+	p) par_typ=${OPTARG} ;; # Parallelism type
+	r) rgr_fl=${OPTARG} ;; # Regridded file
+	R) rgr_opt=${OPTARG} ;; # Regridding options
+	s) sld_fl=${OPTARG} ;; # SLD file
+	v) var_lst=${OPTARG} ;; # Variables
+	x) xtn_var=${OPTARG} ;; # Extensive variables
+	\?) # Unrecognized option
+	    printf "\nERROR: Option ${fnt_bld}-$OPTARG${fnt_nrm} not allowed"
+	    fnc_usg_prn ;;
+    esac
+done
+shift $((OPTIND-1)) # Advance one argument
+
+# Derived variables
+if [ -z "${drc_in}" ]; then
+    drc_in="${drc_pwd}"
+fi # !drc_in
+out_nm=${sld_fl}
+if [ -n "${fml_nm}" ]; then 
+    out_nm="${fml_nm}"
+fi # !fml_nm
+if [ -n "${nco_usr}" ]; then 
+    nco_opt="${nco_usr} ${nco_opt}"
+fi # !var_lst
+if [ -n "${gaa_sng}" ]; then 
+    nco_opt="${nco_opt} ${gaa_sng}"
+fi # !var_lst
+if [ -n "${hdr_pad}" ]; then 
+    nco_opt="${nco_opt} --hdr_pad=${hdr_pad}"
+fi # !hdr_pad
+if [ -n "${var_lst}" ]; then 
+    nco_opt="${nco_opt} -v ${var_lst}"
+fi # !var_lst
+if [ -n "${xtn_var}" ]; then 
+    rgr_opt="${rgr_opt} --xtn=${xtn_var}"
+fi # !var_lst
+if [ ${par_typ} = 'bck' ]; then 
+    par_opt=' &'
+    par_opt_cf=''
+elif [ ${par_typ} = 'mpi' ]; then 
+    mpi_flg='Yes'
+    par_opt=' &'
+    par_opt_cf=''
+fi # !par_typ
+
+if [ -n "${grd_fl}" ]; then 
+    if [ ! -e "${grd_fl}" ]; then
+	echo "ERROR: Unable to find specified grid-file ${grd_fl}"
+	echo "HINT: Supply the full path-name for the destination grid, or generate one automatically with -G"
+	exit 1
+    fi # ! -e
+    grd_dst=${grd_fl}
+    grd_usr_flg='Yes'
+else
+    grd_dst=${grd_dst_dfl} # [sng] Grid-file default
+fi # !grd_fl
+if [ -z "${grd_sng}" ]; then 
+    grd_sng_dfl="--rgr grd_ttl='Default internally-generated grid' --rgr grid=${grd_dst_dfl} --rgr lat_nbr=100 --rgr lon_nbr=100 --rgr snwe=30.0,70.0,-130.0,-90.0" # [sng] Grid string default
+    grd_sng="${grd_sng_dfl}"
+fi # !grd_sng
+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
+    map_fl_dfl="${drc_out}/map_src_to_dst_bilin.nc" # [sng] Map-file default
+    map_fl=${map_fl_dfl}
+fi # !map_fl
+if [ -n "${rgr_fl}" ]; then 
+    rgr_usr_flg='Yes'
+else
+    rgr_fl="${drc_out}/$(basename ${sld_fl})" # [sng] Map-file default
+fi # !rgr_fl
+
+# Doubly-derived fields
+if [ "$(basename ${sld_fl})" = "${sld_fl}" ]; then
+    sld_fl="${drc_in}/${sld_fl}"
+fi # !basename
+if [ "${sld_fl}" = "${rgr_fl}" ]; then
+    echo "ERROR: SLD file = Regridded file = ${sld_fl}"
+    echo "HINT: To prevent inadvertent data loss, ${spt_nm} insists that SLD file and regridded file be different"
+    exit 1
+fi # !basename
+
+# Print initial state
+if [ ${dbg_lvl} -ge 1 ]; then
+#    printf "dbg: caseid   = ${caseid}\n"
+    printf "dbg: dbg_lvl  = ${dbg_lvl}\n"
+    printf "dbg: drc_in   = ${drc_in}\n"
+    printf "dbg: drc_out  = ${drc_out}\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: map_fl   = ${map_fl}\n"
+    printf "dbg: mpi_flg  = ${mpi_flg}\n"
+    printf "dbg: nco_opt  = ${nco_opt}\n"
+    printf "dbg: nd_nbr   = ${nd_nbr}\n"
+    printf "dbg: par_typ  = ${par_typ}\n"
+    printf "dbg: rgr_fl   = ${rgr_fl}\n"
+    printf "dbg: sld_fl   = ${sld_fl}\n"
+    printf "dbg: thr_nbr  = ${thr_nbr}\n"
+    printf "dbg: var_lst  = ${var_lst}\n"
+#    printf "dbg: yyyy_end = ${yyyy_end}\n"
+fi # !dbg
+if [ ${dbg_lvl} -ge 2 ]; then
+    if [ ${mpi_flg} = 'Yes' ]; then
+	for ((nd_idx=0;nd_idx<${nd_nbr};nd_idx++)); do
+	    printf "dbg: nd_nm[${nd_idx}] = ${nd_nm[${nd_idx}]}\n"
+	done # !nd
+    fi # !mpi
+fi # !dbg
+
+# Create output directory, go to working directory
+mkdir -p ${drc_out}
+cd ${drc_out}
+
+# Human-readable summary
+if [ ${dbg_lvl} -ge 1 ]; then
+    printf "Swath-Like Data (SLD) processor invoked with command:\n"
+    echo "${spt_nm} ${cmd_ln}"
+fi # !dbg
+date_srt=$(date +"%s")
+printf "Started SLD processing for file pattern ${sld_fl} at `date`.\n"
+printf "Source grid will be inferred from SLD file and stored as ${grd_src}\n"
+if [ "${grd_usr_flg}" = 'Yes' ]; then 
+    printf "Destination grid-file supplied by user as ${grd_dst}\n"
+else
+    printf "Destination grid-file will be generated internally and stored as ${grd_dst}\n"
+    if [ ${dbg_lvl} -ge 0 ]; then
+	printf "Destination grid characteristics: ${grd_sng}\n"
+    fi # !dbg
+fi # !grd_usr_flg
+if [ "${map_usr_flg}" = 'Yes' ]; then 
+    printf "Map-file supplied as ${map_fl}\n"
+else
+    printf "Map-file will be generated internally and stored as ${map_fl}\n"
+fi # !map_usr_flg
+printf "Regridded file will be stored as ${rgr_fl}\n"
+printf "NCO version is ${nco_version}\n"
+
+# Block 1: Destination grid
+if [ "${grd_usr_flg}" != 'Yes' ]; then 
+    printf "Generate destination grid...\n"
+    # Block 1 Loop 1: Generate, check, and store (but do not yet execute) commands
+    clm_idx=1
+    cmd_clm[${clm_idx}]="ncks ${nco_opt} ${grd_sng} ~/nco/data/in.nc ~/foo.nc"
+
+    # Block 1 Loop 2: Execute and/or echo commands
+    for ((clm_idx=1;clm_idx<=1;clm_idx++)); do
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_clm[${clm_idx}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -le 1 ]; then
+	    eval ${cmd_clm[${clm_idx}]}
+	    if [ $? -ne 0 ]; then
+		printf "${spt_nm}: ERROR Failed to generate destination grid\n"
+		exit 1
+	    fi # !err
+	fi # !dbg
+    done # !clm_idx
+fi # !grd_usr_flg
+wait
+
+# Block 2: Source grid(s)
+# Block 2 Loop 1: Source gridfile commands
+printf "Generate source grids...\n"
+clm_idx=2
+if [ ! -e "${sld_fl}" ]; then
+    echo "${spt_nm}: ERROR Unable to find SLD file ${sld_fl}"
+    echo "HINT: All files implied to exist must be in the directory specified by their filename or in ${drc_in} before ${spt_nm} will proceed"
+    exit 1
+fi # ! -e
+cmd_clm[${clm_idx}]="ncks ${nco_opt} --rgr nfr=y --rgr grid=${grd_src} ${sld_fl} ~/foo.nc"
+
+# Block 2 Loop 2: Execute and/or echo commands
+for ((clm_idx=2;clm_idx<=2;clm_idx++)); do
+    if [ ${dbg_lvl} -ge 1 ]; then
+	echo ${cmd_clm[${clm_idx}]}
+    fi # !dbg
+    if [ ${dbg_lvl} -le 1 ]; then
+	eval ${cmd_clm[${clm_idx}]}
+	if [ $? -ne 0 ]; then
+	    printf "${spt_nm}: ERROR Failed to generate source grid\n"
+	    exit 1
+	fi # !err
+    fi # !dbg
+done # !clm_idx
+wait
+
+# Block 3: Source->destination maps
+if [ "${map_usr_flg}" != 'Yes' ]; then 
+    # Block 3 Loop 1: Mapfile commands
+    printf "Generate source->destination mapping weights...\n"
+    clm_idx=3
+    cmd_clm[${clm_idx}]="ESMF_RegridWeightGen -s ${grd_src} -d ${grd_dst} -w ${map_fl} --method bilinear --src_regional --dst_regional --ignore_unmapped ${esmf_opt}"
+
+    # Block 3 Loop 2: Execute and/or echo commands
+    for ((clm_idx=3;clm_idx<=3;clm_idx++)); do
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_clm[${clm_idx}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -le 1 ]; then
+	    eval ${cmd_clm[${clm_idx}]}
+	    if [ $? -ne 0 ]; then
+		printf "${spt_nm}: ERROR Failed to generate mapfile\n"
+		exit 1
+	    fi # !err
+	fi # !dbg
+    done # !clm_idx
+fi # !map_usr_flg
+wait
+
+# Block 4: Regrid
+printf "Regridding...\n"
+clm_idx=4
+cmd_clm[${clm_idx}]="ncks ${nco_opt} ${rgr_opt} --map=${map_fl} ${sld_fl} ${rgr_fl}"
+
+# Block 4 Loop 2: Execute and/or echo commands
+for ((clm_idx=4;clm_idx<=4;clm_idx++)); do
+    if [ ${dbg_lvl} -ge 1 ]; then
+	echo ${cmd_clm[${clm_idx}]}
+    fi # !dbg
+    if [ ${dbg_lvl} -le 1 ]; then
+	eval ${cmd_clm[${clm_idx}]}
+	if [ $? -ne 0 ]; then
+	    printf "${spt_nm}: ERROR Failed to regrid\n"
+	    exit 1
+	fi # !err
+    fi # !dbg
+done # !clm_idx
+wait
+
+date_end=$(date +"%s")
+printf "Completed processing for SLD file ${sld_fl} at `date`.\n"
+date_dff=$((date_end-date_srt))
+echo "Quick plots of results: ncview ${rgr_fl} &"
+echo "Elapsed time $((date_dff/60))m$((date_dff % 60))s"
+
+exit 0
diff --git a/data/xmp_wnd_msk.nco b/data/xmp_wnd_msk.nco
index 43b7c41..a11d90e 100644
--- a/data/xmp_wnd_msk.nco
+++ b/data/xmp_wnd_msk.nco
@@ -1,11 +1,9 @@
 // $Header$ -*-C++-*-
-/* USAGE: ncap2 -O -S xmp_wnd_msk.nco in.nc out.nc */
 
-// PARAMETERS------------------------------------------------------
-*rho80m=1.215f; //  Air Density at 80m;  Assumed to be a function 
-                //of height only (using the U.S. standard atmosphere).
-                // rho=1.225-(1.194e10-4)80.
-//------------------------------------------------------
+/* Usage: ncap2 -O -S xmp_wnd_msk.nco in.nc out.nc */
+
+*rho80m=1.215f; // [kg m-3] Air Density at 80m (assume to be a function of height only with US standard atmosphere rho=1.225-(1.194e10-4)*80.0
+
 // Instantiate arrays and fill with missing values
 *wnd_dns[time,lat,lon]=wnd_spd_80m at _FillValue;
 *wnd_dns_tot[lat,lon]=wnd_spd_80m at _FillValue;
@@ -22,7 +20,7 @@
 *wnd_spd_80m_0_60[time,lat,lon]=wnd_spd_80m at _FillValue;
 *wnd_spd_80m_3_45[time,lat,lon]=wnd_spd_80m at _FillValue;
 *time_cnt[lat,lon]=wnd_spd_80m at _FillValue;
-//------------------------------------------------------
+
 // Set missing value attributes
 set_miss(wnd_dns,wnd_spd_80m at _FillValue);
 set_miss(wnd_dns_tot,wnd_spd_80m at _FillValue);
@@ -39,15 +37,11 @@ set_miss(wnd_pwr_dns,wnd_spd_80m at _FillValue);
 set_miss(wnd_spd_80m_0_60,wnd_spd_80m at _FillValue);
 set_miss(wnd_spd_80m_3_45,wnd_spd_80m at _FillValue);
 set_miss(time_cnt,wnd_spd_80m at _FillValue);
-//------------------------------------------------------------
-//------------------------------------------------------------
 
 wnd_spd_80m_0_60=wnd_spd_80m;
 wnd_spd_80m_3_45=wnd_spd_80m;
-//------------------------------------------------------------
-// Only want non-missing value winds between 3 and 45m/s
-//   where more than 10% of timeseries is available
-//------------------------------------------------------------
+
+// Only want non-missing value winds between 3 and 45m/s where more than 10% of timeseries is available
 // Wind Power for speeds between 3 and 45 m/s
 wnd_msk_3_45=(wnd_spd_80m > 3.0f && wnd_spd_80m < 45.0f);
 // Speeds between 0 and 60 m/s
@@ -61,40 +55,28 @@ cnt_0_60=(wnd_msk_0_60.total($time));
 time_cnt(:,:)=$time.size;
 wnd_msk_3_45_pct(:,:)=(cnt_3_45(:,:)/time_cnt(:,:) > 0.10f);
 wnd_msk_0_60_pct(:,:)=(cnt_0_60(:,:)/time_cnt(:,:) > 0.10f);
-//------------------------------------------------------------
 
-//------------------------------------------------------------
-// set zeros to missing value
-where(cnt_3_45==0)
-  cnt_3_45=wnd_spd_80m at _FillValue;
-where(wnd_msk_3_45_pct==0 || wnd_msk_3_45==0)
-  wnd_spd_80m_3_45=wnd_spd_80m at _FillValue;
+// Set zeros to missing value
+where(cnt_3_45==0) cnt_3_45=wnd_spd_80m at _FillValue;
+where(wnd_msk_3_45_pct==0 || wnd_msk_3_45==0) wnd_spd_80m_3_45=wnd_spd_80m at _FillValue;
 // set zeros to missing value
-where(cnt_0_60==0)
-  cnt_0_60=wnd_spd_80m at _FillValue;
-where(wnd_msk_0_60_pct==0 || wnd_msk_0_60==0)
-  wnd_spd_80m_0_60=wnd_spd_80m at _FillValue;
-//------------------------------------------------------------
+where(cnt_0_60==0) cnt_0_60=wnd_spd_80m at _FillValue;
+where(wnd_msk_0_60_pct==0 || wnd_msk_0_60==0) wnd_spd_80m_0_60=wnd_spd_80m at _FillValue;
 
-//PERFORM CALCULATIONS:
-//------------------------------------------------------------
-//Wind Speed Average for winds between 0 and 60m/s
+// Wind Speed Average for winds between 0 and 60m/s
 wnd_spd_avg=wnd_spd_80m_0_60.avg($time);
-//Wind Speed Standard Deviation for winds between 0 and 60m/s
+// Wind Speed Standard Deviation for winds between 0 and 60 m/s
 wnd_spd_sdn=(wnd_spd_80m_0_60-wnd_spd_avg).rmssdn($time);
-//Wind Speed Weibull Shape for winds between 0 and 60m/s
-where(wnd_spd_sdn==0.0f)
-  wnd_spd_sdn=0.1f;
+// Wind Speed Weibull Shape for winds between 0 and 60 m/s
+where(wnd_spd_sdn==0.0f) wnd_spd_sdn=0.1f;
 wnd_spd_shp=((wnd_spd_avg/wnd_spd_sdn)^1.086f);
 
-//Wind Power Density for winds between 3 and 45m/s
+// Wind Power Density for winds between 3 and 45m/s
 wnd_dns=((wnd_spd_80m_3_45^3.0f)*rho80m);
 wnd_dns_tot=(wnd_dns.total($time));
 wnd_pwr_dns=(wnd_dns_tot/(2.0f*cnt_3_45));		
-//------------------------------------------------------------
 
-//------------------------------------------------------------
-//Assign attributes
+// Assign attributes
 wnd_spd_avg at long_name="80m mean wind speed";
 wnd_spd_sdn at long_name="80m wind speed standard deviation";
 wnd_spd_shp at long_name="80m wind speed Weibull Shape Param";
@@ -106,7 +88,6 @@ wnd_spd_avg at units="m/s";
 wnd_spd_sdn at units="m/s";
 wnd_spd_shp at units="dimensionless";
 wnd_pwr_dns at units="W/m2";
-//------------------------------------------------------------
 
 // Write these to netCDF file
 ram_write(wnd_pwr_dns);
@@ -115,7 +96,7 @@ ram_write(cnt_0_60);
 ram_write(wnd_spd_avg);
 ram_write(wnd_spd_sdn);
 ram_write(wnd_spd_shp);
-//Cleanup your mess
+// Cleanup your mess
 ram_delete(rho80m);
 ram_delete(wnd_dns);
 ram_delete(wnd_dns_tot);
diff --git a/debian/changelog b/debian/changelog
index 3467b93..dba3edf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,32 +1,38 @@
+nco (4.5.3-1) unstable; urgency=low
+
+  * new upstream version nfr skl crv snwe frc_out bugs airs ncecat gag ncatted del
+
+ -- Charlie Zender <zender at uci.edu>  Sun, 18 Oct 2015 12:25:11 -0700
+
 nco (4.5.2-1) unstable; urgency=low
 
-  * new upstream version fxm
+  * new upstream version ncra --wgt nrm, --grid, --glb, Newton Gaussian
 
- -- Charlie Zender <zender at uci.edu>  Fri, 24 Jul 2014 12:25:10 -0700
+ -- Charlie Zender <zender at uci.edu>  Sun, 06 Sep 2015 12:25:10 -0700
 
 nco (4.5.1-1) unstable; urgency=low
 
   * new upstream version ncra --wgt=wgt_nm, ncap2 mibs/mabs/mebs, Tempest
 
- -- Charlie Zender <zender at uci.edu>  Fri, 10 Jul 2014 12:25:09 -0700
+ -- Charlie Zender <zender at uci.edu>  Fri, 10 Jul 2015 12:25:09 -0700
 
 nco (4.5.0-1) unstable; urgency=low
 
   * new upstream version --map, --rnr=wgt, -A provenance, [date/time]_written, ncdismember
 
- -- Charlie Zender <zender at uci.edu>  Thu, 11 Jun 2014 12:25:08 -0700
+ -- Charlie Zender <zender at uci.edu>  Thu, 11 Jun 2015 12:25:08 -0700
 
 nco (4.4.9-1) unstable; urgency=low
 
   * new upstream version (git, -x warn, crd att, cnk nco lfp, shuffle on, MM3->MM4 off, ncecat fix, climatology, ncra wgt)
 
- -- Charlie Zender <zender at uci.edu>  Thu, 21 May 2014 12:25:07 -0700
+ -- Charlie Zender <zender at uci.edu>  Thu, 21 May 2015 12:25:07 -0700
 
 nco (4.4.8-1) unstable; urgency=low
 
   * new upstream version (-A warn, PPC, cnk nco=rew+lfp, mabs/mebs/mibs())
 
- -- Charlie Zender <zender at uci.edu>  Mon, 09 Feb 2014 12:25:05 -0700
+ -- Charlie Zender <zender at uci.edu>  Mon, 09 Feb 2015 12:25:05 -0700
 
 nco (4.4.7-1) unstable; urgency=low
 
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index 4749c96..dfc911c 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,100 +1,118 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.5.2 are ready. 
+The netCDF Operators NCO version 4.5.3 are ready. 
 
 http://nco.sf.net (Homepage, Mailing lists)
 http://github.com/nco (Source Code, Releases, Developers)
 
-First, NCO now resides at http://github.com/nco, i.e., it is a
-GitHub organization. We are pleased to co-habit with the pyNCO
-project of Joe Hamman who has produced NCO Python bindings.
-Please check 'em out. All GitHub paths with "czender" instead of
-"nco" as the username will still work, but should be updated.
-Change your local copy of the repository with:
-git remote set-url origin https://github.com/nco/nco.git
-
-This NCO release improves regridding features, ncra weighting, and
-ncatted flexibility, and contains a raft of minor fixes and tunings.
-Also, in case you need updated NCO versions at US computing centers,
-know that we now maintain up-to-date NCO in ~zender/[bin,lib] at
-ANL/ALCF (cooley), NCAR/NWSC (yellowstone), LBNL/NERSC (edison), and 
-ORNL/OLCF (rhea).
-
-Work on NCO 4.5.3 has commenced and will better support regional
-regridding, masks, threading, CF-checking and easier builds on
-computer systems that use modules.  
+This release mainly advances features related to regridding.
+The primary advance is support for curvilinear regridding.
+Latitude and longitude may now be two-dimensional coordinates.
+NCO will now rectangular and curvilinear grids from most
+(well-behaved) input data files, so regridding swath-like data (SLD)
+(e.g., WRF and much NASA L2 data) just became a lot easier. 
+The ~/nco/data/sld_nco.sh script integrates the most common regridding
+tasks into a (hopefully) turnkey solution in time for Thanksgiving.
+Feedback welcome!
+
+According to https://www2.cisl.ucar.edu/resources/yellowstone/software 
+NCAR CISL supports CDO but not NCO on Yellowstone/Geyser/Caldera.
+Please contact the CISL Help Desk cislhelp at ucar.edu if you would like
+CISL to support NCO on these platforms. Thank you.
+
+Work on NCO 4.5.4 has commenced and will better support eliciting
+latitude/longitude coordinates using the CF "coordinates" convention,
+regridding variables whose horizontal dimensions are not the
+most-rapidly-varying.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-A. All operators can now add user-specified global attributes to
-   output files using the --glb switch. The switch takes mandatory
-   arguments --glb att_nm=att_val where att_nm is the desired name of
-   the global attriute to add, and att_val is its value.
-   Currently only text attributes are supported (recorded as type
-   NC_CHAR, and regular expressions are not allowed (unlike ncatted). 
-   Multiple invocations simplify the annotation of output file at
-   creation (or modification) time, and incur no performance penalty.
-   Should users emit a loud hue and cry, we will consider ading the
-   the functionality of ncatted to the front-end of all operators,
-   i.e., accepting valid arguments to modify attributes of any type
-   and to apply regular expressions. 
-   ncra --glb machine=${HOSTNAME} --glb created_by=${USER} in*.nc out.nc
-   http://nco.sf.net/nco.html#glb
-
-B. Grid generation: ncks generates SCRIP-format gridfiles for
-   select grid types, in cluding uniform/equi-angular, cap/FV, and 
-   Gaussian. Options pertinent to the grid geometry and metadata are
-   passed to NCO via key-value pairs prefixed by "--rgr". Pass at
-   least six key-value pair arguments to create a fully explicitly
-   specified, well-annotated grid. The six arguments, and their
-   corresponding keys in parentheses, are: grid title (grd_ttl),
-   filename to write the grid to (grid), number of latitudes
-   (lat_nbr), number of longitudes (lon_nbr), latitude grid type
-   (lat_typ), and longitude grid type (lon_typ). Four other arguments
-   (the NSEW bounding box) are necessary to construct regular regional
-   (non-global) grids.
-   ncks -grid=FV129x256.nc \
-   --rgr lat_nbr=129 --rgr lon_nbr=256 --rgr lat_typ=cap
-   --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
-   ncks -grid=T42.nc \
-   --rgr lat_nbr=64 --rgr lon_nbr=128 --rgr lat_typ=gss
-   --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+A. NCO's new configure --disable-doc switch allows NCO (but not its
+   documentation) to build on vanilla OSX again.  It has long been
+   possible to build/install NCO on MacOSX with a common packaging
+   system, e.g., MacPorts, Fink, etc.  However, it recently become
+   important to build NCO from source on vanilla MacOSX without any
+   packaging system. Apple has not updated some GNU tools (like
+   Texinfo) for over 10 years, and maintaining backwards compatibility
+   of the documentation on vanilla OSX is not feasible. Docs continue
+   to build fine with MacPorts, Fink, etc.
+
+B. ncks --rgr nfr reads any/all grid information from input files,
+   infers any necessary but missing information (e.g., estimates cell
+   interface locations from cell midpoints), and outputs the gridfile
+   in SCRIP-format for easy use by offline regridders. The procedure
+   works on input files where NCO can identify lat/lon coordinates. 
+   ncks --rgr nfr --rgr grid=infer.nc in.nc out.nc
    http://nco.sf.net/nco.html#grid
 
-C. Regrid regional datasets with ESMF, SCRIP, and TempestRemap
-   mapfiles. Please give it a try and send us feedback!
+C. ncks --rgr skl='y' creates a "skeleton" version of a data file
+   with the specified geometry. This skeleton file contains grid
+   center and interfaces locations and gridcell area. These can be
+   more easily be assessed, and continental outlines examined, than
+   with the corresponding SCRIP file. The skeleton can also be
+   manually populated with data rather than relying on a model. 
+   # Generate T42 Gaussian grid file t42_SCRIP.nc and skeleton file t42_skl.nc
+   ncks --rgr skl=${DATA}/grids/t42_skl.nc --rgr grid=${DATA}/grids/t42_SCRIP.nc \
+     --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr \
+     ~zender/nco/data/in.nc ~/foo.nc
+   http://nco.sf.net/nco.html#skl
+
+D. Generate 2-D regional grids in SCRIP format, and, in conjunction
+   with a mapfile, regrid to/from regional bounding boxes.
+   During grid generation, specify bounding box edges with
+   --rgr wesn=lon_wst,lon_est,lat_sth,lat_nrt or
+   --rgr snwe=lat_sth,lat_nrt,lon_wst,lon_est
+   This feature debuted 4.5.2 but was not announced because it 
+   was not yet documented.
    # Regrid global file to regional domain
-   ncks --map map_conusx4v1_to_fv0.1x0.1_US_bilin.nc in.nc out.nc
+   ncks --map map_global_to_regional_bilin.nc in.nc out.nc
+   http://nco.sf.net/nco.html#grid
    http://nco.sf.net/nco.html#regrid
 
-D. Multi-file operators support a new extension to the -n option
-   that understands calendar month counting. It is now possibly to
-   automatically generate series of filenames whose right-most two
-   digits increment from a specified minimum (e.g., 03) by a specified
-   amount (e.g., 1) until a specified maximum (e.g., 05) is reached
-   and then the leftmost digits (i.e., the year) increments by one,
-   and the whole process is reapeated until the total specified number
-   of filenames is generated.
-   ncrcat -n 3,6,1,12,1,yyyymm 198512.nc 198512_198602.nc
-   http://nco.sf.net/nco.html#input
+E. Use --xtn_var or --extensive to specify extensive variables.
+   Extensive variables are summed not averaged during regridding. 
+   The support for extensive variables is not yet robust, yet we
+   are ready to receive feedback from early adopters.
+   ncks --xtn count --map map.nc in.nc out.nc
+   http://nco.sf.net/nco.html#regrid
 
 BUG FIXES:
 
-A. The ncra --wgt option, introduced in 4.4.9, works fine except,
-   it turns out, for variables with missing values. The normalization
-   for these values was incorrect and produced errors whose size was
-   roughly inversely proportional to the size of the weights.
-   The solution is to upgrade to 4.5.2. Thanks to Jeff Painter for
-   reporting this problem.
+A. ncks fixes two newly uncovered regridder bugs that were exposed by 
+   multi-level fields that contain missing values and underwent
+   non-conservative (e.g., bilinear) regridding. The bugs were in
+   threaded code and show up in compiler-specific ways. 
+   The solution is to upgrade to 4.5.3.
+   Thanks to PNNL for first reporting problems.
+
+B. ncap2 now evaluates logical expressions with a method that does
+   not convert the type of the arguments to lesser precision. 
+   This fixes incorrect results that could occur when an argument
+   could not be represented by the lesser precision.
+   The solution is to upgrade to 4.5.3. Thanks to Maxim Petrenko for 
+   reporting this problem, and to Henry Butowsky for fixing it.
+
+C. ncecat version 4.4.9 introduced a problem that could cause it
+   to fail when using --gag mode on a single file. This problem
+   has been fixed. The solution is to upgrade to 4.5.3, or to use
+   versions 4.4.8 and prior if you encounter this problem.
+   Thanks to Huan Wu for reporting this problem.
+
+D. ncatted version 4.5.1 introduced a bug that dumps core when
+   attribute deletion is requested without a specific attribute name,
+   i.e., whenever all attributes are to be deleted. The workaround is
+   to specify the attribute name(s) to be deleted, to use versions
+   4.5.0 and earlier, or to upgrade to 4.5.3. Thanks to Richard Strub
+   for reporting this problem.
 
 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.2-alpha7 built/tested with netCDF
+   These problems occur with NCO 4.5.3 built/tested with netCDF
    4.4.0-development (20150818) on top of HDF5 hdf5-1.8.13 with:
 
    cd ~/nco;./configure # Configure mechanism -or-
@@ -140,7 +158,20 @@ A. NOT YET FIXED (netCDF4 or HDF5 problem?)
    Workaround #1: Use NCO 4.4.6 or later (avoids nc_var_gets())
    Workaround #2: Convert file to netCDF3 first, then use stride
 
-B. NOT YET FIXED (would require DAP protocol change?)
+B. NOT YET FIXED (netCDF4 library bug)
+   Simultaneously renaming multiple dimensions in netCDF4 file can corrupt output
+
+   Demonstration:
+   ncrename -O -d lev,z -d lat,y -d lon,x ~/nco/data/in_grp.nc ~/foo.nc # Completes but file is unreadable
+   ncks -v one ~/foo.nc
+
+   20150922: Confirmed problem reported by Isabelle Dast, reported to Unidata
+   20150924: Unidata confirmed problem
+
+   Bug tracking: https://www.unidata.ucar.edu/jira/browse/fxm
+   More details: http://nco.sf.net/nco.html#ncrename_crd
+
+C. NOT YET FIXED (would require DAP protocol change?)
    Unable to retrieve contents of variables including period '.' in name
    Periods are legal characters in netCDF variable names.
    Metadata are returned successfully, data are not.
@@ -155,7 +186,7 @@ B. NOT YET FIXED (would require DAP protocol change?)
 
    Bug tracking: https://www.unidata.ucar.edu/jira/browse/NCF-47
 
-C. NOT YET FIXED (would require DAP protocol change)
+D. NOT YET FIXED (would require DAP protocol change)
    Correctly read scalar characters over DAP.
    DAP non-transparency: Works locally, fails through DAP server.
    Problem, IMHO, is with DAP definition/protocol
@@ -171,19 +202,11 @@ C. NOT YET FIXED (would require DAP protocol change)
 
 "Sticky" reminders:
 
-A. Pre-built Debian Sid & Ubuntu packages:
-   http://nco.sf.net#debian
-
-B. Pre-built Fedora and CentOS RPMs:
-   http://nco.sf.net#rpm
-
-C. Pre-built Mac binaries:
-   http://nco.sf.net#mac
-
-D. Pre-built Windows (native) and Cygwin binaries:
-   http://nco.sf.net#windows
-
-E. Reminder that NCO works on most HDF4 and HDF5 datasets, e.g., 
+A. Reminder that NCO works on most HDF4 and HDF5 datasets, e.g., 
    HDF4: AMSR MERRA MODIS ...
    HDF5: GLAS ICESat Mabel SBUV ...
    HDF-EOS5: AURA HIRDLS OMI ...
+
+B. Pre-built executables for many OS's at:
+   http://nco.sf.net#bnr
+
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 75a166d..c1ba28f 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,7 +1,263 @@
+2015-10-20  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.3 release procedure:
+ 	Changes since nco-4.5.2: nfr skl crv snwe frc_out bugs airs ncecat gag ncatted del
+	cd ~/nco;git commit -a -m 'Version 4.5.3 release final changes';git push
+	git tag -d 4.5.3;git push origin :refs/tags/4.5.3
+	git tag -a 4.5.3 -m 'Version 4.5.3 tag: Mad Men';git push --tags
+
+	* Hardwire 'make tst' in nco_c++ to build in.nc before running nco_c++/tst...
+
+2015-10-18  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.3-beta01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-beta01 final changes';git push
+	git tag -a 4.5.3-beta01 -m 'Version 4.5.3-beta01 tag: nfr skl crv snwe frc_out bugs airs ncecat gag ncatted del';git push --tags
+
+	* NCO 4.5.3-alpha08 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha08 final changes';git push
+	git tag -a 4.5.3-alpha08 -m 'Version 4.5.3-alpha08 tag:	frc_out	nrm bugs';git push --tags
+
+	* Index frc_out by grd_sz_out not var_sz_out to prevent accessing out-of-range values
+	This bug affected non-conservative regridding of multi-level fields
+	It was present in 4.5.2 though only for flg_frc_nrm, whose truth condition was quite narrow
+	In 4.5.2 it might affect multi-level fields that have no missing values
+
+	* Sometime post 4.5.2, I inadvertently changed the flg_frc_nrm block from
+	only operating when !has_mss_val to only operating when	has_mss_val.
+	Block had no missing_value checks so missing_values could be used
+	arithmetically, and then converted to non-missing_values, and then
+	renormalized in the regular normalization loop for missing_values.
+	This only affected non-conservative interpolation maps, i.e., bilinear maps.
+	Users reported NC_ERANGE errors. Once this and above problem
+	(which was logically separated, but compounded issues) were fixed,
+	valgrind was clean and all tests pass.
+
+2015-10-16  Charlie Zender  <zender at uci.edu>
+
+	* Automake stopped building *.nc files in data before compiling src, causes breakage on tests
+
+	* Deprecate WIN32_LEAN_AND_MEAN, move MSC_VER headers to nco_fl_utl.h
+
+	* Hard-code GeoTrack and GeoXTrack dimension names (DAP	translations of longer originals)
+
+	* Provide defaults for HOSTNAME and DATA in sld_nco.sh
+
+2015-10-14  Charlie Zender  <zender at uci.edu>
+
+	* Implement --rgr tst=val as a generic key for testing, use it to test climo failure mode
+
+2015-10-13  Charlie Zender  <zender at uci.edu>
+
+	* Use lat_nm_out,lon_nm_out instead of "lat","lon" in cell_methods
+
+2015-10-12  Charlie Zender  <zender at uci.edu>
+
+	* Add infrastructure for non-MRV regridding
+
+2015-10-11  Charlie Zender  <zender at uci.edu>
+
+	* Fix lvl_nbr for 1D output grids (underestimated lvl_nbr by factor of last non-spatial dimension)
+
+	* Allow non-MRV variables to be defined in output and sent to regridding
+
+	* NCO 4.5.3-alpha07 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha07 final changes';git push
+	git tag -a 4.5.3-alpha07 -m 'Version 4.5.3-alpha07 tag:	lat/lon/col_nm_in/out, min/max_index(), ';git push --tags
+
+	* Disambiguate lat/lon/col_nm into lat/lon/col_nm_in, lat/lon/col_nm_out (so regridded output need not use, e.g., GeoTrack as name)
+
+2015-10-11  Henry Butowsky  <henryb at hush.com>
+
+	* First cut methods min_index() & max_index() return indices in variable min or max attribute
+
+2015-10-10  Charlie Zender  <zender at uci.edu>
+
+	* Warn in all situations when horizontal spatial dimensions are	not last dimensions of input file
+
+2015-10-09  Charlie Zender  <zender at uci.edu>
+
+	* Hard-code AIRS L2 dimension names: Geo[X]Track:L2_Standard_atmospheric&surface_product
+
+	* Hard-code AIRS L3 dimension names: [XY]Dim:location
+
+	* Fix new logic bug in nco_grd_nfr()
+
+2015-10-05  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.3-alpha06 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha06 final changes';git push
+	git tag -a 4.5.3-alpha06 -m 'Version 4.5.3-alpha06 tag: curvilinear regridding';git push --tags
+
+	* Regridded WRF looks OK---range and location are good. Still need precise evaluation.
+
+	* Wow, curvilinear grids now actually run, though flg_grd_out_crv only reaches half-way to the end of nco_rgr_map()
+
+	* Introduce flg_grd_out_crv in nco_rgr_map()
+
+	* Update maps to 20150901 versions in NCO regression tests, everything passes on dust
+
+2015-10-04  Charlie Zender  <zender at uci.edu>
+
+	* Saw "The Maritan". Psyched to do NASA work. nco_grd_nfr() now	correctly infers WRF.
+
+2015-10-02  Charlie Zender  <zender at uci.edu>
+
+	* Re-establish dust.ess.uci.edu as regression test server for scp
+
+	* Add ncrename regression test simultaneously renaming multiple dimensions
+
+	* NCO 4.5.3-alpha05 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha05 final changes';git push
+	git tag -a 4.5.3-alpha05 -m 'Version 4.5.3-alpha05 tag: ncatted, mk crv, lon_crv, sph_plg';git push --tags
+
+	* Fix (relatively bad) bug introduced in 4.5.1 where blank attribute names dump core rather than expanding into all attribute names
+
+	* Add ncatted regression test for deleting all attributes
+
+2015-10-01  Charlie Zender  <zender at uci.edu>
+
+	* nco_grd_mk() constructs correct degenerate SLD grids (verified area, corners)
+
+	* Apply nco_sph_plg_area() to SLD
+
+	* Functionalize spherical polygon area calculation into nco_sph_plg_area()
+
+2015-09-30  Charlie Zender  <zender at uci.edu>
+
+	* Corrected UL corner, but SCRIP file still appears to be invalid
+
+2015-09-29  Charlie Zender  <zender at uci.edu>
+
+	* Hand-correcting curvilinear algorithm...
+
+	* ERWG and Tempest flag problems with inferred curvilinear SCRIP grids
+
+	* nco_rgr_map() tests output grid for curvilinearity
+
+	* Document regridding skl and nfr switches
+
+2015-09-28  Charlie Zender  <zender at uci.edu>
+
+	* Fix compiler diagnosis for gcc/g++
+
+	* NCO 4.5.3-alpha04 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha04 final changes';git push
+	git tag -a 4.5.3-alpha04 -m 'Version 4.5.3-alpha04 tag: nfr SLD, skl, disable-doc, MPAS-O, snwe, wesn';git push --tags
+
+	* nco_grd_nfr() appears to correctly infer SLD grids from grid centers, cannot verify until nco_rgr_map() reads SLD files
+
+	* Add idx_dbg point-debugging feature for SLD
+
+2015-09-27  Charlie Zender  <zender at uci.edu>
+
+	* Temporarily change regression scp location from givre to glace
+
+	* First stab at inferring curvilinear grid from input file
+
+	* Change sense of normalization when frac_b contains non-unity elements (could interfere with flg_rnr?)
+
+	* Automatically add frc_out (i.e., frac_b) to output when remapping is conservative and frac_b contains non-unity elements
+
+	* Verified that MPAS-O regridding is not yet conservative--masking problem?
+
+2015-09-25  Charlie Zender  <zender at uci.edu>
+
+	* Regridding appears to work on MPAS-O fields once nCells is last dimension
+
+	* Apply Tempest src_grid_dims workaround to faulty MPAS-O src_grid_dims (solves MPAS Ocean problem)
+
+2015-09-22  Charlie Zender  <zender at uci.edu>
+
+	* Implement configure --enable_doc option, attempt and fail to override this if makeinfo version < 4.8
+
+2015-09-20  Charlie Zender  <zender at uci.edu>
+
+	* Change auxiliary coordinate input from float to double
+
+	* Add SNWE and WESN input options for bounding boxes
+
+2015-09-20  Henry Butowsky  <henryb at hush.com>
+
+	* Modify ncap_var_var_op() so that missing values in both operands are equal
+	This is expensive when all the missing values in one operand must be replaced
+	So for example if v1 and v2 have different mss_val then	diff1=diff2 where
+        diff1=total((v1-v2)^2) and diff2=total((v2-v1)^2))
+
+2015-09-17  Charlie Zender  <zender at uci.edu>
+
+	* Add skeleton output grid capability with --rgr skl=fl_skl
+
+	* Document regional features NSEW in nco.texi
+
+	* round() integer-type extensive variables
+
+2015-09-16  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.3-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha03 final changes';git push
+	git tag -a 4.5.3-alpha03 -m 'Version 4.5.3-alpha03 tag: --xtn --extensive, ncks HINT, ncecat --gag fix';git push --tags
+
+	* Add regression test (the first one!) for ncecat --gag
+
+	* Reset rcd in ncecat after checking for group existence. Caused ncecat --gag to die. Problem introduced in 4.4.9 on 20150515, and reported by Huan Wu.
+
+	* ncks exit with error when regridding specified without output file
+
+2015-09-15  Charlie Zender  <zender at uci.edu>
+
+	* Implement SLD stubs in nco_grd_nfr()
+
+	* Check return codes in sld_nco.sh
+
+	* Fix grid infer problem caused by segregating lat_typ from grd_typ
+
+2015-09-14  Charlie Zender  <zender at uci.edu>
+
+	* Diagnosed lat, lon, 2D grid-types now self-consistent for regional grids
+
+	* Clean-up sld_nco.sh, better segregate nco_2d_grd_typ from nco_lat_grd_typ
+
+2015-09-11  Charlie Zender  <zender at uci.edu>
+
+	* Add sld_nco.sh script for Swath-Like Data processing to nco/data
+
+2015-09-11  Henry Butowsky  <henryb at hush.com>
+
+	* mods to ncap_var_lgcl() - original version convered all var type to NC_SHORT and then evaluated boolean
+	problem with this is that when reducing precision say from float to short a large _FillValue say 9.9e20f
+	would be converted to 0s. This leads propblems in if(). New version  evaluates for each type
+
+2015-09-10  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.5.3-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha02 final changes';git push
+	git tag -a 4.5.3-alpha02 -m 'Version 4.5.3-alpha02 tag: SLD regrid sort-of works for AIRS';git push --tags
+
+	* nco_grd_nfr() produces reasonable numbers for AIRS test case!
+
+	* Fix area output and improve metadata output in nco_grd_nfr()
+
+2015-09-09  Charlie Zender  <zender at uci.edu>
+
+	* nco_grd_nfr() produces useful gridfile from AIRS test-data
+
+2015-09-08  Charlie Zender  <zender at uci.edu>
+
+	* Add regression test for MSA averages in ncra problem reported by Christine Smit
+
+	* Add infrastructure for NASA AXS/SLD project in nco_grd_nfr()
+
+	* Change remote scp repository for regridding from givre to glace
+
 2015-09-06  Charlie Zender  <zender at uci.edu>
 
+	* NCO 4.5.3-alpha01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.5.3-alpha01 final changes';git push
+	git tag -a 4.5.3-alpha01 -m 'Version 4.5.3-alpha01 tag: bump versions';git push --tags
+
 	* NCO 4.5.2 release procedure:
- 	Changes since nco-4.5.0: ncra --wgt nrm, --grid, --glb, Newton Gaussian
+ 	Changes since nco-4.5.1: ncra --wgt nrm, --grid, --glb, Newton Gaussian
 	cd ~/nco;git commit -a -m 'Version 4.5.2 release final changes';git push
 	git tag -d 4.5.2;git push origin :refs/tags/4.5.2
 	git tag -a 4.5.2 -m 'Version 4.5.2: Parenthood';git push --tags
diff --git a/doc/MANIFEST b/doc/MANIFEST
index a248050..cad192f 100644
--- a/doc/MANIFEST
+++ b/doc/MANIFEST
@@ -116,6 +116,7 @@ nco/data/netcdf4.nco	Sample input script for netCDF4-enabled ncap2
 nco/data/obs.cdl 	CDL file to test group broadcasting
 nco/data/psd.nco	Sample ncap2 script that computes particle size distributions
 nco/data/psd_wrf.nco	Sample ncap2 script that computes WRF particle size distributions
+nco/data/sld_nco.sh	NCO script to process (regrid) Swath-Like Data (SLD)
 nco/data/swamp.sh	Demonstrate SWAMP usage
 nco/data/tst.nco	Sample ncap script that computes geophysical quantities
 nco/data/udunits.dat	UDUnits database for Debian compatibility
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 92c1b29..09f7fe7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,3 +1,6 @@
+# $Header$ -*-makefile-*-
+
+# fxm: 20150923 Allow for building documentation (man pages) without TeXInfo
 info_TEXINFOS = nco.texi
 EXTRA_DIST = nco nco.dvi nco.html nco.pdf nco.ps nco.xml VERSION
 
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 808f84f..360ab83 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -13,6 +13,8 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
+
+# $Header$ -*-makefile-*-
 VPATH = @srcdir@
 am__is_gnu_make = { \
   if test -z '$(MAKELEVEL)'; then \
@@ -340,6 +342,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+
+# fxm: 20150923 Allow for building documentation (man pages) without TeXInfo
 info_TEXINFOS = nco.texi
 EXTRA_DIST = nco nco.dvi nco.html nco.pdf nco.ps nco.xml VERSION
 
diff --git a/doc/TODO b/doc/TODO
index 84cd87c..d568b6f 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -675,7 +675,8 @@ nco1122. cnk slowdown Barry McInnes 3/9
 nco1123. ESGF access
       ncks -M http://esgf-data2.ceda.ac.uk/thredds/dodsC/cmip5.output1.MOHC.HadGEM2-ES.rcp85.mon.ocean.Omon.r1i1p1.uo.20111014.aggregation.1
 nco1124. ncra fix ncra --wgt_nm to work (i.e., correctly normalize) with missing values
-nco1125. 
+nco1125. ncpdq add option for user-specified scale_factor/add_offset
+nco1126. 
 qrk
 ************************************************************************
 End ncoXXX TODOs
diff --git a/doc/VERSION b/doc/VERSION
index 6cedcff..4e298cc 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.5.2
+4.5.3
diff --git a/doc/debian.txt b/doc/debian.txt
index 9047c36..b875d82 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.1
-   First we create a clean source distribution of nco and place it in nco-4.5.1
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.5.3
+   First we create a clean source distribution of nco and place it in nco-4.5.3
    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.1
-/bin/rm nco.tar.gz;tar cvzf nco-4.5.1.tar.gz ./nco-4.5.1/*
-cd ~/nco/nco-4.5.1
-dh_make -e zender at uci.edu -f ../nco-4.5.1.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.5.3
+/bin/rm nco.tar.gz;tar cvzf nco-4.5.3.tar.gz ./nco-4.5.3/*
+cd ~/nco/nco-4.5.3
+dh_make -e zender at uci.edu -f ../nco-4.5.3.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.1.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.5.2
+   cd ~/nco/nco-4.5.3
    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.2 with X.Y.Z+1
+# tags-query replace 4.5.3 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.2-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.5.3-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.2
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.5.3
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.5.2.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.5.3.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.5.2-2~ppa1_source.changes
+dput NCO nco_4.5.3-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.2-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_4.5.2-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_4.5.2-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_4.5.2-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_4.5.2.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_4.5.3-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.5.3-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.5.3-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.5.3-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.5.3.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.2 ${DATA}/nco_4.5.2* ${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.2-1 -d nco-4.5.2 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.2 nco # Export most recent
-tar cvzf ./nco_4.5.2.orig.tar.gz --exclude='nco-4.5.2/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.2 
-/bin/rm -rf ${DATA}/nco-4.5.2 # Remove cvs-exported directory
-tar xvzf ./nco_4.5.2.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-4.5.2/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.5.2/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.5.2/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-4.5.3 ${DATA}/nco_4.5.3* ${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.3-1 -d nco-4.5.3 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.3 nco # Export most recent
+tar cvzf ./nco_4.5.3.orig.tar.gz --exclude='nco-4.5.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.3 
+/bin/rm -rf ${DATA}/nco-4.5.3 # Remove cvs-exported directory
+tar xvzf ./nco_4.5.3.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.5.3/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.5.3/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.5.3/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.2;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-4.5.2;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
-cd ${DATA}/nco-4.5.2;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-4.5.3;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.5.3;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.5.3;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.5.2-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.5.3-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.2-1_*.deb
-ls -l ${DATA}/nco_4.5.2*
+lintian ${DATA}/nco_4.5.3-1_*.deb
+ls -l ${DATA}/nco_4.5.3*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_4.5.2* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_4.5.2* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_4.5.3* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.5.3* 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.2-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.5.3-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.2* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.5.3* # 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.2-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.5.2-1_*.changes
-lintian /var/cache/pbuilder/result/nco_4.5.2-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.5.3-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.5.3-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.5.3-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.5.2-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.5.3-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.2-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.5.3-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.2 ${DATA}/nco-4.5.2* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.5.3 ${DATA}/nco-4.5.3* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-4.5.2 \
-${rpm_root}/RPMS/i386/nco-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.2-?.i386.rpm \
-${rpm_root}/SOURCES/nco-4.5.2.tar.gz \
-${rpm_root}/SPECS/nco-4.5.2.spec \
-${rpm_root}/SRPMS/nco-4.5.2-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.2-1 -d nco-4.5.2 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.5.2.spec
-tar cvzf ./nco-4.5.2.tar.gz --exclude='nco-4.5.2/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.2 
-${sudo_sng} /bin/cp ${DATA}/nco-4.5.2.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-4.5.3 \
+${rpm_root}/RPMS/i386/nco-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.3-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.5.3.tar.gz \
+${rpm_root}/SPECS/nco-4.5.3.spec \
+${rpm_root}/SRPMS/nco-4.5.3-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.3-1 -d nco-4.5.3 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.5.3.spec
+tar cvzf ./nco-4.5.3.tar.gz --exclude='nco-4.5.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.3 
+${sudo_sng} /bin/cp ${DATA}/nco-4.5.3.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.5.2.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.5.3.spec > ~/foo.nco 2>&1
 scp \
-${rpm_root}/RPMS/i386/nco-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.2-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.5.2-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.3-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.5.3-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/RPMS/i386/nco-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.5.2-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.5.2-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.5.2-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.5.3-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.5.3-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.5.3-?.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.2 ${DATA}/nco-4.5.2* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.5.3 ${DATA}/nco-4.5.3* # Cleanup last build
 /bin/rm -r -f \
-${rpm_root}/nco-4.5.2-?.src.rpm \
-${rpm_root}/nco-4.5.2.spec \
-${rpm_root}/nco-4.5.2.tar.gz \
-${rpm_root}/*/nco-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.2-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.2-1 -d nco-4.5.2 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.2 nco # Export most recent and build as 4.5.2-1
-tar cvzf ./nco-4.5.2.tar.gz --exclude='nco-4.5.2/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.2 
-/bin/cp ${DATA}/nco-4.5.2.tar.gz ${rpm_root}
+${rpm_root}/nco-4.5.3-?.src.rpm \
+${rpm_root}/nco-4.5.3.spec \
+${rpm_root}/nco-4.5.3.tar.gz \
+${rpm_root}/*/nco-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.3-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.5.3-1 -d nco-4.5.3 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.3 nco # Export most recent and build as 4.5.3-1
+tar cvzf ./nco-4.5.3.tar.gz --exclude='nco-4.5.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.5.3 
+/bin/cp ${DATA}/nco-4.5.3.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.2-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.5.3-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.5.2-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.5.3-?.*.rpm
 scp \
-${rpm_root}/*/nco-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.2-?.*.rpm \
-${rpm_root}/nco-4.5.2-?.*.src.rpm \
+${rpm_root}/*/nco-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.3-?.*.rpm \
+${rpm_root}/nco-4.5.3-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/*/nco-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.5.2-?.*.rpm \
-${rpm_root}/*/nco-devel-4.5.2-?.*.rpm \
-${rpm_root}/nco-4.5.2-?.*.src.rpm \
+${rpm_root}/*/nco-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.5.3-?.*.rpm \
+${rpm_root}/*/nco-devel-4.5.3-?.*.rpm \
+${rpm_root}/nco-4.5.3-?.*.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 6450a45..86428b1 100644
--- a/doc/index.shtml
+++ b/doc/index.shtml
@@ -62,7 +62,7 @@ Try to disable Spammers' machines:
 [<a href="http://www.gnu.org/software/gsl">GSL</a>]
 [<a href="http://www.unidata.ucar.edu/packages/netcdf">netCDF</a>] 
 [<a href="http://opendap.org">OPeNDAP</a>] 
-[<a href="http://swamp.googlecode.com">SWAMP</a>] 
+[<a href="http://github.com/nco/swamp">SWAMP</a>] 
 [<a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a>] 
 </td></tr></table>
 
@@ -70,7 +70,7 @@ Try to disable Spammers' machines:
 <p><h1 align="center">Welcome to the netCDF Operator (NCO) Homepage</h1>
 
 <p><h2>
-Current NCO version is 4.5.1 last updated on <!--#flastmod file="VERSION"-->
+Current stable NCO version is 4.5.2 released <!--#flastmod file="src/nco-4.5.2.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,8 +149,9 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2015 Oct ??: 4.5.3 (<i>In progress</i>)
-<li>2015 Sep 06: 4.5.2 (Generate SCRIP grids)
+<li>2015 Nov ??: 4.5.4 (<i>In progress</i>)
+<li>2015 Oct 20: 4.5.3 (Curvilinear)
+<li>2015 Sep 06: 4.5.2 (Generate SCRIP)
 <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)
@@ -330,6 +331,33 @@ influence of your monetary donations on NCO development:
 <dt>NCO features “incentivized” by these donations: More emoticons in the documentation :)</dt>
 <hr></p>
 
+<a name="nsf"></a> <!-- http://nco.sf.net#nsf -->
+<dt><a name="prp_e3"></a></dt> <!-- http://nco.sf.net#prp_e3 -->
+<h2>NSF EarthCube Project</h2>
+<img src="nsf.png" height=180 width=180 align=right>
+<p>
+The National Science Foundation Grant
+<a href="http://www.nsf.gov/awardsearch/showAward.do?AwardNumber=1541031">NSF ICER-1541031</a>
+funded the Unidata-led
+<a href="http://dust.ess.uci.edu/prp/prp_e3/prp_e3.pdf">EarthCube Project</a>,
+“EarthCube IA: Collaborative Proposal: Advancing netCDF-CF for the Geoscience Community”
+from 20150901–20170831 as part of the 
+Integrative and Collaborative Education and Research
+(<a href="http://www.nsf.gov/div/index.jsp?org=ICER">ICER</a>)
+program. 
+This URL,
+<a href="http://nco.sf.net#prp_e3"><tt>http://nco.sf.net#prp_e3</tt></a>,
+points to the most up-to-date information on the EarthCube proposal.</p>
+
+<p>UCI's primary role is to help extend CF to cover hierarchical data structures, aka groups.
+Groups are the Group-Oriented Data Analysis and Distribution
+(<a href="http://nco.sf.net/nco.html#godad">GODAD</a>) paradigm we
+are developing for geoscience data analysis.
+We will convene workshops for interested stakeholders in 2016 and 2017.
+Be on the lookout for announcements!
+<hr></p>
+<!-- End http://nco.sf.net#nsf -->
+
 <a name="doe"></a> <!-- http://nco.sf.net#doe -->
 <a name="DOE"></a> <!-- http://nco.sf.net#DOE -->
 <a name="ACME"></a> <!-- http://nco.sf.net#ACME -->
@@ -357,7 +385,7 @@ are developing for geoscience data analysis.</p>
 <a name="nasa"></a> <!-- http://nco.sf.net#nasa -->
 <a name="access"></a> <!-- http://nco.sf.net#access -->
 <dt><a name="prp_axs"></a></dt> <!-- http://nco.sf.net#prp_axs -->
-<h2>NASA ACCESS 2013 Project</h2>
+<h2>NASA ACCESS Project</h2>
 <img src="nasa.png" height=180 width=180 align=right>
 <p>
 The National Aeronautics and Space Administration (NASA) Cooperative
@@ -395,7 +423,8 @@ See the ads for more details.
  <a href="http://dust.ess.uci.edu/hire/prg_anl_06_adv.txt">TXT</a>).
 <hr></p>
 
-<dt><a name="prp_access"></a></dt> <!-- http://nco.sf.net#prp_access -->
+<!--
+<dt><a name="prp_access"></a></dt>
 <h2>NASA ACCESS 2011 Project</h2>
 <img src="nasa.png" height=180 width=180 align=right>
 <p>
@@ -451,11 +480,10 @@ the most important problems real-world researchers encounter in
 evaluating GCMs against satellite data.</p>  
 </ul>
 <hr></p>
+-->
 
-<a name="nsf"></a> <!-- http://nco.sf.net#nsf -->
-<a name="sdo"></a> <!-- http://nco.sf.net#sdo -->
-<a name="sei"></a> <!-- http://nco.sf.net#sei -->
-<dt><a name="prp_sei"></a></dt> <!-- http://nco.sf.net#prp_sei -->
+<!--
+<dt><a name="prp_sei"></a></dt>
 <h2>NSF SEI Project</h2>
 <img src="nsf.png" height=180 width=180 align=right>
 <p>
@@ -524,6 +552,7 @@ climate prediction scenarios for the same model, and among different
 climate models (see <a href="#pub">publications</a>).</p> 
 </ul>
 <hr></p>
+-->
 
 <!-- http://nco.sf.net#pub -->
 <!-- http://nco.sf.net#pubs -->
@@ -661,17 +690,24 @@ 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.1 http://github.com/nco/nco.git nco-4.5.1</tt></a>.
+<a name="#Source">with <tt>git clone -b 4.5.2 http://github.com/nco/nco.git nco-4.5.2</tt></a>.
 <ul>
-<li><b>NCO 4.5.4</b>: (<i>Future</i>) 
+<li><b>NCO 4.5.5</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;
 extensive hashing?;
 netCDF4 compound types?;
 Optimize diskless files?;</li>
-<li><b>NCO 4.5.3</b>: (<i>In Progress, features in-progress or completed include</i>)
-<tt>ncks</tt> better support regional grids;</li>
-<li><b>NCO 4.5.2</b>: (<i>Current Stable Release</i>)
+<li><b>NCO 4.5.4</b>: (<i>In Progress, features in-progress or completed include</i>)
+<tt>ncks</tt> regridder uses CF to find coordinates;
+<tt>ncks --xtn</tt> better extensive variable treatment;</li>
+<li><b>NCO 4.5.3</b>: (<i>Current Stable Release</i>)
+<tt>ncatted</tt> fix deletion of all attributes;
+<tt>ncecat</tt> fix <tt>gag</tt> mode;
+<tt>ncks</tt> infers rectangular and curvilinear grids;
+<tt>ncks --xtn</tt> specifies extensive variables;
+<tt>ncks</tt> regridder fix multi-level field normalization;</li>
+<li><b>NCO 4.5.2</b>: 
 All operators support <tt>--glb_att_add</tt>;
 <tt>ncks</tt> better support for <tt>fracarea</tt>, <tt>mask</tt>, and displaced-pole grids;
 <tt>ncks</tt> diagnoses <tt>area</tt> for bilinear remapping and when area_b equals 0.0;
@@ -853,7 +889,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.1</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.2</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.
@@ -861,12 +897,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.1-1_i386.deb</tt>’):</dt>
-<li><a href="src/nco_4.5.1-1_amd64.deb">nco_4.5.1-1_amd64.deb</a> (<!--#fsize file="src/nco_4.5.1-1_amd64.deb"-->): Executables AMD64-compatible (last updated <!--#flastmod file="src/nco_4.5.1-1_amd64.deb"-->)</li>
-<li><a href="src/nco_4.5.1-1.dsc">nco_4.5.1-1.dsc</a> (<!--#fsize file="src/nco_4.5.1-1.dsc"-->): Description (last updated <!--#flastmod file="src/nco_4.5.1-1.dsc"-->)</li>
-<li><a href="src/nco_4.5.1-1_amd64.changes">nco_4.5.1-1_amd64.changes</a> (<!--#fsize file="src/nco_4.5.1-1_amd64.changes"-->): Changes since last deb package (last updated <!--#flastmod file="src/nco_4.5.1-1_amd64.changes"-->)</li>
-<li><a href="src/nco_4.5.1.orig.tar.gz">nco_4.5.1.orig.tar.gz</a> (<!--#fsize file="src/nco_4.5.1.orig.tar.gz"-->): Upstream Source (last updated <!--#flastmod file="src/nco_4.5.1.orig.tar.gz"-->)</li>
-<li><a href="src/nco_4.5.1-1.diff.gz">nco_4.5.1-1.diff.gz</a> (<!--#fsize file="src/nco_4.5.1-1_amd64.changes"-->): Debian patch to upstream source (last updated <!--#flastmod file="src/nco_4.5.1-1_amd64.changes"-->)</li>
+<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>
 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. 
@@ -913,10 +949,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
 <!-- 
 # Mac OS X 10.10 (Yosemite) 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.1.macosx.10.10.tar.gz nc*;scp ${DATA}/nco-4.5.1.macosx.10.10.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-4.5.2.macosx.10.10.tar.gz nc*;scp ${DATA}/nco-4.5.2.macosx.10.10.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.1.macosx.10.10.tar.gz">nco-4.5.1.macosx.10.10.tar.gz</a> (<!--#fsize file="src/nco-4.5.1.macosx.10.10.tar.gz"-->): Executables MacOSX 10.10-compatible (last updated <!--#flastmod file="src/nco-4.5.1.macosx.10.10.tar.gz"-->). 
+<li><a href="src/nco-4.5.2.macosx.10.10.tar.gz">nco-4.5.2.macosx.10.10.tar.gz</a> (<!--#fsize file="src/nco-4.5.2.macosx.10.10.tar.gz"-->): Executables MacOSX 10.10-compatible (last updated <!--#flastmod file="src/nco-4.5.2.macosx.10.10.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>
@@ -939,10 +975,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.1.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.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.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.1.windows.mvs.exe">nco-4.5.1.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.5.1.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.5.1.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
+<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>
 </ul>
 
 <a name="cygwin"></a> <!-- http://nco.sf.net#cygwin -->
@@ -1108,11 +1144,11 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- scp ${DATA}/nco-4.5.1.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="src/nco-4.5.1.tar.gz">nco-4.5.1.tar.gz</a> 
-(<!--#fsize file="src/nco-4.5.1.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-4.5.1.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-4.5.1.tar.gz"--> 
+<!-- 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"--> 
 </li>
 </ul>
 
@@ -1131,17 +1167,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.1</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout -b 4.5.1</tt></p>
+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>
 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.1</tt>) and the development version is that the
+(e.g., <tt>4.5.2</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.5.1</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.5.2</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.
@@ -1273,9 +1309,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.1.tar.gz</dt>
-<dt>tar xvzf 4.5.1.tar.gz</dt>
-<dt>cd nco-4.5.1</dt>
+<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>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1318,14 +1354,17 @@ personal directories shown below.
 These are usually built from a recent tagged-version of NCO (e.g.,
 4.5.X-alphaY) not from the “bleeding-edge” of master which
 is usually untagged.
-
+  One way to use these pre-built executables is to prepend them to
+  your executable and library search paths, e.g., 
+  <tt>export PATH="~zender/bin:${PATH}"</tt>,
+  <tt>export LD_LIBRARY_PATH="~zender/lib:${LD_LIBRARY_PATH}"</tt>
 <ul>
-<li>ANL ALCF Cooley <tt></tt>: <tt>~zender/bin</tt></li>
+<li>ANL ALCF Cooley <tt>cooley.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 Hopper <tt></tt>: <tt>~zender/bin</tt></li>
-<li>ORNL OLCF Pileus <tt></tt>: <tt>~zender/bin</tt></li>
-<li>ORNL OLCF Rhea <tt></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>UCI ESS <tt>greenplanet.ps.uci.edu</tt>: <tt>~zender/bin</tt></li>
 </ul>
 <hr></p>
@@ -1646,7 +1685,7 @@ solutions for geoscience workflows
 discover and exploit parallelism in scripted workflows.
 2. Resource management in combined computation-data service environments.
 3. Design and implement 
-<a href="http://swamp.googlecode.com">SWAMP</a> to provide
+<a href="http://github.com/nco/swamp">SWAMP</a> to provide
 automated server-side data analysis capabilities to the geoscience 
 community. 
 <i>Other Interests</i>: Large data, data management, programming languages and practice.
@@ -1680,7 +1719,7 @@ community.
 [<a href="http://www.gnu.org/software/gsl">GSL</a>] 
 [<a href="http://www.unidata.ucar.edu/packages/netcdf">netCDF</a>] 
 [<a href="http://opendap.org">OPeNDAP</a>] 
-[<a href="http://swamp.googlecode.com">SWAMP</a>]
+[<a href="http://github.com/nco/swamp">SWAMP</a>]
 [<a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a>] 
 </td></tr></table>
 
diff --git a/doc/nces.txt b/doc/nces.txt
new file mode 100644
index 0000000..ca4ab2b
--- /dev/null
+++ b/doc/nces.txt
@@ -0,0 +1,105 @@
+nces: netCDF Ensemble Statistics
+a familiar operator with new features for group-level ensembles
+
+nces goal: exploit parallelism of ensembles stored in group hierarchies
+
+nces backward-compatible user migration:
+deprecate ncea for nces=netCDF ensemble statistics?
+deprecate ncra for ncrs=netCDF record   statistics?
+give nces two personalities:
+where --nsm_grp collapses group ensembles across files into statistics in parent group in output file
+      --nsm_fl  collapses file  ensembles              into statistics                 in output file
+or use --clp ("collapse"), or ... ?
+current ncea becomes synonomous with nces --nsm_fl
+optional argument --nsm_sfx="sng" store statistics at same level as members in new group named nsm_nm+"sng"
+e.g., nsm_sfx="_avg" or nsm_sfx="_min"
+
+nces design assumptions (some could be relaxed later):
+ensemble members are leaf groups
+ensemble has at least two members
+members of a given ensemble contain identical variables/dimensions/ranks/sizes
+different ensembles may have completely different variables
+group can be parent of only one ensemble
+group can be more distant ancestor (e.g., grandparent) of multiple ensembles
+ensemble has one template (tpl) member to set ensemble output definitions/metadata
+choice of template member is arbitrary---use first group returned in grp_id list
+nsm_nbr and nsm_nm are identical in all following files
+mbr_nbr and mbr_nm may _change_ in following files
+
+nces new variables/structure members:
+
+New structure members for variables and groups when prg==ncga:
+char *nsm_nm; /* [sng] Ensemble parent group name */ i.e., full path to ensemble parent
+nco_bool flg_nsm_tpl; /* [flg] Group is, or variable is in, template member group */
+nco_bool flg_nsm_mbr; /* [flg] Group is, or variable is in, ensemble member group */
+nco_bool flg_nsm_prn; /* [flg] Group is, or variable is in, ensemble parent group */
+
+New structure members for groups when prg==ncga:
+int mbr_nbr; /* [nbr] Number of members of ensemble */ i.e., number in this ensemble in this file
+char **mbr_nm; /* [sng] List of member group names */ (size is mbr_nbr)
+
+New structure members for top-levle trv_tbl when prg==ncga:
+int nsm_nbr; /* [nbr] Number of ensembles */ i.e., number in first file
+char **nsm_nm; /* [sng] List of ensemble parent group names */ (size is nsm_nbr)
+
+nces code flow (details on changes follow):
+
+nco_bld_trv_tbl(): room for new fields. no other changes
+nco_bld_nsm(): new. fill-in nsm/mbr/tpl fields
+nco_fll_var_trv(): ncga vars in ensembles get only one structure
+nco_var_lst_dvd(): ncga rules depend heavily on flg_nsm_tpl
+nco_var_prc_fix_trv(): no changes?
+nco_xtr_dfn(): ensemble statistics by default defined in grp_nsm_prn
+nco_cpy_fix_var_trv(): ncga output group name depends on flg_nsm_tpl
+
+and then main loops like this:
+
+fl_idx=0,fl_nbr-1
+  nsm_idx=0,nsm_nbr-1
+    nco_nsm_rfr(): new. refresh mbr_nbr, mbr_nm for this ensemble
+    mbr_idx=0,mbr_nbr-1
+      OpenMP over var loop:
+      var_idx=0,nbr_var_prc-1
+        if(var->nsm_nm == nsm_nm[nsm_idx]){ensemble statistics}; else skip/continue;
+
+---or---
+
+fl_idx=0,fl_nbr-1
+  nco_nsm_rfr(): new. refresh mbr_nbr, mbr_nm for all ensembles
+  OpenMP over var loop:
+  var_idx=0,nbr_var_prc-1
+    mbr_idx=0,mbr_nbr[var_idx]-1
+      ensemble statistics (same as ncea)
+
+nces code change details:
+
+nco_bld_trv_tbl() first include/exclude -g -v --unn options. few if any changes.
+
+multiple (nsm_nbr) copies of each output ensemble member are now flagged with flg_xtr
+
+before nco_fll_var_trv() implement new function nco_bld_nsm(), similar to nco_bld_rec_dmn()
+
+nco_bld_nsm() crawls trv_tbl and identifies similar leaf groups as ensemble members
+their common parent group is the ensemble parent
+
+nco_bld_nsm() sets flags/variables/arrays in member and parent groups/variables: 
+
+nco_fll_var_trv() exports, for ncga, var list containing only
+variables with (!flg_mbr && flg_xtr) and (flg_mbr && flg_nsm_tpl).
+
+nco_var_lst_dvd() for ncga: 
+as usual coordinates are typ_fix
+variables with flg_nsm_tpl are typ_prc
+variables without flg_nsm_tpl are typ_fix. 
+
+nco_xtr_dfn() for ncga:
+if !flg_nsm_tpl then grp_nm_fll_out=gpe(grp_nm_fll_in) (same as usual)
+if flg_nsm_tpl then grp_nm_fll_out=gpe(grp_nm_nsm_prn)=gpe(grp_nm_fll_in-grp_nm_in)=gpe(grp_nm_fll_in,:-1)
+
+nco_cpy_fix_var_trv() for ncga: 
+if !flg_nsm_tpl grp_nm_fll_out=gpe(grp_nm_fll_in) (same as usual)
+if flg_nsm_tpl grp_nm_fll_out=gpe(grp_nm_nsm_prn)=gpe(grp_nm_fll_in-grp_nm_in)=gpe(grp_nm_fll_in,:-1)
+
+nco_nsm_rfr(): 
+nsm_nbr and nsm_nm never change
+for these ensembles, refresh mbr_nbr, mbr_nm once per file
diff --git a/doc/nco.texi b/doc/nco.texi
index 386520d..cc62a25 100644
--- a/doc/nco.texi
+++ b/doc/nco.texi
@@ -38,7 +38,8 @@ M-x texinfo-multiple-files-update
 
 Usage: 
 export TEX='tex --src-specials'
-cd ~/nco/doc;texi2dvi nco.texi; makeinfo --html --ifinfo --no-split --output=nco.html nco.texi; makeinfo nco.texi; dvips -o nco.ps nco.dvi;texi2dvi --pdf nco.texi;makeinfo --xml --ifinfo --no-split --output=nco.xml nco.texi;makeinfo --no-headers --output=nco.txt nco.texi
+cd ~/nco/doc;texi2dvi nco.texi;makeinfo --html --ifinfo --no-split --output=nco.html nco.texi;makeinfo nco.texi;dvips -o nco.ps nco.dvi;texi2dvi --pdf nco.texi;makeinfo --xml --ifinfo --no-split --output=nco.xml nco.texi;makeinfo --no-headers --output=nco.txt nco.texi
+cd ~/nco/doc;/usr/bin/scp index.shtml nco_news.shtml ChangeLog TODO README VERSION nco.dvi nco.html nco.info* nco.pdf nco.ps nco.texi nco.txt nco.xml ../data/ncap.in ../data/ncap2.in zender,nco at web.sf.net:/home/project-web/nco/htdocs;cd -
 dvips -o nco.ps nco.dvi 
 dvips -Ppdf -G0 -o nco.ps nco.dvi 
 makeinfo --html --ifinfo --no-split --output=nco.html nco.texi
@@ -52,14 +53,10 @@ texi2dvi --output=nco.dvi nco.texi
 texi2dvi --pdf --output=nco.pdf nco.texi
 texi2html -monolithic -verbose nco.texi
 texi2html -l2h -l2h_tmp=./l2h_tmp -monolithic -verbose nco.texi # Invoke latex2html
-cd ~/nco/doc;/usr/bin/scp index.shtml nco_news.shtml ChangeLog TODO README VERSION nco.dvi nco.html nco.info* nco.pdf nco.ps nco.texi nco.txt nco.xml ../data/ncap.in ../data/ncap2.in zender,nco at web.sf.net:/home/project-web/nco/htdocs;cd -
-cd ~/nco/doc;      scp -p index.shtml nco_news.shtml ChangeLog TODO README VERSION nco.dvi nco.html nco.info* nco.pdf nco.ps nco.texi nco.txt nco.xml ../data/ncap.in ../data/ncap2.in dust.ess.uci.edu:/var/www/html/nco;cd -
 # 20130806 Copy CMIP5 images (takes additional time)
 cd ~/nco/doc/xmp;/usr/bin/scp fgr*.png fgr*.eps zender,nco at web.sf.net:/home/project-web/nco/htdocs/xmp;cd -
-cd ~/nco/doc/xmp;/usr/bin/scp fgr*.png fgr*.eps dust.ess.uci.edu:/var/www/html/nco/xmp;cd -
 # 20120203 Copy all nco.html PNG images (takes additional time)
 cd ~/nco/doc;/usr/bin/scp nco_*.png zender,nco at web.sf.net:/home/project-web/nco/htdocs;cd -
-cd ~/nco/doc;scp -p nco_*.png dust.ess.uci.edu:/var/www/html/nco;cd -
 # 20130801 Copy nco.texi to Ubuntu machine for quick build-tests
 scp ~/nco/doc/nco.texi givre.ess.uci.edu:nco/doc
 
@@ -117,12 +114,12 @@ Octave TeXInfo manual shows clean TeXInfo structure
 @setfilename nco.info
 
 @c Define edition, date, ...
- at set nco-edition 4.5.2
- at set doc-edition 4.5.2
+ at set nco-edition 4.5.3
+ at set doc-edition 4.5.3
 @set copyright-years 1995--2015
 @set update-year 2015
- at set update-date 5 September 2015
- at set update-month September 2015
+ at set update-date 18 October 2015
+ at set update-month October 2015
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -5961,9 +5958,11 @@ to avoid confusion.
 @cindex Gaussian grid
 @cindex Equi-Angular grid
 @cindex FV grid
+ at cindex CAM-FV grid
 @cindex grid, Fixed
 @cindex grid, Offset
 @cindex grid, FV
+ at cindex grid, CAM-FV
 @cindex grid, Equi-Angular
 @cindex grid, Gaussian
 @cindex gridfile
@@ -5986,29 +5985,50 @@ The grids are stored in an external @var{grid-file}.
 
 All options pertinent to the grid geometry and metadata are passed to
 @acronym{NCO} via key-value pairs prefixed by the @samp{--rgr} option.
-Pass at least six key-value pair arguments to create a fully
-explicitly specified, well-annotated grid.
-The six arguments, and their corresponding keys, are: grid title
-(@var{grd_ttl}), grid filename (@var{grid}), number of latitudes
-(@var{lat_nbr}), number of longitudes (@var{lon_nbr}), latitude
-grid-type (@var{lat_typ}), and longitude grid-type (@var{lon_typ}). 
-Four other arguments (the North/South/East/West bounding box) are
-necessary to construct equi-angular regional (non-global) grids, described
-later. 
-
-The six arguments, and their corresponding keys, are: 
- at enumerate
+Perhaps the two most important key-value pair arguments are 
+The text strings that describe the grid and name the file are important 
+aids to convey the grid geometry to other users.
+These arguments, and their corresponding keys, are the grid title
+(@var{grd_ttl}), and grid filename (@var{grid}), respectively.
+The numbers of latitudes (@var{lat_nbr}) and longitudes (@var{lon_nbr})   
+are independent, and together determine the grid storage size.
+These four options should be considered mandatory, although
+ at acronym{NCO} provides defaults for any arguments omitted.
+
+The remaining arguments depend on the whether the grid is global or
+regional.
+For global grids, one should specify only two more arguments, the
+latitude (@var{lat_typ}) and longitude (@var{lon_typ}) grid-types.
+These types are chosen as described below from a small selection of
+options that together define the most common rectangular global grids.
+For regional grids, one must specify the bounding box, i.e., the edges
+of the rectangular grid on the North (@var{lat_nrt}), South (@var{lat_sth}), 
+East (@var{lat_est}), and West (@var{lat_nrt}) sides. 
+Specifying a bounding box for global grids is redundant and will cause
+an error to ensure the user intends a global grid.
+ at acronym{NCO} assumes that regional grids are uniform, though it will 
+attempt to produce regional grids of other types if the user specifies
+other latitude (@var{lat_typ}) and longitude (@var{lon_typ}) grid-types,
+e.g., Gaussian or Cap.
+Edges of a regional bounding box may be specified individually, or in
+the single-argument forms.
+
+The full description of grid-generation arguments, and their
+corresponding keys, is:
+ at table @dfn
 @cindex @var{grd_ttl}
 @cindex @samp{--rgr grd_ttl=@var{grd_ttl}}
- at item It is surprisingly difficult to discern the geometric
+ at item Grid Title: @var{grd_ttl}
+It is surprisingly difficult to discern the geometric
 configuration of a grid from the coordinates of a @acronym{SCRIP}-format
 gridfile.  
 A human-readable grid description should be placed in @var{grd_ttl}.
-Examples include ``FV-scalar grid 129x256'' and ``T42 Gaussian grid''. 
+Examples include ``CAM-FV scalar grid 129x256'' and ``T42 Gaussian grid''. 
 
 @cindex @var{grid}
 @cindex @samp{--rgr grid=@var{grid}}
- at item The grid-generation @acronym{API} was bolted-on to @acronym{NCO}
+ at item Grid File: @var{grid}
+The grid-generation @acronym{API} was bolted-on to @acronym{NCO}
 and is somewhat primitive, e.g., having to repeat the @samp{--rgr}
 option. 
 Another aspect of this is that the output grid filename is distinct
@@ -6026,7 +6046,8 @@ Its contents are immaterial.
 @cindex @var{lon_grd}
 @cindex @samp{--rgr lon_grd=@var{lon_grd}}
 @cindex @samp{--rgr lat_grd=@var{lat_grd}}
- at item The keys that hold the longitude and latitude gridtypes (which
+ at item Grid Types: @var{lat_grd}, @var{lon_grd}
+The keys that hold the longitude and latitude gridtypes (which
 are, by the way, independent of eachother) are @var{lon_grd} and
 @var{lat_grd}. 
 The @var{lat_typ} options for global grids are @samp{uni} for
@@ -6071,14 +6092,14 @@ another grid.
 The Finite-Volume (@acronym{FV}) method is often used to represent 
 and solve the equations of motion in climate-related fields.
 Many @acronym{FV} solutions (including the popular Lin-Rood method as
-used in the @acronym{CESM} model) evaluate scalar (i.e., non-vector)
-fields (e.g., temperature, water vapor) at gridcell centers of what is 
-therefore called the scalar grid. 
+used in the @acronym{CESM} @acronym{CAM-FV} atmospheric model) evaluate
+scalar (i.e., non-vector) fields (e.g., temperature, water vapor) at
+gridcell centers of what is therefore called the scalar grid. 
 @acronym{FV} methods (like Lin-Rood) that employ an Arakawa C-grid or
 D-grid formulation define velocities on the edges of the scalar grid.
-This @acronym{FV}-velocity grid is therefore ``staggered'' or ``offset'' 
-from the scalar grid by one-half gridcell. 
-The Lin-Rood @acronym{FV}-scalar latitude grid has gridpoints (the
+This @acronym{CAM-FV} velocity grid is therefore ``staggered'' or
+``offset'' from the @acronym{CAM-FV} scalar grid by one-half gridcell.  
+The @acronym{CAM-FV} scalar latitude grid has gridpoints (the
 ``caps'') centered on each pole to avoid singularities.
 The offset of a Cap-grid is a Uniform-grid, so the Uniform grid is 
 often called an @acronym{FV}-''offset'' or ``staggered'' grid.
@@ -6087,12 +6108,14 @@ Hence an @acronym{NCO} Uniform grid is equivalent to an @acronym{NCL}
 For example, a 128x256 Uniform grid is the offset or staggered version
 of a 129x256 Cap grid (aka @acronym{FV}-grid).
 
-Owing the ``cap''-points at the poles, @acronym{NCO} uses the term Cap
-grid to describe the latitude portion of the @acronym{FV}-scalar grid as
-used by the @acronym{CESM} Lin-Rood dynamics formulation.
- at acronym{NCO} treats the shorthand (and more memorable) @acronym{FV} as
-a synonym for Cap.   
+Referring the saucer-like cap-points at the poles, @acronym{NCO} uses
+the term ``Cap grid'' to describe the latitude portion of the
+ at acronym{FV}-scalar grid as used by the @acronym{CAM-FV} Lin-Rood
+dynamics formulation. 
+ at acronym{NCO} accepts the shorthand @acronym{FV}, and the more
+descriptive ``Yarmulke'', as synonyms for Cap. 
 A Cap-latitude grid differs from a Uniform-latitude grid in many ways:
+
 Most importantly, Cap grids are 2D-representations of numerical grids
 with cap-midpoints instead of zonal-teeth convergence at the poles.  
 The rectangular 2D-representation of each cap contains gridcells shaped
@@ -6136,39 +6159,138 @@ grid, and visa versa.
 
 @cindex @var{lat_nbr}
 @cindex @var{lon_nbr}
+ at cindex @samp{--rgr latlon=@var{lat_nbr}, at var{lon_nbr}}
 @cindex @samp{--rgr lon_nbr=@var{lon_nbr}}
 @cindex @samp{--rgr lat_nbr=@var{lat_nbr}}
- at item The number of gridcells in the horizontal spatial dimensions
+ at item Grid Resolution: @var{lat_nbr}, @var{lon_nbr}
+The number of gridcells in the horizontal spatial dimensions
 are @var{lat_nbr} and @var{lon_nbr}, respectively.
 There are no restrictions on @var{lon_nbr} for any gridtype.
 Latitude grids do place some restrictions on @var{lat_nbr} (see above). 
- at end enumerate
+As of @acronym{NCO} @w{version 4.5.3}, released in October, 2015,
+the @samp{--rgr latlon=@var{lat_nbr}, at var{lon_nbr}} switch may be
+used to simultaneously specify both latitude and longitude, e.g., 
+ at samp{--rgr latlon=180,360}.
+
+ at cindex @var{lat_nrt}
+ at cindex @var{lat_sth}
+ at cindex @var{lat_est}
+ at cindex @var{lat_wst}
+ at cindex @var{wesn}
+ at cindex @var{snwe}
+ at cindex @samp{--rgr wesn=@var{lon_wst}, at var{lon_est}, at var{lat_sth}, at var{lon_nrt}}
+ at cindex @samp{--rgr snwe=@var{lat_sth}, at var{lat_nrt}, at var{lon_wst}, at var{lon_est}}
+ at cindex @samp{--rgr lat_nrt=@var{lat_nrt}}
+ at cindex @samp{--rgr lat_nbr=@var{lat_nbr}}
+ at item Grid Edges: @var{lon_wst}, @var{lon_est}, @var{lat_sth}, @var{lat_nrt}
+The outer edges of a regional rectangular grid are specified by
+the North (@var{lat_nrt}), South (@var{lat_sth}), East (@var{lat_est}),
+and West (@var{lat_nrt}) sides. 
+Latitudes and longigudes must be specified in degrees (not radians).
+Latitude edges must be between @w{-90 and 90}.
+Longitude edges may be positive or negative and separated by no more
+than 360 degrees.
+The edges may be specified individually with four arguments, or together
+in one list to the options @samp{wesn} or @samp{snwe}.
+These two specifications are equivalent:
+ at example
+ at verbatim
+ncks ... --rgr lat_sth=30.0 --rgr lat_nrt=70.0 --rgr lon_wst=-120.0 --rgr lon_est=-90.0 ...
+ncks ... --rgr snwe=30.0,70.0,-120.0,-90.0 ...
+ at end verbatim
+ at end example
+ at end table
 
 Generating common grids:
 @example
 @verbatim
 # 180x360 (1x1 degree) Equi-Angular grid, first longitude centered at Greenwich
 ncks --rgr grd_ttl='Equi-Angular grid 180x360' --rgr grid=${DATA}/grids/180x360_SCRIP.20150901.nc \
-     --rgr lat_nbr=180 --rgr lon_nbr=360 --rgr lat_typ=rgl --rgr lon_typ=grn_ctr \
-     ~zender/nco/data/in.nc ~/foo.nc
+     --rgr latlon=180,360 --rgr lat_typ=uni --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
 
-# 129x256 FV grid, first longitude centered at Greenwich
-ncks --rgr grd_ttl='FV-scalar grid 129x256' --rgr grid=${DATA}/grids/129x256_SCRIP.20150901.nc \
-     --rgr lat_nbr=129 --rgr lon_nbr=256 --rgr lat_typ=fv --rgr lon_typ=grn_ctr \
-     ~zender/nco/data/in.nc ~/foo.nc
+# 129x256 CAM-FV grid, first longitude centered at Greenwich
+ncks --rgr grd_ttl='CAM-FV scalar grid 129x256' --rgr grid=${DATA}/grids/129x256_SCRIP.20150901.nc \
+     --rgr latlon=129,256 --rgr lat_typ=fv --rgr lon_typ=grn_ctr ~zender/nco/data/in.nc ~/foo.nc
 
 # 128x256 Equi-Angular grid, Greenwich west edge of first longitude
-# This is the FV-offset grid for the 129x256 FV grid above
+# This is the CAM-FV offset grid for the 129x256 CAM-FV scalar grid above
 ncks --rgr grd_ttl='Equi-Angular grid 128x256' --rgr grid=${DATA}/grids/128x256_SCRIP.20150901.nc \
-     --rgr lat_nbr=128 --rgr lon_nbr=256 --rgr lat_typ=rgl --rgr lon_typ=grn_wst \
-     ~zender/nco/data/in.nc ~/foo.nc
+     --rgr latlon=128,256 --rgr lat_typ=uni --rgr lon_typ=grn_wst ~zender/nco/data/in.nc ~/foo.nc
 
 # T42 Gaussian grid, first longitude centered at Greenwich
 ncks --rgr grd_ttl='T42 Gaussian grid' --rgr grid=${DATA}/grids/t42_SCRIP.20150901.nc \
-     --rgr lat_nbr=64 --rgr lon_nbr=128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr \
+     --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr ~zender/nco/data/in.nc ~/foo.nc
+ at end verbatim
+ at end example
+
+ at html
+<a name="nfr"></a> <!-- http://nco.sf.net/nco.html#nfr -->
+<a name="infer"></a> <!-- http://nco.sf.net/nco.html#infer -->
+ at end html
+ at cindex infer
+ at cindex @code{--rgr nfr}
+Often researchers face the problem not of generating a known, idealized
+grid but of understanding an unknown, possibly irregular or curvilinear
+grid underlying a dataset produced elsewhere.
+ at acronym{NCO} will @dfn{infer} the grid of a datafile by examining its
+coordinates (and boundaries, if available), reformat that information
+as necessary to diagnose gridcell areas, and output the results in
+ at acronym{SCRIP} format.
+As of @acronym{NCO} @w{version 4.5.3}, released in October, 2015,
+the @samp{--rgr nfr='y'} switch activates the machinery to infer the grid
+rather than construct the grid from other user-specified switches.
+To infer the grid properties, @acronym{NCO} interrogates
+ at var{input-file} for horizontal coordinate information, such as the
+presence of dimension names rooted in latitude/longitude-naming
+traditions and conventions. 
+Once @acronym{NCO} identifies the likely horizontal dimensions it looks
+for horizontal coordinates and bounds.
+If bounds are not found, @acronym{NCO} assumes the underlying grid
+comprises quadrilateral cells whose edges are midway between cell
+centers, for both rectilinear and curvilinear grids. 
+ at example
+ at verbatim
+# Infer the grid of the AIRS swath from input, write it to grd_airs.nc
+ncks --rgr nfr=y --rgr grid=${DATA}/sld/rgr/grd_airs.nc \
+     ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.nc ~/foo.nc
+ at end verbatim
+ at end example
+When inferring grids, the grid file (@file{grd_airs.nc}) is written,
+the input file (@file{AIRS...nc}) is read, and the output file
+(@file{foo.nc}) is overwritten (its contents are immaterial).
+
+ at html
+<a name="skl"></a> <!-- http://nco.sf.net/nco.html#skl -->
+<a name="skeleton"></a> <!-- http://nco.sf.net/nco.html#skeleton -->
+ at end html
+ at cindex skeleton
+ at cindex @code{--rgr skl}
+Another task that arises in regridding is characterizing new grids.
+In such cases it can be helpful to have a ``skeleton'' version of a
+dataset on the grid, so that grid center and interfaces locations can be
+assessed, continental outlines can be examined, or the skeleton can be
+manually populated with data rather than relying on a model.
+ at acronym{SCRIP} files can be difficult to visualize and manipulate, so 
+ at acronym{NCO} will provide, if requested, a so-called skeleton file on
+the user-specified grid.
+As of @acronym{NCO} @w{version 4.5.3}, released in October, 2015,
+the @samp{--rgr skl=@var{fl_skl}} switch outputs the skeleton file to
+ at var{fl_skl}.
+The skeleton file may then be examined in a dataset viewer, populated
+with data, and generally serve as a template for what to expect from
+datasets of the same geometry.
+ at example
+ at verbatim
+# Generate T42 Gaussian grid file t42_SCRIP.nc and skeleton file t42_skl.nc
+ncks --rgr skl=${DATA}/grids/t42_skl.nc --rgr grid=${DATA}/grids/t42_SCRIP.nc \
+     --rgr latlon=64,128 --rgr lat_typ=gss --rgr lon_typ=Grn_ctr \
      ~zender/nco/data/in.nc ~/foo.nc
 @end verbatim
 @end example
+When generating skeleton files, both the grid file (@file{t42_SCRIP.nc})
+and the skeleton file (@file{t42_skl.nc}) are written, the input file
+(@file{in.nc}) is ignored, and the output file (@file{foo.nc}) is
+overwritten (its contents are immaterial). 
 
 @html
 <a name="map"></a> <!-- http://nco.sf.net/nco.html#map -->
@@ -6259,6 +6381,11 @@ regionally refined grids.
 Support for irregular 2D- and regional grids (e.g., swath-like data) is
 planned.  
 
+ at html
+<a name="rnr"></a> <!-- http://nco.sf.net/nco.html#rnr -->
+<a name="renormalize"></a> <!-- http://nco.sf.net/nco.html#renormalize -->
+<a name="rgr_rnr"></a> <!-- http://nco.sf.net/nco.html#rgr_rnr -->
+ at end html
 @cindex conservative regridding
 @cindex renormalized regridding
 @cindex missing values
@@ -6330,12 +6457,13 @@ algorithm.
 @acronym{NCO} automatically annotates the output with relevant metadata
 such as coordinate bounds, axes, and vertices (@w{@`{a} la} @acronym{CF}). 
 These annotations include
- at enumerate
+ at table @dfn
 @cindex @var{lat_nm}
 @cindex @var{lon_nm}
- at cindex @samp{--rgr lon=@var{lon_nm}}
- at cindex @samp{--rgr lat=@var{lat_nm}}
- at item The name of the horizontal spatial dimensions assumed to represent
+ at cindex @samp{--rgr lon_nm=@var{lon_nm}}
+ at cindex @samp{--rgr lat_nm=@var{lat_nm}}
+ at item Horizontal Dimension Names: @var{lat}, @var{lon}
+    The name of the horizontal spatial dimensions assumed to represent
     latitude and longitude in 2D rectangular input files are
     @var{lat_nm} and @var{lon_nm}, which default to @code{lat} and
     @code{lon}, respectively.  
@@ -6346,23 +6474,27 @@ These annotations include
     and variables regridded to a 1D-unstructured output grid will have
     @var{lat_nm} and @var{lon_nm} as auxiliary coordinate variables.
     To treat different dimensions and variables as latitude and
-    longitude, use the options @samp{--rgr lat=@var{lat_nm}} and 
-    @samp{--rgr lon=@var{lon_nm}}.  
+    longitude, use the options @samp{--rgr lat_nm=@var{lat_nm}} and 
+    @samp{--rgr lon_nm=@var{lon_nm}}.  
     Note that, for now at least, @var{lat_nm} and @var{lon_nm} indicate
     both the variable names associated @emph{and}, where applicable
     (i.e., on 2D-grids), the dimensions of the horizontal coordinates.
 @cindex @code{ncol}
 @cindex @var{col_nm}
- at cindex @samp{--rgr col=@var{col_nm}}
- at item The name of the horizontal spatial dimension assumed to delineate
+ at cindex @samp{--rgr col_nm=@var{col_nm}}
+ at item Unstructured Dimension Name: @var{col}
+    The name of the horizontal spatial dimension assumed to delineate
     an unstructured grid is @var{col_nm}, which defaults to @code{ncol}
-    (number of columns).
+    (number of columns), the name @acronym{CAM} employs.
+    Other common names for the columns in an unstructured grid include
+    @code{lndgrid} (used by @acronym{CLM}), and @code{nCells} (used by 
+    @acronym{MPAS-O}). 
     Variables that contain the @var{col_nm}-dimension on an
     unstructured input grid will be regridded, and regridded variables
     written to an unstructured output grid will all contain the 
     @var{col_nm}-dimension.
     To treat a different dimension as unstructured, use the option
-    @samp{--rgr col=@var{col_nm}}. 
+    @samp{--rgr col_nm=@var{col_nm}}. 
     Note: Often there is no coordinate variable for the
     @var{col_nm}-dimension, i.e., there is no variable named
     @var{col_nm}, although such a coordinate could contain useful
@@ -6378,7 +6510,8 @@ These annotations include
 @cindex @code{X} axis
 @cindex @code{Y} axis
 @cindex auxiliary coordinates
- at item Longitude and latitude coordinates (both regular and auxiliary,
+ at item Structured Grid Standard Names and Units
+    Longitude and latitude coordinates (both regular and auxiliary,
     i.e., for unstructured grids) receive @acronym{CF}
     @code{standard_name} values of @code{latitude} and @code{longitude},
     @acronym{CF} @code{axes} attributes with values @code{X} and
@@ -6386,7 +6519,8 @@ These annotations include
     @code{degrees_east} and @code{degrees_north}, respectively.
 @cindex @code{lat}
 @cindex @code{lon}
- at item Unstructured grid auxiliary coordinates for longitude and latitude
+ at item Unstructured Grid Auxiliary Coordinates
+    Unstructured grid auxiliary coordinates for longitude and latitude
     receive @acronym{CF} @code{coordinates} attributes with values
     @code{lon} and @code{lat}, respectively.
 @cindex @code{lon_bnds}
@@ -6395,9 +6529,10 @@ These annotations include
 @cindex @code{time_bnds}
 @cindex @var{lat_bnd_nm}
 @cindex @var{lon_bnd_nm}
- at cindex @samp{--rgr lat_bnd=@var{lat_bnd_nm}}
- at cindex @samp{--rgr lon_bnd=@var{lon_bnd_nm}}
- at item Structured grids with 1D-coordinates use the dimension
+ at cindex @samp{--rgr lat_bnd_nm=@var{lat_bnd_nm}}
+ at cindex @samp{--rgr lon_bnd_nm=@var{lon_bnd_nm}}
+ at item Structured Grid Bounds Variables: @var{bnd}, @var{lat_bnd}, @var{lon_bnd}
+    Structured grids with 1D-coordinates use the dimension
     @var{bnd_nm} (which defaults to @code{nbnd}) with the spatial bounds
     variables in @var{lat_bnd_nm} and @var{lon_bnd_nm} which default to
     @code{lon_bnds} and @code{lat_bnds}, respectively.
@@ -6407,15 +6542,16 @@ These annotations include
     Bounds are attached to the horizontal spatial dimensions via their
     @code{bounds} attributes. 
     Change the spatial bounds dimension with the option 
-    @samp{--rgr bnd=@var{bnd_nm}}.
+    @samp{--rgr bnd_nm=@var{bnd_nm}}.
     Rename the spatial bounds variables with the options 
-    @samp{--rgr lat_bnd=@var{lat_bnd_nm}} and 
-    @samp{--rgr lon_bnd=@var{lon_bnd_nm}}.
+    @samp{--rgr lat_bnd_nm=@var{lat_bnd_nm}} and 
+    @samp{--rgr lon_bnd_nm=@var{lon_bnd_nm}}.
 @cindex @code{lat_vertices}
 @cindex @code{lon_vertices}
 @cindex @code{nv}
 @cindex @code{bounds}
- at item Unstructured grids with 1D-coordinates use the dimension
+ at item Unstructured Grid Bounds Variables: @var{bnd}, @var{lat_bnd}, @var{lon_bnd} 
+    Unstructured grids with 1D-coordinates use the dimension
     @var{bnd_nm} (which defaults to @code{nv}, number of vertices) 
     for the spatial bounds variables @var{lat_bnd_nm} and
     @var{lon_bnd_nm} which default to @code{lat_vertices} and
@@ -6427,22 +6563,23 @@ These annotations include
     These bounds are attached to the horizontal spatial dimensions
     via their @code{bounds} attributes.
     Change the spatial bounds dimension with the option 
-    @samp{--rgr bnd=@var{bnd_nm}}.
+    @samp{--rgr bnd_nm=@var{bnd_nm}}.
     Rename the spatial bounds variables with the options 
-    @samp{--rgr lat_bnd=@var{lat_bnd_nm}} and
-    @samp{--rgr lon_bnd=@var{lon_bnd_nm}}.
+    @samp{--rgr lat_bnd_nm=@var{lat_bnd_nm}} and
+    @samp{--rgr lon_bnd_nm=@var{lon_bnd_nm}}.
     The temporal bounds dimension in unstructured grid output remains as
     in the @var{input-file}, usually @code{nbnd}.
 @cindex @code{area}
 @cindex @code{cell_methods}
 @cindex @code{cell_area}
 @cindex @code{steradian}
- at cindex @samp{--rgr area=@var{area_nm}}
+ at cindex @samp{--rgr area_nm=@var{area_nm}}
 @cindex @var{area_nm}
 @cindex @acronym{SI}
 @cindex solid angle
 @cindex extensive variable
- at item The variable @var{area_nm} (which defaults to @code{area}) is
+ at item Gridcell Area: @var{area}
+    The variable @var{area_nm} (which defaults to @code{area}) is
     always (re-)created in the @var{output_file} to hold the gridcell
     area in steradians.     
     To store the area in a different variable, use the option
@@ -6455,28 +6592,50 @@ These annotations include
     that its value depends on the gridcell boundaries.  
     Since @var{area_nm} is a property of the grid, it is read directly
     from the @var{map-file} rather than regridded itself. 
+ at cindex @code{frc}
+ at cindex @samp{--rgr frc_nm=@var{frc_nm}}
+ at cindex @var{frc_nm}
+ at cindex extensive variable
+ at item Gridcell Fraction: @var{frc}
+    The variable @var{frc_nm} (which defaults to @code{frac_b}) is
+    automatically copied to the @var{output_file} to hold the valid
+    fraction of each gridcell when certain conditions are met.
+    First, the regridding method must be conservative.
+    Second, at least one value of @var{frc_nm} must be non-unity.
+    These conditions ensure that whenever fractional gridcells affect
+    the regridding, they are also placed in the output file.
+    To store the fraction in a different variable, use the option
+    @samp{--rgr frc_nm=@var{frc_nm}}.
+    The @var{frc_nm} variable receives a @code{cell_methods} attribute
+    with value @code{lat, lon: sum}, which indicates that @var{frc_nm}
+    is @dfn{extensive}, meaning that its value depends on the gridcell
+    boundaries.   
+    Since @var{frc_nm} is a property of the grid, it is read directly
+    from the @var{map-file} rather than regridded itself. 
 @cindex @code{gw}
 @cindex @samp{--rgr lat_weight=@var{lat_wgt_nm}}
 @cindex @var{lat_wgt_nm}
 @cindex Gaussian weight
- at item Rectangular 2D-grids use the variable @var{lat_wgt_nm}, which
+ at item Latitude weights: @var{lat_wgt}
+    Rectangular 2D-grids use the variable @var{lat_wgt_nm}, which
     defaults to @code{gw} (originally for ``Gaussian weight''), to store 
     the 1D-weight appropriate for area-weighting the latitude grid.
     To store the latitude weight in a different variable, use the option
     @samp{--rgr lat_wgt=@var{lat_wgt_nm}}.
     The @var{lat_wgt_nm} variable will not appear in 1D-grid output.
-    Weighting statistics by latitude (i.e., by @var{lat_wgt_nm}will
+    Weighting statistics by latitude (i.e., by @var{lat_wgt_nm} will
     produce the same answers (up-to round-off error) as weighting by
-    area (i.e., by @var{area_nm}) in grids which have both variables.
+    area (i.e., by @var{area_nm}) in grids that have both variables.
     The former requires less memory because @var{lat_wgt_nm} is 1D), 
     whereas the latter is more general because @var{area_nm} works on
     @emph{any} grid.
 @cindex @code{mapping_file}
 @cindex @code{source_file}
- at item The @var{map-file} and @var{input-file} names are stored in the
+ at item Provenance Attributes
+    The @var{map-file} and @var{input-file} names are stored in the
     @var{output-file} global attributes @code{mapping_file} and
     @code{source_file}, respectively.
- at end enumerate
+ at end table
 
 One may supply muliple @samp{--rgr @var{key}=@var{value}} options
 to simultaneously customize multiple grid-field names.
@@ -6484,10 +6643,10 @@ The following examples may all be assumed to end with the standard
 options @samp{--map=map.nc in.nc out.nc}.
 @example
 @verbatim
-ncks --rgr lat=latitude --rgr lon=longitude
-ncks --rgr col=column --rgr lat_wgt=lat_wgt
-ncks --rgr bnd=bounds --rgr lat_bnd=lat_bounds --rgr lon_bnd=lon_bounds
-ncks --rgr bnd=vertices --rgr lat_bnd=lat_vrt --rgr lon_bnd=lon_vrt
+ncks --rgr lat_nm=latitude --rgr lon_nm=longitude
+ncks --rgr col_nm=column --rgr lat_wgt=lat_wgt
+ncks --rgr bnd_nm=bounds --rgr lat_bnd_nm=lat_bounds --rgr lon_bnd_nm=lon_bounds
+ncks --rgr bnd_nm=vertices --rgr lat_bnd_nm=lat_vrt --rgr lon_bnd_nm=lon_vrt
 @end verbatim
 @end example
 The first command causes the regridder to associate the latitude and
@@ -7670,9 +7829,9 @@ The other @acronym{PPC} algorithm preserves the number of
 @dfn{Decimal Significant Digits} (@acronym{DSD}), i.e., the number of
 significant digits following (positive, by convention) or preceding
 (negative) the decimal point.  
-For example, ``0.008'' and ``800'' have, respectively, three and
+For example, @samp{0.008} and @samp{800} have, respectively, three and 
 negative two digits digits following the decimal point, corresponding 
- at math{@var{dsd=3}} and @math{@var{dsd=-2}}. 
+to @math{@var{dsd=3}} and @math{@var{dsd=-2}}. 
 
 The only justifiable @acronym{NSD} for a given value depends on 
 intrinsic accuracy and error characteristics of the model or
@@ -7735,7 +7894,7 @@ when more precision is requested.
 @cindex bitmask
 @cindex significand
 @cindex @w{@acronym{IEEE} 754}
-The time penalty for compressing and uncompressing data varies according 
+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.
@@ -7866,9 +8025,9 @@ However, always zeroing the non-significant bits results in quantized
 numbers that never exceed the exact number.
 This would produce a negative bias in statistical quantities (e.g., the
 average) subsequently derived from the quantized numbers. 
-To avoid this bias, @acronym{NSD} rounds non-significant bits down (to
-zero) or up (to one) in an alternating fashion when processing array
-data.
+To avoid this bias, our @acronym{NSD} implementation rounds
+non-significant bits down (to zero) or up (to one) in an alternating
+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.
@@ -8041,7 +8200,8 @@ $$
 \pslmax = {\rm max}(\xxx_{\idx} - \qqq_{\idx})\qquad\hbox{and}\qquad
 \pslmin = {\rm min}(\xxx_{\idx} - \qqq_{\idx})
 $$
-while the maximum and minimum absolute errors $\pslmabs$ are positive-definite.
+while the maximum and minimum absolute errors $\pslmabs$ and $\pslmibs$
+are positive-definite. 
 $$
 \pslmabs = {\rm max}|\xxx_{\idx} - \qqq_{\idx}| = {\rm max}(|\pslmax|,|\pslmin|)
 $$
@@ -18547,7 +18707,7 @@ Unforunately while this bug and the related coordinate renaming bug
 were fixed in 4.3.1-rc5 (released in December, 2013), a new and related
 bug was discovered in October 2014.
 
-Another netCDF bug that causes unintended side-effects with
+Another netCDF4 bug that causes unintended side-effects with
 @command{ncrename} affects (at least) versions 4.3.1--4.3.2 and all 
 snapshots of the netCDF4 library until January, 2015.
 This bug (fixed in 4.3.3 in February, 2015) corrupts values or renamed
@@ -18572,10 +18732,11 @@ version 4.3.3 or later, or convert the file to netCDF3 first, then
 rename as intended, then convert back.  
 This bug does not affect renaming of groups or of attributes.
 
-The final netCDF bug that causes unintended side-effects with
+Yet another netCDF4 bug that causes unintended side-effects with
 @command{ncrename} affects only snapshots from January--February, 2015,
 and released version 4.3.3 (February, 2015).
-It was fixed in netCDF version 4.3.3.1 (March, 2015).
+It was fixed in (and was the reason for releasing) netCDF version
+4.3.3.1 (March, 2015). 
 This bug causes renamed attributes of coordinate variables in netCDF4 
 to files to disappear: 
 @example
@@ -18588,6 +18749,23 @@ ncks -v /g1/lon ~/foo.nc # Shows units and new_units are both gone
 As of netCDF version 4.3.3.1 (March, 2015) there are no known renaming
 bugs. 
 
+Clearly, renaming dimensions in netCDF4 files is non-trivial.
+The latest chapter in this saga is a netCDF4 bug discovered in
+September, 2015.
+This bug causes @command{ncrename} to create corrupted output files
+when attempting to rename two dimensions simultaneously.
+The workaround is to rename the dimensions sequentially, in two separate  
+ at command{ncrename} calls.
+ at example
+ at verbatim
+# Demonstate bug in netCDF4/HDF5 library netCDF-4.3.3.1
+ncrename -d y,rlat -d x,rlon dayclim_withoutpr.nc dayclim2.nc
+ncdump dayclim2.nc # File is unreadable
+ at end verbatim
+ at end example
+Yet another netCDF4 bug that causes unintended side-effects with
+ at command{ncrename} affects only snapshots from January--February, 2015,
+
 @cindex global attributes
 @cindex group attributes
 @cindex attributes, global
diff --git a/man/ncpdq.1 b/man/ncpdq.1
index 43516aa..a75641f 100644
--- a/man/ncpdq.1
+++ b/man/ncpdq.1
@@ -52,7 +52,7 @@ ncpdq [\-3] [\-4] [\-6] [\-7] [\-A] [\-a
 .IR prc ]]
 [\-R] [\-r] [\-\-ram_all] [\-t 
 .IR thr_nbr ] 
-[\--unn] [\-v 
+[\-U] [\--unn] [\-v 
 .IR var [,...]]
 [\-X 
 .IR box ] 
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index a2cb1e9..0c57568 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -1858,6 +1858,227 @@ var_sct * srt_cls::mst_fnd(bool &is_mtd, std::vector<RefAST> &args_vtr, fmc_cls
 } // end srt_cls::mst_fnd()  
 
 
+// MIN & MAX INDEX Functions /***********************************/
+  agg_idx_cls::agg_idx_cls(bool flg_dbg){
+    //Populate only on  constructor call
+    if(fmc_vtr.empty()){
+          fmc_vtr.push_back( fmc_cls("min_index" , this,PMIN)); 
+          fmc_vtr.push_back( fmc_cls("max_index" , this,PMAX)); 
+			     		      
+    }
+  }
+
+
+  var_sct *agg_idx_cls::fnd(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker){
+    const std::string fnc_nm("agg__idx_cls::fnd");
+		int fdx;
+		int nbr_args;
+		int idx;
+		int nbr_dim;
+        
+       long sz_dim=1L;
+       long my_index=0L;
+       
+		dmn_sct **dim;
+		dmn_sct **dim_nw=NULL_CEWI;  
+		var_sct *var=NULL_CEWI;
+		var_sct *var_out=NULL_CEWI;
+           
+	    std::string susg;
+	    std::string sfnm=fmc_obj.fnm();
+
+		RefAST aRef;
+		RefAST tr;
+		std::vector<RefAST> vtr_args; 
+       
+		nc_type mp_typ=NC_INT;
+		
+            
+		// de-reference 
+		prs_cls *prs_arg=walker.prs_arg;
+
+		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: var_out="+sfnm+"(var_in)";
+
+		if(nbr_args==0)
+			err_prn(sfnm, " Function has been called with no arguments\n"+susg); 
+
+
+		var=walker.out(vtr_args[0]);
+		
+
+
+
+    
+
+	if(prs_arg->ntl_scn)
+	{		
+	   if(var->undefined )
+		{
+		  var_out=ncap_var_udf("~dot_methods");
+		}   		
+		else
+		{	
+       // create empty var to return
+       var_out=ncap_sclr_var_mk("~agg_idx_cls at methods",mp_typ,false);          
+	    var_out->sz=var->nbr_dim;
+		}
+       nco_var_free(var);
+	   return var_out; 
+	}
+		
+    nbr_dim=var->nbr_dim;       
+	// create return attribute/var	
+	var_out=ncap_sclr_var_mk("~zz at value_list",NC_UINT64,true);          
+	ncap_att_stretch(var_out, nbr_dim); 
+    cast_void_nctype(NC_UINT64,&var_out->val); 
+
+    cast_void_nctype(var->type,&var->val);  
+    // now do heavy lifting 
+    
+    if(fdx==PMIN)
+    {    
+    
+      switch (var->type) {
+          case NC_DOUBLE: 
+            my_index=ncap_min_index<double>(var);    
+            break;  
+          case NC_FLOAT: 
+            my_index=ncap_min_index<float>(var);    
+            break;  
+          case NC_INT: 
+            my_index=ncap_min_index<nco_int>(var);    
+            break;  
+          case NC_SHORT: 
+            my_index=ncap_min_index<nco_short>(var);    
+            break;  
+          case NC_USHORT: 
+            my_index=ncap_min_index<nco_ushort>(var);    
+            break;  
+          case NC_UINT: 
+            my_index=ncap_min_index<nco_uint>(var);    
+            break;  
+          case NC_INT64: 
+            my_index=ncap_min_index<nco_int64>(var);    
+            break;  
+          case NC_UINT64: 
+            my_index=ncap_min_index<nco_uint64>(var);    
+            break;  
+          case NC_BYTE: 
+            my_index=ncap_min_index<nco_byte>(var);    
+            break;  
+          case NC_UBYTE: 
+            my_index=ncap_min_index<nco_ubyte>(var);    
+            break;  
+          case NC_CHAR: 
+            my_index=ncap_min_index<nco_char>(var);    
+            break;  
+           case NC_STRING: break; /* Do nothing */
+             
+           default: nco_dfl_case_nc_type_err(); break;
+            
+        } // end big switch
+
+    
+    }
+    
+    
+    if(fdx==PMAX)
+    {    
+      switch (var->type) {
+          case NC_DOUBLE: 
+            my_index=ncap_max_index<double>(var);    
+            break;  
+          case NC_FLOAT: 
+            my_index=ncap_max_index<float>(var);    
+            break;  
+          case NC_INT: 
+            my_index=ncap_max_index<nco_int>(var);    
+            break;  
+          case NC_SHORT: 
+            my_index=ncap_max_index<nco_short>(var);    
+            break;  
+          case NC_USHORT: 
+            my_index=ncap_max_index<nco_ushort>(var);    
+            break;  
+          case NC_UINT: 
+            my_index=ncap_max_index<nco_uint>(var);    
+            break;  
+          case NC_INT64: 
+            my_index=ncap_max_index<nco_int64>(var);    
+            break;  
+          case NC_UINT64: 
+            my_index=ncap_max_index<nco_uint64>(var);    
+            break;  
+          case NC_BYTE: 
+            my_index=ncap_max_index<nco_byte>(var);    
+            break;  
+          case NC_UBYTE: 
+            my_index=ncap_max_index<nco_ubyte>(var);    
+            break;  
+          case NC_CHAR: 
+            my_index=ncap_max_index<nco_char>(var);    
+            break;  
+           case NC_STRING: break; /* Do nothing */
+             
+           default: nco_dfl_case_nc_type_err(); break;
+            
+        } // end big switch
+    
+    }
+    
+    
+    
+   sz_dim=1L;  
+   // convert idx_min into multiple indices  
+   for(idx=0;idx<nbr_dim;idx++)
+      sz_dim*= var->cnt[idx]; 
+
+   for(idx=0; idx<nbr_dim; idx++){                   
+      sz_dim/=var->cnt[idx];
+      var_out->val.ui64p[idx]=my_index/sz_dim; 
+      my_index-=var_out->val.ui64p[idx]*sz_dim;
+    }
+
+    cast_nctype_void(NC_UINT64,&var_out->val);
+    
+    mp_typ=NC_INT;
+    #ifdef ENABLE_NETCDF4
+    { /* scope for fl_fmt temporary */
+        int fl_fmt; 
+        (void)nco_inq_format(walker.prs_arg->out_id,&fl_fmt);
+        if(fl_fmt==NC_FORMAT_NETCDF4 || fl_fmt==NC_FORMAT_NETCDF4_CLASSIC)
+            mp_typ=NC_UINT64;
+        else    
+            mp_typ=NC_INT;   
+     } /* end scope */
+
+     #endif 
+
+     if(var_out->type != mp_typ) 
+         nco_var_cnf_typ(mp_typ,var_out); 
+
+     nco_var_free(var);
+    
+    
+	    
+	return var_out;
+
+  }
 
 
 
diff --git a/src/nco++/fmc_all_cls.hh b/src/nco++/fmc_all_cls.hh
index 325ba0b..a41208c 100644
--- a/src/nco++/fmc_all_cls.hh
+++ b/src/nco++/fmc_all_cls.hh
@@ -171,6 +171,20 @@ public:
   var_sct *imap_fnd(bool &is_mtd, std::vector<RefAST> &args_vtr, fmc_cls &fmc_obj, ncoTree &walker);  
 };
 
+// min/max index functions /****************************************/
+// returns the hyperslab indices of the min or max
+
+class agg_idx_cls: public vtl_cls {
+private:
+  enum { PMIN, PMAX};
+   bool _flg_dbg;
+public:
+  agg_idx_cls(bool flg_dbg);
+  var_sct *fnd(RefAST expr, RefAST fargs,fmc_cls &fmc_obj, ncoTree &walker);
+};
+
+
+
 //Unary Function /****************************************/
 class unr_cls: public vtl_cls {
 private:
diff --git a/src/nco++/map_srt_tmp.hh b/src/nco++/map_srt_tmp.hh
index 94dd523..83c1660 100644
--- a/src/nco++/map_srt_tmp.hh
+++ b/src/nco++/map_srt_tmp.hh
@@ -107,4 +107,80 @@ T inc;
  
 }
 
+template<typename T>
+long ncap_min_index(var_sct *var)
+{
+bool bmss=false;
+long idx;
+long min_idx=0L;
+long sz=var->sz;
+    
+T* tp;    
+T tmin;
+T tmss=T(0);
+
+
+  
+tp=(T*)var->val.vp;  
+tmin=tp[0];
+ 
+if(var->has_mss_val) {
+    bmss=true;  
+    tmss=((T*)(var->mss_val.vp))[0];
+}    
+
+if(bmss)
+   for(idx=1;idx<sz;idx++) 
+      if(tp[idx]< tmin && tp[idx]!=tmss ) { min_idx=idx; tmin=tp[idx]; }
+
+ 
+if(!bmss)
+   for(idx=1;idx<sz;idx++) 
+      if(tp[idx]< tmin ) { min_idx=idx; tmin=tp[idx]; }
+
+
+return min_idx;   
+}
+
+template<typename T>
+long ncap_max_index(var_sct *var)
+{
+bool bmss=false;
+long idx;
+long max_idx=0L;
+long sz=var->sz;
+    
+T* tp;    
+T tmax;
+T tmss=T(0);
+
+  
+tp=(T*)var->val.vp;  
+tmax=tp[0];
+ 
+if(var->has_mss_val) {
+    bmss=true;  
+    tmss=((T*)(var->mss_val.vp))[0];
+}    
+
+if(bmss)
+   for(idx=1;idx<sz;idx++) 
+      if(tp[idx] > tmax && tp[idx]!=tmss ) { max_idx=idx; tmax=tp[idx]; }
+
+ 
+if(!bmss)
+   for(idx=1;idx<sz;idx++) 
+      if(tp[idx] >tmax ) { max_idx=idx; tmax=tp[idx]; }
+
+
+return max_idx;   
+}
+
+
+
+
+
+
+
+
 #endif
diff --git a/src/nco++/ncap2.cc b/src/nco++/ncap2.cc
index 8583784..8e5bdda 100644
--- a/src/nco++/ncap2.cc
+++ b/src/nco++/ncap2.cc
@@ -516,6 +516,8 @@ main(int argc,char **argv)
   cnv_cls cnv_obj(true);
   // Aggregate functions
   agg_cls agg_obj(true);
+    // Aggregate  index functions
+  agg_idx_cls agg_idx_obj(true);
   // Utility Functions 
   utl_cls utl_obj(true);
   // Maths Functions
@@ -546,6 +548,7 @@ main(int argc,char **argv)
   // Populate vector
   (void)pop_fmc_vtr(fmc_vtr,&cnv_obj);
   (void)pop_fmc_vtr(fmc_vtr,&agg_obj);
+  (void)pop_fmc_vtr(fmc_vtr,&agg_idx_obj);
   (void)pop_fmc_vtr(fmc_vtr,&utl_obj);
   (void)pop_fmc_vtr(fmc_vtr,&mth_obj);
   (void)pop_fmc_vtr(fmc_vtr,&mth2_obj);
@@ -1040,6 +1043,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL_CEWI) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
     if(lmt_nbr > 0) lmt=nco_lmt_lst_free(lmt,lmt_nbr);
diff --git a/src/nco++/ncap2_utl.cc b/src/nco++/ncap2_utl.cc
index f5c1a81..f32e5c7 100644
--- a/src/nco++/ncap2_utl.cc
+++ b/src/nco++/ncap2_utl.cc
@@ -1601,7 +1601,12 @@ ncap_var_var_op   /* [fnc] Add two variables */
     // and second operand is a var
     if( (var1->nm[0]=='~') && (var2->nm[0]!='~') ){
       swp_nm=var1->nm; var1->nm=var2->nm; var2->nm=swp_nm; 
-    }  
+    }
+
+    // force var1 & var2 share the same missing value   
+    // nb this function is expensive 
+    nco_mss_val_cnf(var1,var2); 
+  
     // var & att
   }else  if( !vb1 && vb2 ){ 
     var2=nco_var_cnf_typ(var1->type,var2);
@@ -1855,7 +1860,7 @@ ncap_var_var_inc   /* [fnc] Add two variables */
 }
 
 bool            /* O [flg] true if all var elemenst are true */
-ncap_var_lgcl   /* [fnc] calculate a aggregate bool value from a variable */
+ncap_var_lgcl1   /* [fnc] calculate a aggregate bool value from a variable */
 (var_sct* var)  /* I [sct] input variable */
 {
   int idx;
@@ -1889,6 +1894,141 @@ ncap_var_lgcl   /* [fnc] calculate a aggregate bool value from a variable */
   return bret;
 }
 
+bool            /* O [flg] true if all var elemenst are true */
+ncap_var_lgcl   /* [fnc] calculate a aggregate bool value from a variable */
+(var_sct* var)  /* I [sct] input variable */
+{
+  int idx=0;;
+  int sz;
+  nc_type type;
+  bool bret=true;
+  ptr_unn op1;
+  
+  type=var->type;
+  sz = var->sz;
+  op1=var->val;
+  /* Typecast pointer to values before access */
+  (void)cast_void_nctype(type,&op1);
+  if(var->has_mss_val) (void)cast_void_nctype(type,&var->mss_val);
+  
+
+  if(!var->has_mss_val){
+  
+    switch(type){
+    case NC_FLOAT:
+      for(idx=0;idx<sz;idx++) if(!op1.fp[idx]) break;
+      break;
+    case NC_DOUBLE:
+      for(idx=0;idx<sz;idx++) if(!op1.dp[idx]) break;
+      break;
+    case NC_INT:
+      for(idx=0;idx<sz;idx++) if(!op1.ip[idx]) break;
+      break;
+    case NC_SHORT:
+      for(idx=0;idx<sz;idx++) if(!op1.sp[idx]) break;
+      break;
+    case NC_USHORT:
+      for(idx=0;idx<sz;idx++) if(!op1.usp[idx]) break;
+      break;
+    case NC_UINT:
+      for(idx=0;idx<sz;idx++) if(!op1.uip[idx]) break;
+      break;
+    case NC_INT64:
+      for(idx=0;idx<sz;idx++) if(!op1.i64p[idx]) break;
+      break;
+    case NC_UINT64:
+      for(idx=0;idx<sz;idx++) if(!op1.ui64p[idx]) break;
+      break;
+    case NC_BYTE:
+      for(idx=0;idx<sz;idx++) if(!op1.bp[idx]) break;
+      break;
+    case NC_UBYTE:
+      for(idx=0;idx<sz;idx++) if(!op1.ubp[idx]) break;
+      break;
+    case NC_CHAR: break; /* Do nothing */
+    case NC_STRING: break; /* Do nothing */
+    default: nco_dfl_case_nc_type_err(); break;
+    } /* end switch */
+     
+    bret = (idx==sz) ? true: false;
+
+  } // end no missing
+
+  if(var->has_mss_val){
+ 
+    switch(type){
+    case NC_FLOAT:
+      { float mss=var->mss_val.fp[0]; 
+        for(idx=0;idx<sz;idx++) if(!op1.fp[idx] && op1.fp[idx]!=mss) break;
+      }
+      break;
+    case NC_DOUBLE:
+      { double mss=var->mss_val.dp[0]; 
+	for(idx=0;idx<sz;idx++) if(!op1.dp[idx] && op1.dp[idx]!=mss) break;
+      }  
+      break;
+    case NC_INT:
+      { nco_int mss=var->mss_val.ip[0]; 
+	for(idx=0;idx<sz;idx++) if(!op1.ip[idx] && op1.ip[idx]!=mss ) break;
+      } 
+      break;
+    case NC_SHORT:
+      { short mss=var->mss_val.sp[0]; 
+	for(idx=0;idx<sz;idx++) if(!op1.sp[idx] && op1.sp[idx]!=mss ) break;
+      } 
+      break;
+    case NC_USHORT:
+      { nco_ushort mss=var->mss_val.usp[0];  
+	for(idx=0;idx<sz;idx++) if(!op1.usp[idx]&& op1.usp[idx]!=mss) break;
+      }
+      break;
+    case NC_UINT:
+      { nco_uint mss=var->mss_val.uip[0];  
+	for(idx=0;idx<sz;idx++) if(!op1.uip[idx] && op1.uip[idx]!=mss) break;
+      } 
+      break;
+    case NC_INT64:
+      { nco_int64 mss=var->mss_val.i64p[0];  
+	for(idx=0;idx<sz;idx++) if(!op1.i64p[idx] && op1.i64p[idx]!=mss) break;
+      } 
+      break;
+    case NC_UINT64:
+      { nco_uint64  mss=var->mss_val.i64p[0];  
+	for(idx=0;idx<sz;idx++) if(!op1.ui64p[idx] && op1.ui64p[idx]!=mss) break;
+      }
+      break;
+    case NC_BYTE:
+      { nco_byte mss=var->mss_val.bp[0];  
+	for(idx=0;idx<sz;idx++) if(!op1.bp[idx] && op1.bp[idx]!=mss ) break;
+      } 
+      break;
+    case NC_UBYTE:
+      { nco_ubyte mss=var->mss_val.ubp[0];  
+        for(idx=0;idx<sz;idx++) if(!op1.ubp[idx] && op1.ubp[idx]!=mss) break;
+      }  
+      break;
+    case NC_CHAR: break; /* Do nothing */
+    case NC_STRING: break; /* Do nothing */
+    default: nco_dfl_case_nc_type_err(); break;
+    } /* end switch */
+     
+    bret = (idx==sz) ? true: false;
+
+  } // end missing
+
+
+ if(var->has_mss_val) 
+    (void)cast_nctype_void(type,&var->mss_val);
+
+ (void)cast_void_nctype(type,&op1);
+  
+  
+  return bret;
+}
+
+
+
+
 var_sct* /* O [sct] casting variable has its own private dims */ 
 ncap_cst_mk  /* [fnc] create casting var from a list of dims */
 (std::vector<std::string> &str_vtr,  /* I [sng] list of dimension subscripts */
diff --git a/src/nco++/ncoGrammer.g b/src/nco++/ncoGrammer.g
index b0c675f..a3cfc12 100644
--- a/src/nco++/ncoGrammer.g
+++ b/src/nco++/ncoGrammer.g
@@ -266,7 +266,7 @@ expr:   ass_expr
         
     
 primary_exp
-    : FLOAT    
+    : FLOAT
     | DOUBLE
     | INT
     | BYTE
@@ -741,21 +741,123 @@ vector<ast_lmt_sct> &ast_lmt_vtr)
      return nbr_dmn;
 } 
 
-int 
+bool
+lmt_var_mk(
+int nbr_dmn,
+RefAST lmt,
+NcapVector<lmt_sct*> &lmt_vtr ) 
+{
+	int idx;
+	int jdx;
+	int sz;   
+    int dmn_sz;     
+    ptr_unn op1;
+	var_sct *var;
+	std::string fnc_nm="lmt_var_mk"; 
+	
+	
+	// calculate variables
+	var=out(lmt->getFirstChild()->getFirstChild());
+	// convert result to type int
+	var=nco_var_cnf_typ(NC_UINT64,var);    
+	(void)cast_void_nctype((nc_type)NC_UINT64,&var->val);
+	sz=var->sz;
+	dmn_sz=var->sz / nbr_dmn;
+	
+    
+
+    // shape of var must be (nbr_dmn) or (nbr_dmn,2) or (nbr_dmn,3) 
+    if( dmn_sz * nbr_dmn != sz )
+	{
+	  var=nco_var_free(var);
+      return false;  
+    }
+
+    
+	
+    for(idx=0; idx<sz;idx+=dmn_sz)
+	 {
+
+		// fill out lmt structure
+		// use same logic as nco_lmt_prs 
+		lmt_sct* lmt_ptr=(lmt_sct*)nco_calloc((size_t)1,sizeof(lmt_sct));
+		lmt_ptr->nm=NULL;
+		//lmt_ptr->lmt_typ=-1;
+		lmt_ptr->is_usr_spc_lmt=True; /* True if any part of limit is user-specified, else False */
+		lmt_ptr->min_sng=NULL;
+		lmt_ptr->max_sng=NULL;
+		lmt_ptr->srd_sng=NULL;
+		lmt_ptr->is_usr_spc_min=False;
+		lmt_ptr->is_usr_spc_max=False;
+		/* rec_skp_ntl_spf is used for record dimension in multi-file operators */
+		lmt_ptr->rec_skp_ntl_spf=0L; /* Number of records skipped in initial superfluous files */
+
+	   
+       for(jdx=0;jdx<dmn_sz;jdx++)
+		{     
+		  
+         nco_uint64 uival= var->val.ui64p[idx+jdx];
+         switch(jdx){
+           case 0: 
+             lmt_ptr->is_usr_spc_min=True;
+             lmt_ptr->srt=uival;
+             break;
+           case 1: //end
+             lmt_ptr->is_usr_spc_max=True;
+             lmt_ptr->end=uival;
+             break;
+           case 2: //srd
+             lmt_ptr->srd_sng=strdup("~fill_in");
+             lmt_ptr->srd=uival;
+             break;			
+	       }
+
+		}
+		/* need to deal with situation where only start is defined -- ie picking only a single value */
+		if( lmt_ptr->is_usr_spc_min==True && lmt_ptr->is_usr_spc_max==False && lmt_ptr->srd_sng==NULL)
+		{
+			lmt_ptr->is_usr_spc_max=True;
+			lmt_ptr->end=lmt_ptr->srt; 
+       }    
+
+       lmt_vtr.push_back(lmt_ptr);		
+	}
+	 
+	cast_nctype_void((nc_type)NC_UINT64,&var->val);
+	var=nco_var_free(var);  
+	
+   return true;
+
+}
+
+
+
+bool 
 lmt_mk(
+int nbr_dmn,
 RefAST lmt,
 NcapVector<lmt_sct*> &lmt_vtr ) 
 {   
-int nbr_dmn;
+
 int idx;
 int jdx;
+int sz;
 lmt_sct *lmt_ptr;
 RefAST aRef;
-
 vector<ast_lmt_sct> ast_lmt_vtr;
 
+// deal with a single expression containing all indicies
+if(lmt->getNumberOfChildren()==1 && 
+   lmt->getFirstChild()->getNumberOfChildren()==1 &&
+   lmt->getFirstChild()->getFirstChild()->getType() != COLON)
+{
+   return lmt_var_mk(nbr_dmn,lmt,lmt_vtr);   ;            
+}
+
+
 // populate ast_lmt_vtr
-nbr_dmn=lmt_init(lmt,ast_lmt_vtr);
+if( nbr_dmn!=lmt_init(lmt,ast_lmt_vtr) )
+  return false;	
 
   for(idx=0 ; idx <nbr_dmn ; idx++){
 
@@ -816,7 +918,7 @@ nbr_dmn=lmt_init(lmt,ast_lmt_vtr);
     lmt_vtr.push_back(lmt_ptr);
   } // end idx
 
-   return nbr_dmn;
+   return true;;
 } /* end lmt_mk */
 
 /* Legacy run -- will remove soon
@@ -1577,7 +1679,7 @@ var=NULL_CEWI;
                   nbr_dmn=var_lhs->nbr_dim;
 
                   // Now populate lmt_vtr;
-                  if( lmt_mk(lmt_Ref,lmt_vtr) == 0)
+                  if( lmt_mk(nbr_dmn, lmt_Ref,lmt_vtr) == false)
                     err_prn(fnc_nm,"Invalid hyperslab limits for variable "+ var_nm);
                   
                  if( lmt_vtr.size() != nbr_dmn)
@@ -1638,7 +1740,7 @@ var=NULL_CEWI;
                nbr_dmn=var_lhs->nbr_dim;
 
                // Now populate lmt_vtr;
-               if( lmt_mk(lmt_Ref,lmt_vtr) == 0)
+               if( lmt_mk(nbr_dmn, lmt_Ref,lmt_vtr) == false)
                   err_prn(fnc_nm,"Invalid hyperslab limits for variable "+ var_nm);
                
                if( lmt_vtr.size() != nbr_dmn)
@@ -2103,6 +2205,18 @@ out returns [var_sct *var]
         
      // Variable with argument list 
     | (#(VAR_ID LMT_LIST)) => #( vid:VAR_ID lmt:LMT_LIST) {
+		
+		    // fxm: 4 Oct 2015
+			/*
+			  the following is valid syntx var_nm(array_var)-
+			  array_var now contains all the indices - that is 
+			  srt vectors  
+			  srt & end vectors
+			  srt,end,srd vectors
+			
+			  so for now indexing into a multi-dmensional var using a single index has
+			  temporarily been disabled
+			
            // see if hyperslab limit is a single value
            if(lmt->getNumberOfChildren()==1 && 
               lmt->getFirstChild()->getNumberOfChildren()==1 &&
@@ -2111,7 +2225,10 @@ out returns [var_sct *var]
               var=var_lmt_one(vid);
            else   
                var=var_lmt(vid);
-
+           */
+           var=var_lmt(vid);  
+     
+             
     }
 
     // plain Variable
@@ -2293,11 +2410,13 @@ NcapVar *Nvar;
           //do attribute inheritance
 
           Nvar=prs_arg->var_vtr.find(var_nm_s);
-
           if( !Nvar || Nvar->flg_stt==1 ) 
-               ncap_att_cpy(var_nm_s,var_nm_s,prs_arg);
+             ncap_att_cpy(var_nm_s,var_nm_s,prs_arg);
 
           var=prs_arg->ncap_var_init(var_nm_s,true);
+
+
+
           if(var== NULL_CEWI){
                nco_exit(EXIT_FAILURE);
           }
@@ -2742,6 +2861,7 @@ end0:       var_nbr=nco_var_free(var_nbr);
 
 //Calculate scalar LHS hyperslab where there is a single limit for a possibly
 // multi-dimensional variable
+
 var_lmt_one_lhs[bool bram] returns [var_sct *var]
 {
 const std::string fnc_nm("var_lmt_one_lhs");
@@ -2894,6 +3014,7 @@ var_sct *var_nbr;
 }
 ;
 
+
 //Calculate var with limits
 var_lmt returns [var_sct *var]
 {
@@ -2940,11 +3061,11 @@ var=NULL_CEWI;
             }
             // Temporarily change mode 
             prs_arg->ntl_scn=False;
-            lmt_mk(lRef,lmt_vtr);
+            lmt_mk(nbr_dmn,lRef,lmt_vtr);
             prs_arg->ntl_scn=True; 
 
           }else{
-            lmt_mk(lRef,lmt_vtr);
+            lmt_mk(nbr_dmn,lRef,lmt_vtr);
            }
 
          if( lmt_vtr.size() != nbr_dmn)
@@ -3139,3 +3260,8 @@ var=NULL_CEWI;
           end2: var_rhs=nco_var_free(var_rhs); 
     }
 ;
+
+
+
+
+
diff --git a/src/nco++/ncoLexer.cpp b/src/nco++/ncoLexer.cpp
index 34ea07d..315aec6 100644
--- a/src/nco++/ncoLexer.cpp
+++ b/src/nco++/ncoLexer.cpp
@@ -1,4 +1,4 @@
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoLexer.cpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoLexer.cpp"$ */
 #include "ncoLexer.hpp"
 #include <antlr/CharBuffer.hpp>
 #include <antlr/TokenStreamException.hpp>
diff --git a/src/nco++/ncoLexer.hpp b/src/nco++/ncoLexer.hpp
index 7cc4e42..17e3efb 100644
--- a/src/nco++/ncoLexer.hpp
+++ b/src/nco++/ncoLexer.hpp
@@ -2,7 +2,7 @@
 #define INC_ncoLexer_hpp_
 
 #include <antlr/config.hpp>
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoLexer.hpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoLexer.hpp"$ */
 #include <antlr/CommonToken.hpp>
 #include <antlr/InputBuffer.hpp>
 #include <antlr/BitSet.hpp>
diff --git a/src/nco++/ncoParser.cpp b/src/nco++/ncoParser.cpp
index 0ba6e0c..0fc0473 100644
--- a/src/nco++/ncoParser.cpp
+++ b/src/nco++/ncoParser.cpp
@@ -1,4 +1,4 @@
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoParser.cpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoParser.cpp"$ */
 #include "ncoParser.hpp"
 #include <antlr/NoViableAltException.hpp>
 #include <antlr/SemanticException.hpp>
diff --git a/src/nco++/ncoParser.hpp b/src/nco++/ncoParser.hpp
index 5d3f6cd..548ebc4 100644
--- a/src/nco++/ncoParser.hpp
+++ b/src/nco++/ncoParser.hpp
@@ -2,7 +2,7 @@
 #define INC_ncoParser_hpp_
 
 #include <antlr/config.hpp>
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoParser.hpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoParser.hpp"$ */
 #include <antlr/TokenStream.hpp>
 #include <antlr/TokenBuffer.hpp>
 #include "ncoParserTokenTypes.hpp"
diff --git a/src/nco++/ncoParserTokenTypes.hpp b/src/nco++/ncoParserTokenTypes.hpp
index 1ef6015..de89282 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 (2006-11-01): "ncoGrammer.g" -> "ncoParserTokenTypes.hpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoParserTokenTypes.hpp"$ */
 
 #ifndef CUSTOM_API
 # define CUSTOM_API
diff --git a/src/nco++/ncoTree.cpp b/src/nco++/ncoTree.cpp
index a5c2eec..03352ab 100644
--- a/src/nco++/ncoTree.cpp
+++ b/src/nco++/ncoTree.cpp
@@ -1,4 +1,4 @@
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoTree.cpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoTree.cpp"$ */
 #include "ncoTree.hpp"
 #include <antlr/Token.hpp>
 #include <antlr/AST.hpp>
@@ -13,7 +13,7 @@ ncoTree::ncoTree()
 }
 
 int  ncoTree::lmt_peek(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 973 "ncoGrammer.g"
+#line 1079 "ncoGrammer.g"
 	int nbr_dmn=0;
 #line 19 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmt_peek_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
@@ -24,7 +24,7 @@ int  ncoTree::lmt_peek(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		match(_t,LMT_LIST);
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 975 "ncoGrammer.g"
+#line 1081 "ncoGrammer.g"
 			
 			RefAST aRef;     
 			aRef=lmt->getFirstChild();
@@ -51,7 +51,7 @@ int  ncoTree::lmt_peek(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 986 "ncoGrammer.g"
+#line 1092 "ncoGrammer.g"
 	int iret=0;
 #line 57 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST statements_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
@@ -72,7 +72,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	ANTLR_USE_NAMESPACE(antlr)RefAST pvid = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST patt = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST pstr = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 986 "ncoGrammer.g"
+#line 1092 "ncoGrammer.g"
 	
 	var_sct *var=NULL;
 	var_sct *var2=NULL;
@@ -94,7 +94,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,BLOCK);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 996 "ncoGrammer.g"
+#line 1102 "ncoGrammer.g"
 				
 				//std::cout <<"Num of Children in block="<<blk->getNumberOfChildren()<<endl;
 				iret=run_exe(blk->getFirstChild(),lpp_vtr.size() );
@@ -116,7 +116,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t221;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1002 "ncoGrammer.g"
+#line 1108 "ncoGrammer.g"
 				
 				RefAST tr;
 				RefAST ntr;  
@@ -153,7 +153,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t222;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1026 "ncoGrammer.g"
+#line 1132 "ncoGrammer.g"
 				
 				
 				var=out(fss);
@@ -179,7 +179,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t223;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1034 "ncoGrammer.g"
+#line 1140 "ncoGrammer.g"
 				
 				//if can have only 3 or 4 parts  , 1 node and 2 or 3 siblings
 				// IF LOGICAL_EXP STATEMENT1 STATEMENT2
@@ -227,7 +227,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t224;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1064 "ncoGrammer.g"
+#line 1170 "ncoGrammer.g"
 				
 				// convert mask to short 
 				RefAST tr; 
@@ -290,7 +290,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t225;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1108 "ncoGrammer.g"
+#line 1214 "ncoGrammer.g"
 				
 				
 				bool br;
@@ -344,7 +344,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t226;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1137 "ncoGrammer.g"
+#line 1243 "ncoGrammer.g"
 				
 				bool b1,b2,b3,br;
 				var_sct *var_f1;
@@ -405,7 +405,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,ELSE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1188 "ncoGrammer.g"
+#line 1294 "ncoGrammer.g"
 				iret=ELSE;
 #line 411 "ncoTree.cpp"
 			}
@@ -417,7 +417,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,BREAK);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1189 "ncoGrammer.g"
+#line 1295 "ncoGrammer.g"
 				iret=BREAK;
 #line 423 "ncoTree.cpp"
 			}
@@ -429,7 +429,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,CONTINUE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1190 "ncoGrammer.g"
+#line 1296 "ncoGrammer.g"
 				iret=CONTINUE;
 #line 435 "ncoTree.cpp"
 			}
@@ -441,7 +441,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NULL_NODE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1191 "ncoGrammer.g"
+#line 1297 "ncoGrammer.g"
 				iret=NULL_NODE;
 #line 447 "ncoTree.cpp"
 			}
@@ -527,7 +527,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t227;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1193 "ncoGrammer.g"
+#line 1299 "ncoGrammer.g"
 				
 				
 				bool bunlimited=false;      
@@ -610,7 +610,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				_t = __t232;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1235 "ncoGrammer.g"
+#line 1341 "ncoGrammer.g"
 					
 					
 					int var_id;
@@ -699,7 +699,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 					_t = __t236;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1282 "ncoGrammer.g"
+#line 1388 "ncoGrammer.g"
 						
 						
 						int apsn;
@@ -795,7 +795,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 						_t = __t240;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1337 "ncoGrammer.g"
+#line 1443 "ncoGrammer.g"
 							
 							char *prn_sng;
 							
@@ -829,7 +829,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 1891 "ncoGrammer.g"
+#line 1997 "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;
@@ -863,7 +863,7 @@ 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 1891 "ncoGrammer.g"
+#line 1997 "ncoGrammer.g"
 	
 	const std::string fnc_nm("out"); 
 		var_sct *var1;
@@ -889,7 +889,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t308;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1918 "ncoGrammer.g"
+#line 2024 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, TIMES );
 #line 895 "ncoTree.cpp"
 			}
@@ -908,7 +908,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t309;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1921 "ncoGrammer.g"
+#line 2027 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, DIVIDE );
 #line 914 "ncoTree.cpp"
 			}
@@ -927,7 +927,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t310;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1923 "ncoGrammer.g"
+#line 2029 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, MOD);
 #line 933 "ncoTree.cpp"
 			}
@@ -946,7 +946,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t311;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1925 "ncoGrammer.g"
+#line 2031 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, CARET);
 #line 952 "ncoTree.cpp"
 			}
@@ -963,7 +963,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t312;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1928 "ncoGrammer.g"
+#line 2034 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,NULL_CEWI, LNOT );
 #line 969 "ncoTree.cpp"
 			}
@@ -980,7 +980,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t315;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1934 "ncoGrammer.g"
+#line 2040 "ncoGrammer.g"
 				var=ncap_var_var_inc(var1,NULL_CEWI,INC,false,prs_arg);
 #line 986 "ncoTree.cpp"
 			}
@@ -997,7 +997,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t316;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1936 "ncoGrammer.g"
+#line 2042 "ncoGrammer.g"
 				var=ncap_var_var_inc(var1,NULL_CEWI, DEC,false,prs_arg );
 #line 1003 "ncoTree.cpp"
 			}
@@ -1014,7 +1014,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t317;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1938 "ncoGrammer.g"
+#line 2044 "ncoGrammer.g"
 				
 				var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,false,prs_arg);
 				
@@ -1033,7 +1033,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t318;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1941 "ncoGrammer.g"
+#line 2047 "ncoGrammer.g"
 				
 				var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,false,prs_arg);
 				
@@ -1054,7 +1054,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t319;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1946 "ncoGrammer.g"
+#line 2052 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LAND );
 #line 1060 "ncoTree.cpp"
 			}
@@ -1073,7 +1073,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t320;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1948 "ncoGrammer.g"
+#line 2054 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LOR );
 #line 1079 "ncoTree.cpp"
 			}
@@ -1092,7 +1092,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t321;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1951 "ncoGrammer.g"
+#line 2057 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LTHAN );
 #line 1098 "ncoTree.cpp"
 			}
@@ -1111,7 +1111,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t322;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1953 "ncoGrammer.g"
+#line 2059 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GTHAN );
 #line 1117 "ncoTree.cpp"
 			}
@@ -1130,7 +1130,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t323;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1955 "ncoGrammer.g"
+#line 2061 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GEQ );
 #line 1136 "ncoTree.cpp"
 			}
@@ -1149,7 +1149,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t324;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1957 "ncoGrammer.g"
+#line 2063 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LEQ );
 #line 1155 "ncoTree.cpp"
 			}
@@ -1168,7 +1168,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t325;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1959 "ncoGrammer.g"
+#line 2065 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, EQ );
 #line 1174 "ncoTree.cpp"
 			}
@@ -1187,7 +1187,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t326;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1961 "ncoGrammer.g"
+#line 2067 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, NEQ );
 #line 1193 "ncoTree.cpp"
 			}
@@ -1206,7 +1206,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t327;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1964 "ncoGrammer.g"
+#line 2070 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FLTHAN );
 #line 1212 "ncoTree.cpp"
 			}
@@ -1225,7 +1225,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t328;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1966 "ncoGrammer.g"
+#line 2072 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FGTHAN );
 #line 1231 "ncoTree.cpp"
 			}
@@ -1245,7 +1245,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t329;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1968 "ncoGrammer.g"
+#line 2074 "ncoGrammer.g"
 				
 				var1=out_asn(pls_asn);
 				var=ncap_var_var_inc(var1,var2, PLUS_ASSIGN ,(pls_asn->getType()==UTIMES), prs_arg);
@@ -1268,7 +1268,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t330;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1972 "ncoGrammer.g"
+#line 2078 "ncoGrammer.g"
 				
 				var1=out_asn(min_asn);
 				var=ncap_var_var_inc(var1,var2, MINUS_ASSIGN ,(min_asn->getType()==UTIMES), prs_arg);
@@ -1291,7 +1291,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t331;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1976 "ncoGrammer.g"
+#line 2082 "ncoGrammer.g"
 				
 				var1=out_asn(tim_asn);
 				var=ncap_var_var_inc(var1,var2, TIMES_ASSIGN ,(tim_asn->getType()==UTIMES), prs_arg);
@@ -1314,7 +1314,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t332;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1980 "ncoGrammer.g"
+#line 2086 "ncoGrammer.g"
 					
 				var1=out_asn(div_asn);
 				var=ncap_var_var_inc(var1,var2, DIVIDE_ASSIGN ,(div_asn->getType()==UTIMES), prs_arg);
@@ -1335,7 +1335,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t333;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1986 "ncoGrammer.g"
+#line 2092 "ncoGrammer.g"
 				
 				// Check for RAM variable - if present 
 				// change tree - for example from:
@@ -1386,7 +1386,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t334;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2020 "ncoGrammer.g"
+#line 2126 "ncoGrammer.g"
 				
 				
 				
@@ -1408,7 +1408,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t335;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2025 "ncoGrammer.g"
+#line 2131 "ncoGrammer.g"
 				
 				bool br;
 				
@@ -1441,7 +1441,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t336;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2043 "ncoGrammer.g"
+#line 2149 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1473,7 +1473,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t337;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2054 "ncoGrammer.g"
+#line 2160 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1492,7 +1492,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,DIM_ID_SIZE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2064 "ncoGrammer.g"
+#line 2170 "ncoGrammer.g"
 				
 				string sDim=dval->getText();
 				dmn_sct *dmn_fd;
@@ -1542,7 +1542,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,ATT_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2136 "ncoGrammer.g"
+#line 2257 "ncoGrammer.g"
 				
 				
 				NcapVar *Nvar=NULL;
@@ -1582,7 +1582,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VALUE_LIST);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2167 "ncoGrammer.g"
+#line 2288 "ncoGrammer.g"
 				
 				var=value_list(vlst);
 				
@@ -1596,7 +1596,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NSTRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2172 "ncoGrammer.g"
+#line 2293 "ncoGrammer.g"
 				
 				char *tsng;
 				
@@ -1628,7 +1628,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,N4STRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2195 "ncoGrammer.g"
+#line 2316 "ncoGrammer.g"
 				
 				char *tsng;
 				
@@ -1666,7 +1666,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,FLOAT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2225 "ncoGrammer.g"
+#line 2346 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~float"),(nc_type)NC_FLOAT,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~float"),static_cast<float>(std::strtod(val_float->getText().c_str(),(char **)NULL)));
 #line 1672 "ncoTree.cpp"
 			}
@@ -1678,7 +1678,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,DOUBLE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2227 "ncoGrammer.g"
+#line 2348 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~double"),(nc_type)NC_DOUBLE,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~double"),strtod(val_double->getText().c_str(),(char **)NULL));
 #line 1684 "ncoTree.cpp"
 			}
@@ -1690,7 +1690,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,INT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2229 "ncoGrammer.g"
+#line 2350 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~int"),(nc_type)NC_INT,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~int"),static_cast<nco_int>(std::strtol(val_int->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1696 "ncoTree.cpp"
 			}
@@ -1702,7 +1702,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,SHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2231 "ncoGrammer.g"
+#line 2352 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~short"),(nc_type)NC_SHORT,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~short"),static_cast<nco_short>(std::strtol(val_short->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1708 "ncoTree.cpp"
 			}
@@ -1714,7 +1714,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,BYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2233 "ncoGrammer.g"
+#line 2354 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~byte"),(nc_type)NC_BYTE,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~byte"),static_cast<nco_byte>(std::strtol(val_byte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1720 "ncoTree.cpp"
 			}
@@ -1726,7 +1726,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,UBYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2238 "ncoGrammer.g"
+#line 2359 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~ubyte"),(nc_type)NC_UBYTE,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~ubyte"),static_cast<nco_ubyte>(std::strtoul(val_ubyte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1732 "ncoTree.cpp"
 			}
@@ -1738,7 +1738,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,USHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2242 "ncoGrammer.g"
+#line 2363 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~ushort"),(nc_type)NC_USHORT,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~ushort"),static_cast<nco_ushort>(std::strtoul(val_ushort->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1744 "ncoTree.cpp"
 			}
@@ -1750,7 +1750,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,UINT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2244 "ncoGrammer.g"
+#line 2365 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~uint"),(nc_type)NC_UINT,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~uint"),static_cast<nco_uint>(std::strtoul(val_uint->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
 #line 1756 "ncoTree.cpp"
 			}
@@ -1762,7 +1762,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,INT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2246 "ncoGrammer.g"
+#line 2367 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~int64"),(nc_type)NC_INT64,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~int64"),sng2nbr(val_int64->getText(),nco_int64_CEWI));
 #line 1768 "ncoTree.cpp"
 			}
@@ -1774,7 +1774,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,UINT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2250 "ncoGrammer.g"
+#line 2371 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(static_cast<std::string>("~uint64"),(nc_type)NC_UINT64,false); else var=ncap_sclr_var_mk(static_cast<std::string>("~uint64"),sng2nbr(val_uint64->getText(),nco_uint64_CEWI));
 #line 1780 "ncoTree.cpp"
 			}
@@ -1820,7 +1820,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				_t = __t279;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1901 "ncoGrammer.g"
+#line 2007 "ncoGrammer.g"
 					var=ncap_var_var_op(var1,var2, PLUS );
 #line 1826 "ncoTree.cpp"
 				}
@@ -1865,7 +1865,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 					_t = __t283;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1903 "ncoGrammer.g"
+#line 2009 "ncoGrammer.g"
 						var=ncap_var_var_op(var1,var2, MINUS );
 #line 1871 "ncoTree.cpp"
 					}
@@ -1918,7 +1918,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 						_t = __t288;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1904 "ncoGrammer.g"
+#line 2010 "ncoGrammer.g"
 							
 							var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,true,prs_arg);      
 							
@@ -1973,7 +1973,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 							_t = __t294;
 							_t = _t->getNextSibling();
 							if ( inputState->guessing==0 ) {
-#line 1907 "ncoGrammer.g"
+#line 2013 "ncoGrammer.g"
 								
 								var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,true,prs_arg);      
 								
@@ -2028,7 +2028,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 								_t = __t300;
 								_t = _t->getNextSibling();
 								if ( inputState->guessing==0 ) {
-#line 1910 "ncoGrammer.g"
+#line 2016 "ncoGrammer.g"
 									
 									var=ncap_var_var_inc(var1,NULL_CEWI,INC,true,prs_arg);      
 									
@@ -2083,7 +2083,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 									_t = __t306;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 1913 "ncoGrammer.g"
+#line 2019 "ncoGrammer.g"
 										
 										var=ncap_var_var_inc(var1,NULL_CEWI,DEC,true,prs_arg);      
 										
@@ -2100,7 +2100,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 									_t = __t313;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 1930 "ncoGrammer.g"
+#line 2036 "ncoGrammer.g"
 										var=ncap_var_var_op(var1,NULL_CEWI, MINUS );
 #line 2106 "ncoTree.cpp"
 									}
@@ -2153,8 +2153,20 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 										_t = __t341;
 										_t = _t->getNextSibling();
 										if ( inputState->guessing==0 ) {
-#line 2105 "ncoGrammer.g"
+#line 2211 "ncoGrammer.g"
 											
+													
+													    // fxm: 4 Oct 2015
+														/*
+														  the following is valid syntx var_nm(array_var)-
+														  array_var now contains all the indices - that is 
+														  srt vectors  
+														  srt & end vectors
+														  srt,end,srd vectors
+														
+														  so for now indexing into a multi-dmensional var using a single index has
+														  temporarily been disabled
+														
 											// see if hyperslab limit is a single value
 											if(lmt->getNumberOfChildren()==1 && 
 											lmt->getFirstChild()->getNumberOfChildren()==1 &&
@@ -2163,9 +2175,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 											var=var_lmt_one(vid);
 											else   
 											var=var_lmt(vid);
+											*/
+											var=var_lmt(vid);  
+											
 											
 											
-#line 2169 "ncoTree.cpp"
+#line 2184 "ncoTree.cpp"
 										}
 									}
 									else if ((_t->getType() == VAR_ID)) {
@@ -2173,7 +2188,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 										match(_t,VAR_ID);
 										_t = _t->getNextSibling();
 										if ( inputState->guessing==0 ) {
-#line 2119 "ncoGrammer.g"
+#line 2240 "ncoGrammer.g"
 											
 											
 											var=prs_arg->ncap_var_init(v->getText(),true);
@@ -2189,7 +2204,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 											if(bcst && var->sz >1)
 											var=ncap_cst_do(var,var_cst,prs_arg->ntl_scn);
 											
-#line 2193 "ncoTree.cpp"
+#line 2208 "ncoTree.cpp"
 										}
 									}
 		else {
@@ -2213,9 +2228,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram
 ) {
-#line 1351 "ncoGrammer.g"
+#line 1457 "ncoGrammer.g"
 	var_sct *var;
-#line 2219 "ncoTree.cpp"
+#line 2234 "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;
@@ -2225,12 +2240,12 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = 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 1351 "ncoGrammer.g"
+#line 1457 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign_ntl"); 
 	var=NULL_CEWI;
 	
-#line 2234 "ncoTree.cpp"
+#line 2249 "ncoTree.cpp"
 	
 	try {      // for error handling
 		bool synPredMatched244 = false;
@@ -2270,7 +2285,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			_t = __t245;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1356 "ncoGrammer.g"
+#line 1462 "ncoGrammer.g"
 				
 				
 				std::string var_nm; 
@@ -2299,7 +2314,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				(void)prs_arg->int_vtr.push_ow(Nvar);
 				}
 				
-#line 2303 "ncoTree.cpp"
+#line 2318 "ncoTree.cpp"
 			}
 		}
 		else {
@@ -2340,7 +2355,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				_t = __t249;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1385 "ncoGrammer.g"
+#line 1491 "ncoGrammer.g"
 					
 					
 					int idx;
@@ -2409,7 +2424,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					
 					bcst=false;   
 					
-#line 2413 "ncoTree.cpp"
+#line 2428 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -2417,7 +2432,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				match(_t,VAR_ID);
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1454 "ncoGrammer.g"
+#line 1560 "ncoGrammer.g"
 					
 					
 					std::string var_nm;
@@ -2446,7 +2461,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					//(void)ncap_var_write_omp(var1,bram,prs_arg);
 					
 					
-#line 2450 "ncoTree.cpp"
+#line 2465 "ncoTree.cpp"
 				}
 			}
 			else {
@@ -2487,11 +2502,11 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					_t = __t253;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1483 "ncoGrammer.g"
+#line 1589 "ncoGrammer.g"
 						
 						;
 						
-#line 2495 "ncoTree.cpp"
+#line 2510 "ncoTree.cpp"
 					}
 				}
 				else {
@@ -2532,11 +2547,11 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						_t = __t257;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1486 "ncoGrammer.g"
+#line 1592 "ncoGrammer.g"
 							
 							;
 							
-#line 2540 "ncoTree.cpp"
+#line 2555 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -2544,7 +2559,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1489 "ncoGrammer.g"
+#line 1595 "ncoGrammer.g"
 							
 							
 							//In Initial scan all newly defined atts are flagged as Undefined
@@ -2562,7 +2577,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							var=nco_var_dpl(var1);    
 							
 							
-#line 2566 "ncoTree.cpp"
+#line 2581 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -2586,9 +2601,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 1509 "ncoGrammer.g"
+#line 1615 "ncoGrammer.g"
 	var_sct *var;
-#line 2592 "ncoTree.cpp"
+#line 2607 "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;
@@ -2598,12 +2613,12 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = 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 1509 "ncoGrammer.g"
+#line 1615 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign"); 
 	var=NULL_CEWI;
 	
-#line 2607 "ncoTree.cpp"
+#line 2622 "ncoTree.cpp"
 	
 	try {      // for error handling
 		bool synPredMatched261 = false;
@@ -2643,7 +2658,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			_t = __t262;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1515 "ncoGrammer.g"
+#line 1621 "ncoGrammer.g"
 				
 				
 				int idx;
@@ -2709,7 +2724,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				nbr_dmn=var_lhs->nbr_dim;
 				
 				// Now populate lmt_vtr;
-				if( lmt_mk(lmt_Ref,lmt_vtr) == 0)
+				if( lmt_mk(nbr_dmn, lmt_Ref,lmt_vtr) == false)
 				err_prn(fnc_nm,"Invalid hyperslab limits for variable "+ var_nm);
 				
 				if( lmt_vtr.size() != nbr_dmn)
@@ -2770,7 +2785,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				nbr_dmn=var_lhs->nbr_dim;
 				
 				// Now populate lmt_vtr;
-				if( lmt_mk(lmt_Ref,lmt_vtr) == 0)
+				if( lmt_mk(nbr_dmn, lmt_Ref,lmt_vtr) == false)
 				err_prn(fnc_nm,"Invalid hyperslab limits for variable "+ var_nm);
 				
 				if( lmt_vtr.size() != nbr_dmn)
@@ -2839,7 +2854,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				var=prs_arg->ncap_var_init(var_nm,true);
 				
 				
-#line 2843 "ncoTree.cpp"
+#line 2858 "ncoTree.cpp"
 			}
 		}
 		else {
@@ -2880,7 +2895,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				_t = __t266;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1712 "ncoGrammer.g"
+#line 1818 "ncoGrammer.g"
 					
 					
 					var_sct *var1;
@@ -2959,7 +2974,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var_cst=nco_var_free(var_cst); 
 					
 					
-#line 2963 "ncoTree.cpp"
+#line 2978 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -2967,7 +2982,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				match(_t,VAR_ID);
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1791 "ncoGrammer.g"
+#line 1897 "ncoGrammer.g"
 					
 					// Set class wide variables
 					var_sct *var1;
@@ -3021,7 +3036,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var=prs_arg->ncap_var_init(var_nm,true);               ;
 					
 					
-#line 3025 "ncoTree.cpp"
+#line 3040 "ncoTree.cpp"
 				}
 			}
 			else {
@@ -3062,11 +3077,11 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					_t = __t270;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1845 "ncoGrammer.g"
+#line 1951 "ncoGrammer.g"
 						
 						;
 						
-#line 3070 "ncoTree.cpp"
+#line 3085 "ncoTree.cpp"
 					}
 				}
 				else {
@@ -3107,11 +3122,11 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						_t = __t274;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1848 "ncoGrammer.g"
+#line 1954 "ncoGrammer.g"
 							
 							;
 							
-#line 3115 "ncoTree.cpp"
+#line 3130 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -3119,7 +3134,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1851 "ncoGrammer.g"
+#line 1957 "ncoGrammer.g"
 							
 							
 							var_sct *var1;
@@ -3158,7 +3173,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							var=nco_var_dpl(var1);               ;
 							
 							
-#line 3162 "ncoTree.cpp"
+#line 3177 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -3180,14 +3195,14 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2260 "ncoGrammer.g"
+#line 2381 "ncoGrammer.g"
 	var_sct *var;
-#line 3186 "ncoTree.cpp"
+#line 3201 "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 2260 "ncoGrammer.g"
+#line 2381 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign_asn");
 	var=NULL_CEWI; 
@@ -3195,7 +3210,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	NcapVar *Nvar;
 	
 	
-#line 3199 "ncoTree.cpp"
+#line 3214 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -3213,7 +3228,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t343;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2270 "ncoGrammer.g"
+#line 2391 "ncoGrammer.g"
 				
 				if(vid1->getFirstChild())
 				err_prn(fnc_nm,"Invalid Lvalue " +vid1->getText() );
@@ -3231,7 +3246,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				
 				
-#line 3235 "ncoTree.cpp"
+#line 3250 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3241,7 +3256,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VAR_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2288 "ncoGrammer.g"
+#line 2409 "ncoGrammer.g"
 				
 				var_nm_s=vid->getText();  
 				if(vid->getFirstChild())
@@ -3250,17 +3265,19 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				//do attribute inheritance
 				
 				Nvar=prs_arg->var_vtr.find(var_nm_s);
-				
 				if( !Nvar || Nvar->flg_stt==1 ) 
 				ncap_att_cpy(var_nm_s,var_nm_s,prs_arg);
 				
 				var=prs_arg->ncap_var_init(var_nm_s,true);
+				
+				
+				
 				if(var== NULL_CEWI){
 				nco_exit(EXIT_FAILURE);
 				}
 				
 				
-#line 3264 "ncoTree.cpp"
+#line 3281 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3270,7 +3287,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,ATT_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2307 "ncoGrammer.g"
+#line 2430 "ncoGrammer.g"
 				
 				// check "output"
 				NcapVar *Nvar=NULL;
@@ -3303,7 +3320,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				var->val.vp=(void*)nco_free(var->val.vp);
 				
 				
-#line 3307 "ncoTree.cpp"
+#line 3324 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -3327,17 +3344,17 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2341 "ncoGrammer.g"
+#line 2464 "ncoGrammer.g"
 	var_sct *var;
-#line 3333 "ncoTree.cpp"
+#line 3350 "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 2341 "ncoGrammer.g"
+#line 2464 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list");
 	var=NULL_CEWI; 
 	
-#line 3341 "ncoTree.cpp"
+#line 3358 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -3346,7 +3363,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 2346 "ncoGrammer.g"
+#line 2469 "ncoGrammer.g"
 			
 			
 			char *cp;
@@ -3434,7 +3451,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			var=var_ret;
 			
 			
-#line 3438 "ncoTree.cpp"
+#line 3455 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3453,20 +3470,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 2437 "ncoGrammer.g"
+#line 2560 "ncoGrammer.g"
 	var_sct *var;
-#line 3459 "ncoTree.cpp"
+#line 3476 "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 2437 "ncoGrammer.g"
+#line 2560 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list_string");
 	var=NULL_CEWI; 
 	
-#line 3466 "ncoTree.cpp"
+#line 3483 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if ( inputState->guessing==0 ) {
-#line 2443 "ncoGrammer.g"
+#line 2566 "ncoGrammer.g"
 			
 			int idx;
 			int nbr_lst;
@@ -3515,7 +3532,7 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			end_val: var=var_ret;
 			
 			
-#line 3519 "ncoTree.cpp"
+#line 3536 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3534,18 +3551,18 @@ 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 2494 "ncoGrammer.g"
+#line 2617 "ncoGrammer.g"
 	bool bret=false;
-#line 3540 "ncoTree.cpp"
+#line 3557 "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 2494 "ncoGrammer.g"
+#line 2617 "ncoGrammer.g"
 	
 	const std::string fnc_nm("where_assign");
 	var_sct *var_rhs;
 	
 	
-#line 3549 "ncoTree.cpp"
+#line 3566 "ncoTree.cpp"
 	
 	try {      // for error handling
 		ANTLR_USE_NAMESPACE(antlr)RefAST __t348 = _t;
@@ -3566,7 +3583,7 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 		_t = __t348;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2500 "ncoGrammer.g"
+#line 2623 "ncoGrammer.g"
 			
 			
 			bool bfr=false;
@@ -3698,7 +3715,7 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			prs_arg->ncap_var_write(var_lhs,false);
 			bret=true;
 			
-#line 3702 "ncoTree.cpp"
+#line 3719 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3715,18 +3732,18 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2635 "ncoGrammer.g"
+#line 2758 "ncoGrammer.g"
 	var_sct *var;
-#line 3721 "ncoTree.cpp"
+#line 3738 "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 2635 "ncoGrammer.g"
+#line 2758 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 3730 "ncoTree.cpp"
+#line 3747 "ncoTree.cpp"
 	
 	try {      // for error handling
 		ANTLR_USE_NAMESPACE(antlr)RefAST __t351 = _t;
@@ -3750,7 +3767,7 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = __t351;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2641 "ncoGrammer.g"
+#line 2764 "ncoGrammer.g"
 			
 			
 			int idx;
@@ -3851,7 +3868,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 3855 "ncoTree.cpp"
+#line 3872 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -3870,18 +3887,18 @@ 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 2745 "ncoGrammer.g"
+#line 2869 "ncoGrammer.g"
 	var_sct *var;
-#line 3876 "ncoTree.cpp"
+#line 3893 "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 2745 "ncoGrammer.g"
+#line 2869 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one_lhs");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 3885 "ncoTree.cpp"
+#line 3902 "ncoTree.cpp"
 	
 	try {      // for error handling
 		ANTLR_USE_NAMESPACE(antlr)RefAST __t355 = _t;
@@ -3905,7 +3922,7 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 		_t = __t355;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2751 "ncoGrammer.g"
+#line 2875 "ncoGrammer.g"
 			
 			int idx; 
 			int var_id; 
@@ -4050,7 +4067,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 4054 "ncoTree.cpp"
+#line 4071 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4067,18 +4084,18 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2898 "ncoGrammer.g"
+#line 3023 "ncoGrammer.g"
 	var_sct *var;
-#line 4073 "ncoTree.cpp"
+#line 4090 "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 2898 "ncoGrammer.g"
+#line 3023 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt");
 	var=NULL_CEWI; 
 	
-#line 4082 "ncoTree.cpp"
+#line 4099 "ncoTree.cpp"
 	
 	try {      // for error handling
 		ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t;
@@ -4091,7 +4108,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = __t359;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2903 "ncoGrammer.g"
+#line 3028 "ncoGrammer.g"
 			
 			bool bram;   // Check for a RAM variable
 			bool bnrm;
@@ -4132,11 +4149,11 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			}
 			// Temporarily change mode 
 			prs_arg->ntl_scn=False;
-			lmt_mk(lRef,lmt_vtr);
+			lmt_mk(nbr_dmn,lRef,lmt_vtr);
 			prs_arg->ntl_scn=True; 
 			
 			}else{
-			lmt_mk(lRef,lmt_vtr);
+			lmt_mk(nbr_dmn,lRef,lmt_vtr);
 			}
 			
 			if( lmt_vtr.size() != nbr_dmn)
@@ -4330,7 +4347,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			end2: var_rhs=nco_var_free(var_rhs); 
 			
-#line 4334 "ncoTree.cpp"
+#line 4351 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
diff --git a/src/nco++/ncoTree.hpp b/src/nco++/ncoTree.hpp
index 0f5112c..bf4194b 100644
--- a/src/nco++/ncoTree.hpp
+++ b/src/nco++/ncoTree.hpp
@@ -3,7 +3,7 @@
 
 #include <antlr/config.hpp>
 #include "ncoParserTokenTypes.hpp"
-/* $ANTLR 2.7.7 (2006-11-01): "ncoGrammer.g" -> "ncoTree.hpp"$ */
+/* $ANTLR 2.7.7 (20130428): "ncoGrammer.g" -> "ncoTree.hpp"$ */
 #include <antlr/TreeParser.hpp>
 
 #line 1 "ncoGrammer.g"
@@ -160,21 +160,127 @@ vector<ast_lmt_sct> &ast_lmt_vtr)
      return nbr_dmn;
 } 
 
-int 
+bool
+lmt_var_mk(
+int nbr_dmn,
+RefAST lmt,
+NcapVector<lmt_sct*> &lmt_vtr ) 
+{
+	int idx;
+	int jdx;
+	int sz;   
+    int dmn_sz;     
+    ptr_unn op1;
+	var_sct *var;
+	std::string fnc_nm="lmt_var_mk"; 
+	
+	dbg_prn(fnc_nm,"start\n"); 
+	
+	// calculate variables
+	var=out(lmt->getFirstChild()->getFirstChild());
+	// convert result to type int
+	var=nco_var_cnf_typ(NC_UINT64,var);    
+	(void)cast_void_nctype((nc_type)NC_UINT64,&var->val);
+	sz=var->sz;
+	dmn_sz=var->sz / nbr_dmn;
+	
+    dbg_prn(fnc_nm,"step 1\n");   
+
+    // shape of var must be (nbr_dmn) or (nbr_dmn,2) or (nbr_dmn,3) 
+    if( dmn_sz * nbr_dmn != sz )
+	{
+	  var=nco_var_free(var);
+      return false;  
+    }
+
+    dbg_prn(fnc_nm,"step 2\n");   
+	
+    for(idx=0; idx<sz;idx+=dmn_sz)
+	 {
+
+		// fill out lmt structure
+		// use same logic as nco_lmt_prs 
+		lmt_sct* lmt_ptr=(lmt_sct*)nco_calloc((size_t)1,sizeof(lmt_sct));
+		lmt_ptr->nm=NULL;
+		//lmt_ptr->lmt_typ=-1;
+		lmt_ptr->is_usr_spc_lmt=True; /* True if any part of limit is user-specified, else False */
+		lmt_ptr->min_sng=NULL;
+		lmt_ptr->max_sng=NULL;
+		lmt_ptr->srd_sng=NULL;
+		lmt_ptr->is_usr_spc_min=False;
+		lmt_ptr->is_usr_spc_max=False;
+		/* rec_skp_ntl_spf is used for record dimension in multi-file operators */
+		lmt_ptr->rec_skp_ntl_spf=0L; /* Number of records skipped in initial superfluous files */
+
+       dbg_prn(fnc_nm,"step loop idx="+ nbr2sng(idx)+"\n");   
+	   
+       for(jdx=0;jdx<dmn_sz;jdx++)
+		{     
+		  dbg_prn(fnc_nm,"step loop jdx="+ nbr2sng(jdx)+"\n");   	
+		  
+         nco_uint64 uival= var->val.ui64p[idx+jdx];
+         switch(jdx){
+           case 0: 
+             lmt_ptr->is_usr_spc_min=True;
+             lmt_ptr->srt=uival;
+             break;
+           case 1: //end
+             lmt_ptr->is_usr_spc_max=True;
+             lmt_ptr->end=uival;
+             break;
+           case 2: //srd
+             lmt_ptr->srd_sng=strdup("~fill_in");
+             lmt_ptr->srd=uival;
+             break;			
+	       }
+
+		}
+		/* need to deal with situation where only start is defined -- ie picking only a single value */
+		if( lmt_ptr->is_usr_spc_min==True && lmt_ptr->is_usr_spc_max==False && lmt_ptr->srd_sng==NULL)
+		{
+			lmt_ptr->is_usr_spc_max=True;
+			lmt_ptr->end=lmt_ptr->srt; 
+       }    
+
+       lmt_vtr.push_back(lmt_ptr);		
+	}
+	 
+	cast_nctype_void((nc_type)NC_UINT64,&var->val);
+	var=nco_var_free(var);  
+	dbg_prn(fnc_nm,"end\n"); 
+	
+   return true;
+
+}
+
+
+
+bool 
 lmt_mk(
+int nbr_dmn,
 RefAST lmt,
 NcapVector<lmt_sct*> &lmt_vtr ) 
 {   
-int nbr_dmn;
+
 int idx;
 int jdx;
+int sz;
 lmt_sct *lmt_ptr;
 RefAST aRef;
-
 vector<ast_lmt_sct> ast_lmt_vtr;
 
+// deal with a single expression containing all indicies
+if(lmt->getNumberOfChildren()==1 && 
+   lmt->getFirstChild()->getNumberOfChildren()==1 &&
+   lmt->getFirstChild()->getFirstChild()->getType() != COLON)
+{
+   return lmt_var_mk(nbr_dmn,lmt,lmt_vtr);   ;            
+}
+
+
 // populate ast_lmt_vtr
-nbr_dmn=lmt_init(lmt,ast_lmt_vtr);
+if( nbr_dmn!=lmt_init(lmt,ast_lmt_vtr) )
+  return false;	
 
   for(idx=0 ; idx <nbr_dmn ; idx++){
 
@@ -235,7 +341,7 @@ nbr_dmn=lmt_init(lmt,ast_lmt_vtr);
     lmt_vtr.push_back(lmt_ptr);
   } // end idx
 
-   return nbr_dmn;
+   return true;;
 } /* end lmt_mk */
 
 /* Legacy run -- will remove soon
diff --git a/src/nco/mpncbo.c b/src/nco/mpncbo.c
index a0fc110..cd24984 100644
--- a/src/nco/mpncbo.c
+++ b/src/nco/mpncbo.c
@@ -1057,6 +1057,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/mpncecat.c b/src/nco/mpncecat.c
index f508470..e498112 100644
--- a/src/nco/mpncecat.c
+++ b/src/nco/mpncecat.c
@@ -948,6 +948,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/mpncflint.c b/src/nco/mpncflint.c
index de87607..13f45bb 100644
--- a/src/nco/mpncflint.c
+++ b/src/nco/mpncflint.c
@@ -995,6 +995,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/mpncpdq.c b/src/nco/mpncpdq.c
index af00ccf..0925b0f 100644
--- a/src/nco/mpncpdq.c
+++ b/src/nco/mpncpdq.c
@@ -1238,6 +1238,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/mpncra.c b/src/nco/mpncra.c
index e9a9ab6..ed32324 100644
--- a/src/nco/mpncra.c
+++ b/src/nco/mpncra.c
@@ -1479,6 +1479,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/mpncwa.c b/src/nco/mpncwa.c
index 204561a..97ef1b2 100644
--- a/src/nco/mpncwa.c
+++ b/src/nco/mpncwa.c
@@ -1324,6 +1324,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
diff --git a/src/nco/ncap.c b/src/nco/ncap.c
index f1fd278..e0ee12c 100644
--- a/src/nco/ncap.c
+++ b/src/nco/ncap.c
@@ -963,6 +963,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     /* Free limits */
     for(idx=0;idx<lmt_nbr;idx++) lmt_arg[idx]=(char *)nco_free(lmt_arg[idx]);
     if(lmt_nbr > 0) lmt=nco_lmt_lst_free(lmt,lmt_nbr);
diff --git a/src/nco/ncatted.c b/src/nco/ncatted.c
index d8031d7..3e761c2 100644
--- a/src/nco/ncatted.c
+++ b/src/nco/ncatted.c
@@ -485,6 +485,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
 
     trv_tbl_free(trv_tbl);
   } /* !flg_cln */
diff --git a/src/nco/ncbo.c b/src/nco/ncbo.c
index 896e98a..9d13258 100644
--- a/src/nco/ncbo.c
+++ b/src/nco/ncbo.c
@@ -687,6 +687,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<aux_nbr;idx++) aux_arg[idx]=(char *)nco_free(aux_arg[idx]);
diff --git a/src/nco/ncecat.c b/src/nco/ncecat.c
index e39bdb2..92de913 100644
--- a/src/nco/ncecat.c
+++ b/src/nco/ncecat.c
@@ -777,7 +777,7 @@ main(int argc,char **argv)
         /* GPE arguments derived from filenames check for existence of path in output file */
         rcd=nco_inq_grp_full_ncid_flg(out_id,gpe_arg,&gpe_id);
         /* Existence implies current file may overwrite contents of previous file */
-        if(rcd == NC_NOERR) (void)fprintf(stderr,"%s: WARNING GAG path \"%s\" automatically derived from stub of filename %s conflicts with existing path in output file. Any input data with same absolute path names as contents of a previous input file will be overwritten. Is the same input file specified multiple times? Is this intentional?\nHINT: To distribute copies of a single input file into different groups, use GPE to generate distinct output group names, e.g., %s -G copy in.nc in. [...]
+        if(rcd == NC_NOERR) (void)fprintf(stderr,"%s: WARNING GAG path \"%s\" automatically derived from stub of filename %s conflicts with existing path in output file. Any input data with same absolute path names as contents of a previous input file will be overwritten. Is the same input file specified multiple times? Is this intentional?\nHINT: To distribute copies of a single input file into different groups, use GPE to generate distinct output group names, e.g., %s -G copy in.nc in. [...]
       } /* !grp_out */
       /* Free old structure, if any, before re-use */
       if(gpe) gpe=(gpe_sct *)nco_gpe_free(gpe);
@@ -951,9 +951,10 @@ main(int argc,char **argv)
     if(fl_pth_lcl) fl_pth_lcl=(char *)nco_free(fl_pth_lcl);
     if(in_id_arr) in_id_arr=(int *)nco_free(in_id_arr);
     /* Free lists of strings */
-    if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
+    if(fl_lst_in && !fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<aux_nbr;idx++) aux_arg[idx]=(char *)nco_free(aux_arg[idx]);
diff --git a/src/nco/ncflint.c b/src/nco/ncflint.c
index 00470ab..ae74978 100644
--- a/src/nco/ncflint.c
+++ b/src/nco/ncflint.c
@@ -926,6 +926,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<aux_nbr;idx++) aux_arg[idx]=(char *)nco_free(aux_arg[idx]);
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index f16d230..339955b 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -3,7 +3,7 @@
 /* ncks -- netCDF Kitchen Sink */
 
 /* Purpose: Extract (subsets of) variables from a netCDF file 
-   Print them to screen, or copy them to a new file, or both */
+   Print them to screen, copy them to another file, or regrid them */
 
 /* Copyright (C) 1995--2015 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
@@ -116,6 +116,7 @@ main(int argc,char **argv)
   char **grp_lst_in=NULL;
   char **rgr_arg=NULL; /* [sng] Regridding arguments */
   char **var_lst_in=NULL;
+  char **xtn_lst_in=NULL; /* [sng] Extensive variables */
   char *aux_arg[NC_MAX_DIMS];
   char *cmd_ln;
   char *cnk_arg[NC_MAX_DIMS];
@@ -205,6 +206,7 @@ main(int argc,char **argv)
   int var_lst_in_nbr=0;
   int var_nbr_fl;
   int var_ntm_fl;
+  int xtn_nbr=0; /* [nbr] Number of extensive variables */
   int xtr_nbr=0; /* xtr_nbr will not otherwise be set for -c with no -v */
 
   kvm_sct *sld_nfo=NULL; /* [sct] Container for SLD/SCRIP information */
@@ -384,6 +386,8 @@ main(int argc,char **argv)
     {"tst_udunits",required_argument,0,0},
     {"xml_spr_chr",required_argument,0,0}, /* [flg] Separator for XML character types */
     {"xml_spr_nmr",required_argument,0,0}, /* [flg] Separator for XML numeric types */
+    {"xtn_var_lst",required_argument,0,0}, /* [sng] Extensive variables */
+    {"extensive",required_argument,0,0}, /* [sng] Extensive variables */
     /* Long options with short counterparts */
     {"3",no_argument,0,'3'},
     {"4",no_argument,0,'4'},
@@ -665,6 +669,13 @@ main(int argc,char **argv)
       if(!strcmp(opt_crr,"xml_no_location") || !strcmp(opt_crr,"ncml_no_location")){PRN_XML_LOCATION=False;PRN_XML=True;} /* [flg] Print XML location tag */
       if(!strcmp(opt_crr,"xml_spr_chr")){spr_chr=(char *)strdup(optarg);PRN_XML=True;} /* [flg] Separator for XML character types */
       if(!strcmp(opt_crr,"xml_spr_nmr")){spr_nmr=(char *)strdup(optarg);PRN_XML=True;} /* [flg] Separator for XML numeric types */
+      if(!strcmp(opt_crr,"xtn_var_lst") || !strcmp(opt_crr,"extensive")){
+	/* Extensive variables */
+	optarg_lcl=(char *)strdup(optarg);
+	(void)nco_rx_comma2hash(optarg_lcl);
+	xtn_lst_in=nco_lst_prs_2D(optarg_lcl,",",&xtn_nbr);
+	optarg_lcl=(char *)nco_free(optarg_lcl);
+      } /* !xtn */
     } /* opt != 0 */
     /* Process short options */
     switch(opt){
@@ -949,6 +960,11 @@ main(int argc,char **argv)
     nco_exit(EXIT_FAILURE);
   } /* endif fl_bnr */
     
+  if(flg_rgr && !fl_out){
+	(void)fprintf(stdout,"%s: ERROR Regridding requested but no output file specified\nHINT: Specify output file with \"-o fl_out\" or as last argument\n",nco_prg_nm_get());
+        nco_exit(EXIT_FAILURE);
+  } /* !flg_rgr */
+    
   if(gpe){
     if(nco_dbg_lvl >= nco_dbg_fl) (void)fprintf(stderr,"%s: INFO Group Path Edit (GPE) feature enabled\n",nco_prg_nm_get());
     if(fl_out && fl_out_fmt != NC_FORMAT_NETCDF4 && nco_dbg_lvl >= nco_dbg_std) (void)fprintf(stderr,"%s: WARNING Group Path Edit (GPE) requires netCDF4 output format in most cases (except flattening) but user explicitly requested output format = %s. This command will fail if the output file requires netCDF4 features like groups, non-atomic types, or multiple record dimensions. However, it _will_ autoconvert netCDF4 atomic types (e.g., NC_STRING, NC_UBYTE...) to netCDF3 atomic types (e.g [...]
@@ -967,7 +983,7 @@ main(int argc,char **argv)
       /* Initialize regridding structure */
       rgr_in=(char *)strdup(fl_in);
       rgr_out=(char *)strdup(fl_out);
-      rgr_nfo=nco_rgr_ini(cmd_ln,in_id,rgr_arg,rgr_nbr,rgr_in,rgr_out,rgr_grd_src,rgr_grd_dst,rgr_map,rgr_var,wgt_vld_thr);
+      rgr_nfo=nco_rgr_ini(cmd_ln,in_id,rgr_arg,rgr_nbr,rgr_in,rgr_out,rgr_grd_src,rgr_grd_dst,rgr_map,rgr_var,wgt_vld_thr,xtn_lst_in,xtn_nbr);
       rgr_nfo->fl_out_tmp=nco_fl_out_open(rgr_nfo->fl_out,FORCE_APPEND,FORCE_OVERWRITE,fl_out_fmt,&bfr_sz_hnt,RAM_CREATE,RAM_OPEN,WRT_TMP_FL,&out_id);
 
       /* Copy Global Metadata */
@@ -1218,6 +1234,7 @@ close_and_free:
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(grp_lst_in_nbr > 0) grp_lst_in=nco_sng_lst_free(grp_lst_in,grp_lst_in_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
diff --git a/src/nco/nco.h b/src/nco/nco.h
index dd3bde5..0019119 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -296,7 +296,7 @@ extern "C" {
 # define NCO_VERSION_MINOR 5
 #endif /* !NCO_VERSION_MINOR */
 #ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 2
+# define NCO_VERSION_PATCH 3
 #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 */
@@ -306,7 +306,7 @@ extern "C" {
 # define NCO_LIB_VERSION ( NCO_VERSION_MAJOR * 100 + NCO_VERSION_MINOR * 10 + NCO_VERSION_PATCH )
 #endif /* !NCO_LIB_VERSION */
 #ifndef NCO_VERSION
-# define NCO_VERSION "4.5.2"
+# define NCO_VERSION "4.5.3"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -924,18 +924,25 @@ extern "C" {
     char *area_nm; /* [sng] Name of variable containing gridcell area */
     char *bnd_nm; /* [sng] Name of dimension to employ for spatial bounds */
     char *bnd_tm_nm; /* [sng] Name of dimension to employ for temporal bounds */
-    char *col_nm; /* [sng] Name of horizontal spatial dimension on unstructured grid */
+    char *col_nm_in; /* [sng] Name to recognize as input horizontal spatial dimension on unstructured grid */
+    char *col_nm_out; /* [sng] Name of horizontal spatial output dimension on unstructured grid */
+    char *frc_nm; /* [sng] Name of variable containing gridcell fraction */
     char *lat_bnd_nm; /* [sng] Name of rectangular boundary variable for latitude */
-    char *lat_nm; /* [sng] Name of dimension to recognize as latitude */
+    char *lat_nm_in; /* [sng] Name of input dimension to recognize as latitude */
+    char *lat_nm_out; /* [sng] Name of output dimension for latitude */
     char *lat_vrt_nm; /* [sng] Name of non-rectangular boundary variable for latitude */
     char *lat_wgt_nm; /* [sng] Name of variable containing latitude weights */
     char *lon_bnd_nm; /* [sng] Name of rectangular boundary variable for longitude */
-    char *lon_nm; /* [sng] Name of dimension to recognize as longitude */
+    char *lon_nm_in; /* [sng] Name of dimension to recognize as longitude */
+    char *lon_nm_out; /* [sng] Name of output dimension for longitude */
     char *lon_vrt_nm; /* [sng] Name of non-rectangular boundary variable for longitude */
     char *vrt_nm; /* [sng] Name of dimension to employ for vertices */
     // User-specified grid properties
     char *fl_grd; /* [sng] Name of grid file to create */
+    char *fl_skl; /* [sng] Name of skeleton data file to create */
     char *grd_ttl; /* [sng] Grid title */
+    double lat_crv; /* [dgr] Latitudinal  curvilinearity */
+    double lon_crv; /* [dgr] Longitudinal curvilinearity */
     double lat_sth; /* [dgr] Latitude of southern edge of grid */
     double lon_wst; /* [dgr] Longitude of western edge of grid */
     double lat_nrt; /* [dgr] Latitude of northern edge of grid */
@@ -946,15 +953,21 @@ extern "C" {
     nco_grd_lat_typ_enm lat_typ; /* [enm] Latitude grid-type enum */
     nco_grd_lon_typ_enm lon_typ; /* [enm] Longitude grid-type enum */
     // Other internal data and metadata 
+    char **xtn_var; /* [sng] Extensive variables */
     char *cmd_ln; /* [sng] Command-line */
     double wgt_vld_thr; /* [frc] Weight threshold for valid destination value */
     int in_id; /* [id] Input netCDF file ID */
     int out_id; /* [id] Output netCDF file ID */
     int rgr_nbr; /* [nbr] Number of regridding arguments */
+    int xtn_nbr; /* [nbr] Number of extensive variables */
+    long idx_dbg; /* [idx] Index of gridcell for debugging */
+    long tst; /* [enm] Generic key for testing (undocumented) */
     nco_bool flg_usr_rqs; /* [flg] User requested regridding */
     nco_bool flg_grd_src; /* [flg] User-specified input grid */
     nco_bool flg_grd_dst; /* [flg] User-specified destination grid */
+    nco_bool flg_crv; /* [flg] Use curvilinear coordinates */
     nco_bool flg_grd; /* [flg] Create SCRIP-format grid file */
+    nco_bool flg_nfr; /* [flg] Infer SCRIP-format grid file */
     nco_bool flg_map; /* [flg] User-specified mapping weights */
     nco_bool flg_rnr; /* [flg] Renormalize destination values by valid area */
   } rgr_sct;
@@ -1121,6 +1134,8 @@ extern "C" {
     nco_bool flg_nsx;                 /* [flg] Object matches intersection criteria */
     nco_bool flg_rcr;                 /* [flg] Extract group recursively */
     nco_bool flg_rgr;                 /* [flg] Regrid variable */ 
+    nco_bool flg_xtn;                 /* [flg] Extensive variable */ 
+    nco_bool flg_mrv;                 /* [flg] Most-Rapidly-Varying horizontal dimensions variable */ 
     nco_bool flg_unn;                 /* [flg] Object matches union criteria */
     nco_bool flg_vfp;                 /* [flg] Variable matches full path specification */
     nco_bool flg_vsg;                 /* [flg] Variable selected because group matches */
diff --git a/src/nco/nco_att_utl.c b/src/nco/nco_att_utl.c
index b87034d..fb6bf19 100644
--- a/src/nco/nco_att_utl.c
+++ b/src/nco/nco_att_utl.c
@@ -26,75 +26,19 @@ nco_aed_prc_wrp /* [fnc] Expand regular expressions then pass attribute edits to
 {
   /* Purpose: Wrapper for nco_aed_prc(), which processes single attribute edit for single variable
      This wrapper passes its arguments straight throught to nco_aed_prc() with one exception---
-     it unrolls attribute name that are regular expression into multiple calls to nco_aed_prc() */
+     it unrolls attribute names that are regular expressions into multiple calls to nco_aed_prc() */
   const char fnc_nm[]="nco_aed_prc_wrp()"; /* [sng] Function name */
   nco_bool flg_chg=False; /* [flg] Attribute was altered */
 
-  if(!strpbrk(aed.att_nm,".*^$\\[]()<>+?|{}")){
+  if(aed.att_nm && !strpbrk(aed.att_nm,".*^$\\[]()<>+?|{}")){
     // const char foo[]="foo {{";
     /* NB: previous line confuses Emacs C-mode indenter. Restore with isolated parenthesis? */
     /* If attribute name is not regular expression, call single attribute routine then return */
     flg_chg|=nco_aed_prc(nc_id,var_id,aed);
     return flg_chg; /* [flg] Attribute was altered */
   } /* !rx */
-  
-#ifndef NCO_HAVE_REGEX_FUNCTIONALITY
-  (void)fprintf(stdout,"%s: ERROR: Sorry, wildcarding (extended regular expression matches to attributes) was not built into this NCO executable, so unable to compile regular expression \"%s\".\nHINT: Make sure libregex.a is on path and re-build NCO.\n",nco_prg_nm_get(),aed.att_nm);
-  nco_exit(EXIT_FAILURE);
-#else /* NCO_HAVE_REGEX_FUNCTIONALITY */
-  /* aed.att_nm is regular expression */
 
   aed_sct aed_swp; /* [sct] Attribute-edit information */
-
-  char *rx_sng; /* [sng] Regular expression pattern */
-
-  int err_id;
-  int flg_cmp; /* Comparison flags */
-  int flg_exe; /* Execution flages */
-  int mch_nbr=0;
-  
-  regex_t *rx;
-  regmatch_t *result;
-
-  size_t rx_prn_sub_xpr_nbr;
-
-  rx_sng=aed.att_nm;
-  rx=(regex_t *)nco_malloc(sizeof(regex_t));
-
-  /* Choose RE_SYNTAX_POSIX_EXTENDED regular expression type */
-  flg_cmp=(REG_EXTENDED | REG_NEWLINE);
-  /* Set execution flags */
-  flg_exe=0;
-
-  /* Compile regular expression */
-  if((err_id=regcomp(rx,rx_sng,flg_cmp))){ /* Compile regular expression */
-    char const * rx_err_sng;  
-    /* POSIX regcomp return error codes */
-    switch(err_id){
-    case REG_BADPAT: rx_err_sng="Invalid pattern"; break;  
-    case REG_ECOLLATE: rx_err_sng="Not implemented"; break;
-    case REG_ECTYPE: rx_err_sng="Invalid character class name"; break;
-    case REG_EESCAPE: rx_err_sng="Trailing backslash"; break;
-    case REG_ESUBREG: rx_err_sng="Invalid back reference"; break;
-    case REG_EBRACK: rx_err_sng="Unmatched left bracket"; break;
-    case REG_EPAREN: rx_err_sng="Parenthesis imbalance"; break;
-    case REG_EBRACE: rx_err_sng="Unmatched {"; break;
-    case REG_BADBR: rx_err_sng="Invalid contents of { }"; break;
-    case REG_ERANGE: rx_err_sng="Invalid range end"; break;
-    case REG_ESPACE: rx_err_sng="Ran out of memory"; break;
-    case REG_BADRPT: rx_err_sng="No preceding re for repetition op"; break;
-    default: rx_err_sng="Invalid pattern"; break;  
-    } /* end switch */
-    (void)fprintf(stdout,"%s: ERROR %s error in regular expression \"%s\" %s\n",nco_prg_nm_get(),fnc_nm,rx_sng,rx_err_sng); 
-    nco_exit(EXIT_FAILURE);
-  } /* end if err */
-
-  rx_prn_sub_xpr_nbr=rx->re_nsub+1L; /* Number of parenthesized sub-expressions */
-
-  /* Search string */
-  result=(regmatch_t *)nco_malloc(sizeof(regmatch_t)*rx_prn_sub_xpr_nbr);
-
-  /* Regular expression is ready to use */
   char **att_nm_lst;
   int att_idx;
   int att_nbr;
@@ -104,34 +48,104 @@ nco_aed_prc_wrp /* [fnc] Expand regular expressions then pass attribute edits to
   (void)nco_inq_varnatts(grp_id,var_id,&att_nbr);
 
   /* 20150629: Read in all attribute names before any editing 
-     This is because creation or deletion of attributes can change their number
-     According to the netCDF documentation, "The number of an attribute is more volatile than the name, since it can change when other attributes of the same variable are deleted. This is why an attribute number is not called an attribute ID." */
+     This is because creation and deletion of attributes changes their number
+     According to netCDF documentation, "The number of an attribute is more volatile than the name, since it can change when other attributes of the same variable are deleted. This is why an attribute number is not called an attribute ID." */
   att_nm_lst=(char **)nco_malloc(att_nbr*sizeof(char *));
   for(att_idx=0;att_idx<att_nbr;att_idx++){
     att_nm_lst[att_idx]=(char *)nco_malloc((NC_MAX_NAME+1L)*sizeof(char));
     nco_inq_attname(grp_id,var_id,att_idx,att_nm_lst[att_idx]);
   } /* !att */
 
-  /* Check each attribute for match to rx */
-  for(att_idx=0;att_idx<att_nbr;att_idx++){
-    if(!regexec(rx,att_nm_lst[att_idx],rx_prn_sub_xpr_nbr,result,flg_exe)){
-      mch_nbr++;
+  if(!aed.att_nm){
+
+    /* Attribute name is blank, meaning intent is to edit all attributes for this variable/group */
+    for(att_idx=0;att_idx<att_nbr;att_idx++){
       /* Swap original attibute name (the regular expression) with its current match */
       aed_swp=aed;
       aed_swp.att_nm=att_nm_lst[att_idx];
       flg_chg|=nco_aed_prc(nc_id,var_id,aed_swp);
-    } /* !mch */
-  } /* !att */
+    } /* !att */
 
-  if(att_nm_lst) att_nm_lst=nco_sng_lst_free(att_nm_lst,att_nbr);
-  if(!mch_nbr) (void)fprintf(stdout,"%s: WARNING: Regular expression \"%s\" does not match any attribute\nHINT: See regular expression syntax examples at http://nco.sf.net/nco.html#rx\n",nco_prg_nm_get(),aed.att_nm); 
+  }else{
+    
+#ifndef NCO_HAVE_REGEX_FUNCTIONALITY
+    (void)fprintf(stdout,"%s: ERROR: Sorry, wildcarding (extended regular expression matches to attributes) was not built into this NCO executable, so unable to compile regular expression \"%s\".\nHINT: Make sure libregex.a is on path and re-build NCO.\n",nco_prg_nm_get(),aed.att_nm);
+    nco_exit(EXIT_FAILURE);
+#else /* NCO_HAVE_REGEX_FUNCTIONALITY */
+    /* aed.att_nm is regular expression */
+    
+    char *rx_sng; /* [sng] Regular expression pattern */
+    
+    int err_id;
+    int flg_cmp; /* Comparison flags */
+    int flg_exe; /* Execution flages */
+    int mch_nbr=0;
+    
+    regex_t *rx;
+    regmatch_t *result;
+    
+    size_t rx_prn_sub_xpr_nbr;
+    
+    rx_sng=aed.att_nm;
+    rx=(regex_t *)nco_malloc(sizeof(regex_t));
+    
+    /* Choose RE_SYNTAX_POSIX_EXTENDED regular expression type */
+    flg_cmp=(REG_EXTENDED | REG_NEWLINE);
+    /* Set execution flags */
+    flg_exe=0;
+    
+    /* Compile regular expression */
+    if((err_id=regcomp(rx,rx_sng,flg_cmp))){ /* Compile regular expression */
+      char const * rx_err_sng;  
+      /* POSIX regcomp return error codes */
+      switch(err_id){
+      case REG_BADPAT: rx_err_sng="Invalid pattern"; break;  
+      case REG_ECOLLATE: rx_err_sng="Not implemented"; break;
+      case REG_ECTYPE: rx_err_sng="Invalid character class name"; break;
+      case REG_EESCAPE: rx_err_sng="Trailing backslash"; break;
+      case REG_ESUBREG: rx_err_sng="Invalid back reference"; break;
+      case REG_EBRACK: rx_err_sng="Unmatched left bracket"; break;
+      case REG_EPAREN: rx_err_sng="Parenthesis imbalance"; break;
+      case REG_EBRACE: rx_err_sng="Unmatched {"; break;
+      case REG_BADBR: rx_err_sng="Invalid contents of { }"; break;
+      case REG_ERANGE: rx_err_sng="Invalid range end"; break;
+      case REG_ESPACE: rx_err_sng="Ran out of memory"; break;
+      case REG_BADRPT: rx_err_sng="No preceding re for repetition op"; break;
+      default: rx_err_sng="Invalid pattern"; break;  
+      } /* end switch */
+      (void)fprintf(stdout,"%s: ERROR %s error in regular expression \"%s\" %s\n",nco_prg_nm_get(),fnc_nm,rx_sng,rx_err_sng); 
+      nco_exit(EXIT_FAILURE);
+    } /* end if err */
+
+    rx_prn_sub_xpr_nbr=rx->re_nsub+1L; /* Number of parenthesized sub-expressions */
 
-  regfree(rx); /* Free regular expression data structure */
-  rx=(regex_t *)nco_free(rx);
-  result=(regmatch_t *)nco_free(result);
+    /* Search string */
+    result=(regmatch_t *)nco_malloc(sizeof(regmatch_t)*rx_prn_sub_xpr_nbr);
+    
+    /* Regular expression is ready to use */
+    
+    /* Check each attribute for match to rx */
+    for(att_idx=0;att_idx<att_nbr;att_idx++){
+      if(!regexec(rx,att_nm_lst[att_idx],rx_prn_sub_xpr_nbr,result,flg_exe)){
+	mch_nbr++;
+	/* Swap original attibute name (the regular expression) with its current match */
+	aed_swp=aed;
+	aed_swp.att_nm=att_nm_lst[att_idx];
+	flg_chg|=nco_aed_prc(nc_id,var_id,aed_swp);
+      } /* !mch */
+    } /* !att */
+    
+    if(!mch_nbr) (void)fprintf(stdout,"%s: WARNING: Regular expression \"%s\" does not match any attribute\nHINT: See regular expression syntax examples at http://nco.sf.net/nco.html#rx\n",nco_prg_nm_get(),aed.att_nm); 
+
+    regfree(rx); /* Free regular expression data structure */
+    rx=(regex_t *)nco_free(rx);
+    result=(regmatch_t *)nco_free(result);
 #endif /* NCO_HAVE_REGEX_FUNCTIONALITY */
+  } /* !aed.att_nm */
   
- return flg_chg; /* [flg] Attribute was altered */
+  if(att_nm_lst) att_nm_lst=nco_sng_lst_free(att_nm_lst,att_nbr);
+
+  return flg_chg; /* [flg] Attribute was altered */
 } /* end nco_aed_prc() */
 
  nco_bool /* [flg] Attribute was changed */
diff --git a/src/nco/nco_aux.c b/src/nco/nco_aux.c
index 986ae34..8c92ed5 100644
--- a/src/nco/nco_aux.c
+++ b/src/nco/nco_aux.c
@@ -164,10 +164,10 @@ nco_aux_evl
   double lat_crr; /* [dgr] Current cell latitude */
   double lon_crr; /* [dgr] Current cell longitude */
 
-  float lat_min; /* [dgr] Lower left latitude of bounding rectangle */
-  float lat_max; /* [dgr] Upper right longitude of bounding rectangle */
-  float lon_min; /* [dgr] Lower left longitude of bounding rectangle */
-  float lon_max; /* [dgr] Upper right latitude of bounding rectangle */
+  double lat_min; /* [dgr] Lower left latitude of bounding rectangle */
+  double lat_max; /* [dgr] Upper right longitude of bounding rectangle */
+  double lon_min; /* [dgr] Lower left longitude of bounding rectangle */
+  double lon_max; /* [dgr] Upper right latitude of bounding rectangle */
 
   int aux_idx; /* [idx] Index over user -X options */
   int cll_grp_nbr=0; /* [nbr] Number of groups of cells within this bounding box */
@@ -325,10 +325,10 @@ void
 nco_aux_prs
 (const char *bnd_bx_sng,
  const char *units,
- float *lon_min,
- float *lon_max,
- float *lat_min,
- float *lat_max)
+ double *lon_min,
+ double *lon_max,
+ double *lat_min,
+ double *lat_max)
 {
   /* Purpose: Parse command-line arguments of form:
      lon_min,lon_max,lat_min,lat_max */
@@ -337,20 +337,20 @@ nco_aux_prs
   
   bnd_bx_sng_tmp=strdup(bnd_bx_sng);
   
-  sscanf(bnd_bx_sng,"%f,%f,%f,%f",lon_min,lon_max,lat_min,lat_max);
+  sscanf(bnd_bx_sng,"%lf,%lf,%lf,%lf",lon_min,lon_max,lat_min,lat_max);
   crd_tkn=strtok(bnd_bx_sng_tmp,", ");
-  if(crd_tkn) sscanf(crd_tkn,"%f",lon_min); else nco_err_exit(0,"nco_aux_prs(): Problem with LL longitude string");
+  if(crd_tkn) sscanf(crd_tkn,"%lf",lon_min); else nco_err_exit(0,"nco_aux_prs(): Problem with LL longitude string");
   crd_tkn=strtok(NULL,", ");
-  if(crd_tkn) sscanf(crd_tkn,"%f",lon_max); else nco_err_exit(0,"nco_aux_prs(): Problem with UR longitude string");
+  if(crd_tkn) sscanf(crd_tkn,"%lf",lon_max); else nco_err_exit(0,"nco_aux_prs(): Problem with UR longitude string");
   crd_tkn=strtok(NULL,", ");
-  if(crd_tkn) sscanf(crd_tkn,"%f",lat_min); else nco_err_exit(0,"nco_aux_prs(): Problem with LL latitude string");
+  if(crd_tkn) sscanf(crd_tkn,"%lf",lat_min); else nco_err_exit(0,"nco_aux_prs(): Problem with LL latitude string");
   crd_tkn=strtok(NULL,", ");
-  if(crd_tkn) sscanf(crd_tkn,"%f",lat_max); else nco_err_exit(0,"nco_aux_prs(): Problem with UR latitude string");
+  if(crd_tkn) sscanf(crd_tkn,"%lf",lat_max); else nco_err_exit(0,"nco_aux_prs(): Problem with UR latitude string");
   
   if(bnd_bx_sng_tmp) bnd_bx_sng_tmp=(char *)nco_free(bnd_bx_sng_tmp);
   
   if(!strcmp(units,"radians")){
-    const float dgr2rdn=M_PI/180.0;
+    const double dgr2rdn=M_PI/180.0;
     *lon_min*=dgr2rdn;
     *lon_max*=dgr2rdn;
     *lat_min*=dgr2rdn;
@@ -389,10 +389,10 @@ nco_aux_evl_trv
   double lat_crr; /* [dgr] Current cell latitude */
   double lon_crr; /* [dgr] Current cell longitude */
 
-  float lat_min; /* [dgr] Lower left latitude of bounding rectangle */
-  float lat_max; /* [dgr] Upper right longitude of bounding rectangle */
-  float lon_min; /* [dgr] Lower left longitude of bounding rectangle */
-  float lon_max; /* [dgr] Upper right latitude of bounding rectangle */
+  double lat_min; /* [dgr] Lower left latitude of bounding rectangle */
+  double lat_max; /* [dgr] Upper right longitude of bounding rectangle */
+  double lon_min; /* [dgr] Lower left longitude of bounding rectangle */
+  double lon_max; /* [dgr] Upper right latitude of bounding rectangle */
 
   int aux_idx; /* [idx] Index over user -X options */
   int cll_grp_nbr=0; /* [nbr] Number of groups of cells within this bounding box */
@@ -490,8 +490,7 @@ nco_aux_evl_trv
     for(cll_idx=0;cll_idx<dmn_sz;cll_idx++){
       if(lat.type == NC_FLOAT) lat_crr=((float *)vp_lat)[cll_idx]; else lat_crr=((double *)vp_lat)[cll_idx];
       if(lon.type == NC_FLOAT) lon_crr=((float *)vp_lon)[cll_idx]; else lon_crr=((double *)vp_lon)[cll_idx];
-      if(lon_crr >= lon_min && lon_crr <= lon_max &&
-        lat_crr >= lat_min && lat_crr <= lat_max){
+      if(lon_crr >= lon_min && lon_crr <= lon_max && lat_crr >= lat_min && lat_crr <= lat_max){
           if(cll_idx_min == -1){
             /* First cell within current bounding box */
             cll_idx_min=cll_idx;
diff --git a/src/nco/nco_aux.h b/src/nco/nco_aux.h
index 25454f3..57155aa 100644
--- a/src/nco/nco_aux.h
+++ b/src/nco/nco_aux.h
@@ -65,10 +65,10 @@ void
 nco_aux_prs
 (const char *bnd_bx_sng, 
  const char *units, 
- float *lon_min, 
- float *lon_max, 
- float *lat_min, 
- float *lat_max);
+ double *lon_min, 
+ double *lon_max, 
+ double *lat_min, 
+ double *lat_max);
 
 lmt_sct **                           /* O [lst] Auxiliary coordinate limits */
 nco_aux_evl_trv
diff --git a/src/nco/nco_cnf_dmn.c b/src/nco/nco_cnf_dmn.c
index d64417a..fd4bc00 100644
--- a/src/nco/nco_cnf_dmn.c
+++ b/src/nco/nco_cnf_dmn.c
@@ -526,9 +526,8 @@ nco_var_dmn_rdr_mtd /* [fnc] Change dimension ordering of variable metadata */
   } /* end loop over dmn_rdr */
   
   /* Map permanent list of reversed dimensions to input variable */
-  for(dmn_shr_idx=0;dmn_shr_idx<dmn_shr_nbr;dmn_shr_idx++){
+  for(dmn_shr_idx=0;dmn_shr_idx<dmn_shr_nbr;dmn_shr_idx++)
     dmn_rvr_in[dmn_idx_shr_in[dmn_shr_idx]]=dmn_rvr_rdr[dmn_idx_shr_rdr[dmn_shr_idx]];
-  }
   
   /* No dimension re-ordering is necessary if dmn_in and dmn_rdr share fewer than two dimensions
      Dimension reversal must be done with even one shared dimension
@@ -569,9 +568,8 @@ nco_var_dmn_rdr_mtd /* [fnc] Change dimension ordering of variable metadata */
      Remember: dmn_in has dimension IDs relative to input file 
      Copy dmn_in->xrf to get dimension IDs relative to output file (once they are defined) 
      Oh come on, it only seems like cheating! */
-  for(dmn_out_idx=0;dmn_out_idx<dmn_out_nbr;dmn_out_idx++){
+  for(dmn_out_idx=0;dmn_out_idx<dmn_out_nbr;dmn_out_idx++)
     dmn_out[dmn_out_idx]=dmn_in[dmn_idx_out_in[dmn_out_idx]]->xrf;
-  }
   
   /* Re-ordered output dimension list dmn_out now comprises correctly ordered but 
      otherwise verbatim copies of dmn_out structures in calling routine */
@@ -792,7 +790,7 @@ nco_var_dmn_rdr_val /* [fnc] Change dimension ordering of variable values */
        Reversal maps element k to element N-1-k=N-k-1 
        Enhance speed by using that all elements along dimension share reversal */
     for(dmn_in_idx=0;dmn_in_idx<dmn_in_nbr;dmn_in_idx++)
-      if(dmn_rvr_in[dmn_in_idx]) dmn_in_sbs[dmn_in_idx]=var_in_cnt[dmn_in_idx]-dmn_in_sbs[dmn_in_idx]-1;
+      if(dmn_rvr_in[dmn_in_idx]) dmn_in_sbs[dmn_in_idx]=var_in_cnt[dmn_in_idx]-dmn_in_sbs[dmn_in_idx]-1L;
 
     /* Map variable's N-D array indices to get 1-D index into output data */
     var_out_lmn=0L;
diff --git a/src/nco/nco_cnf_typ.c b/src/nco/nco_cnf_typ.c
index 71d31a7..ec13b98 100644
--- a/src/nco/nco_cnf_typ.c
+++ b/src/nco/nco_cnf_typ.c
@@ -1250,7 +1250,36 @@ nco_scv_cnf_typ /* [fnc] Convert scalar attribute to typ_new using C implicit co
   scv_new.type=typ_new;
   *scv_old=scv_new;
   return True;
-} /* end nco_scv_cnf_typ */
+} /* end nco_scv_cnf_typ() */
+
+nco_bool /* O [flg] Input is integer type */
+nco_typ_ntg /* [fnc] Identify integer types */
+(const nc_type typ_in) /* I [enm] Type to check for integer-ness */
+{
+  nco_bool flg_ntg=True; /* CEWI */
+
+  switch(typ_in){
+  case NC_INT: 
+  case NC_SHORT: 
+  case NC_INT64: 
+  case NC_BYTE: 
+  case NC_UINT:
+  case NC_USHORT:
+  case NC_UINT64:
+  case NC_UBYTE: 
+    flg_ntg=True;
+    break;
+  case NC_FLOAT: 
+  case NC_DOUBLE: 
+  case NC_CHAR: 
+  case NC_NAT: 
+  case NC_STRING: 
+    flg_ntg=False;
+    break;
+  default: nco_dfl_case_nc_type_err(); break;
+  } /* end switch */
+  return flg_ntg;
+} /* end nco_typ_ntg() */
 
 nco_bool /* O [flg] Input is signed type */
 nco_typ_sgn /* [fnc] Identify signed types */
@@ -1279,7 +1308,7 @@ nco_typ_sgn /* [fnc] Identify signed types */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
   return flg_sgn;
-} /* end nco_typ_sgn */
+} /* end nco_typ_sgn() */
 
 nco_bool /* O [flg] Input is netCDF3 atomic type */
 nco_typ_nc3 /* [fnc] Identify netCDF3 atomic types */
@@ -1308,7 +1337,7 @@ nco_typ_nc3 /* [fnc] Identify netCDF3 atomic types */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
   return flg_nc3;
-} /* end nco_typ_nc3 */
+} /* end nco_typ_nc3() */
 
 nc_type /* O [enm] netCDF3 type */
 nco_typ_nc4_nc3 /* [fnc] Convert netCDF4 to netCDF3 atomic type */
@@ -1336,7 +1365,7 @@ nco_typ_nc4_nc3 /* [fnc] Convert netCDF4 to netCDF3 atomic type */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
   return typ_nc4;
-} /* end nco_typ_nc4_nc3 */
+} /* end nco_typ_nc4_nc3() */
 
 nc_type /* O [enm] Return Highest type */
 ncap_typ_hgh /* [fnc] Return Highest type */
@@ -1417,7 +1446,7 @@ ncap_typ_hgh /* [fnc] Return Highest type */
   default: nco_dfl_case_nc_type_err(); break;
   } /* end switch */
   return typ_1;
-} /* end ncap_typ_hgh */
+} /* end ncap_typ_hgh() */
 
 nc_type /* O [enm] Higher precision of input variables */
 ncap_var_retype /* [fnc] Promote variable to higher common precision */
@@ -1434,7 +1463,7 @@ ncap_var_retype /* [fnc] Promote variable to higher common precision */
   if(var_2->type != typ_hgh) var_2=nco_var_cnf_typ(typ_hgh,var_2);
 
   return typ_hgh;
-} /* end ncap_var_retype */
+} /* end ncap_var_retype() */
 
 nc_type /* O [enm] Highest precision of arguments */
 ncap_scv_scv_cnf_typ_hgh_prc /* [fnc] Promote arguments to higher precision if necessary */
@@ -1452,7 +1481,7 @@ ncap_scv_scv_cnf_typ_hgh_prc /* [fnc] Promote arguments to higher precision if n
     (void)nco_scv_cnf_typ(scv_2->type,scv_1);
     return scv_2->type;
   } /* endif */
-} /* end ncap_scv_scv_cnf_typ_hgh_prc */
+} /* end ncap_scv_scv_cnf_typ_hgh_prc() */
 
 nc_type /* O [enm] Highest precision of arguments */
 ncap_var_scv_cnf_typ_hgh_prc /* [fnc] Promote arguments to higher precision if necessary */
diff --git a/src/nco/nco_cnf_typ.h b/src/nco/nco_cnf_typ.h
index b2943fb..7fafaba 100644
--- a/src/nco/nco_cnf_typ.h
+++ b/src/nco/nco_cnf_typ.h
@@ -99,6 +99,10 @@ ncap_var_scv_cnf_typ_hgh_prc /* [fnc] Promote arguments to higher precision if n
 (var_sct ** const var, /* I/O [sct] Variable */
  scv_sct * const scv); /* I/O [sct] Scalar value */
 
+nco_bool /* O [flg] Input is integer type */
+nco_typ_ntg /* [fnc] Identify integer types */
+(const nc_type typ_in); /* I [enm] Type to check for integer-ness */
+
 nco_bool /* O [flg] Input is signed type */
 nco_typ_sgn /* [fnc] Identify signed types */
 (const nc_type typ_in); /* I [enm] Type to check for signedness */
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index 733a32a..3850610 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -28,10 +28,10 @@ nco_cmp_get(void) /* [fnc] Return compiler and version */
   /* Testing for GCC macros early is dangerous because some compilers, 
      including Intel's, define GCC macros for compatibility */
 #if defined(__GNUG__)
-  static const char cmp_nm[]="gcc"; /* [sng] Compiler name */
+  static const char cmp_nm[]="g++"; /* [sng] Compiler name */
   static const char cmp_sng[]="Token __GNUG__ defined in nco_cmp_get(). Compiled with GNU g++ (or a compiler that emulates g++)."; /* [sng] Compiler string */
 #else /* !__GNUG__ */
-  static const char cmp_nm[]="g++"; /* [sng] Compiler name */
+  static const char cmp_nm[]="gcc"; /* [sng] Compiler name */
   static const char cmp_sng[]="Token __GNUC__ defined in nco_cmp_get(). Compiled with GNU gcc (or a compiler that emulates gcc)."; /* [sng] Compiler string */
 #endif /* !__GNUG__ */
   static const char cmp_vrs[]=TKN2SNG(__VERSION__); // [sng] Compiler version
@@ -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 "Parenthood\n";
+  return "Mad Men\n";
 } /* end nco_nmn_get() */
 
 char * /* O [sng] nm_in stripped of any path (i.e., program name stub) */ 
@@ -966,7 +966,7 @@ nco_usg_prn(void)
     opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr sz] [-C] [-c] [--cnk_byt sz] [--cnk_dmn nm,sz] [--cnk_map map] [--cnk_min min] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_crd] [--fl_fmt fmt] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-i var,val] [-L lvl] [-l path] [--msa] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-v ...] [-X box] [-x] [-w wgt_1[,wgt_2]] in_1.nc in_2.nc [out.nc]\n");
     break;
   case ncks:
-    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr sz] [-C] [-c] [--cdl] [--cnk_byt sz] [--cnk_dmn nm,sz] [--cnk_map map] [--cnk_min min] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim] [--msa] [--no_blank] [--no_tmp_fl] [-O] [-o out.nc] [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr sz] [-C] [-c] [--cdl] [--cnk_byt sz] [--cnk_dmn nm,sz] [--cnk_map map] [--cnk_min min] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim] [--msa] [--no_blank] [--no_tmp_fl] [-O] [-o out.nc] [...]
     break;
   case ncpdq:
     opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [-a ...] [--bfr sz] [-C] [-c] [--cnk_byt sz] [--cnk_dmn nm,sz] [--cnk_map map] [--cnk_min min] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [-M pck_map] [--mrd] [--msa] [--no_tmp_fl] [-O] [-o out.nc] [-P pck_plc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [--unn] [-U] [-v ...] [-X box] [-x] in.nc [out.nc]\n");
@@ -1151,6 +1151,7 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"--xml_no_loc")) (void)fprintf(stdout,"    --xml_no_location\tOmit NcML location element\n");
   if(strstr(opt_sng,"--xml_spr_chr")) (void)fprintf(stdout,"    --xml_spr_chr sng\tSeparator for NcML character types\n");
   if(strstr(opt_sng,"--xml_spr_nmr")) (void)fprintf(stdout,"    --xml_spr_nmr sng\tSeparator for NcML numeric types\n");
+  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");
diff --git a/src/nco/nco_dmn_utl.c b/src/nco/nco_dmn_utl.c
index 0c7372c..a7fd82b 100644
--- a/src/nco/nco_dmn_utl.c
+++ b/src/nco/nco_dmn_utl.c
@@ -240,8 +240,6 @@ nco_dmn_xrf  /* [fnc] Crossreference xrf elements of dimension structures */
   dmn_2->xrf=dmn_1;
 } /* end nco_dmn_xrf() */
 
-
-
 int /* O [flg] Dimension exists in scope of group (if rcd != NC_NOERR) */
 nco_inq_dmn_grp_id /* [fnc] Return location and ID of named dimension in specified group */
 (const int nc_id, /* I [id] netCDF group ID */
@@ -317,7 +315,6 @@ nco_inq_dmn_grp_id /* [fnc] Return location and ID of named dimension in specifi
 
 } /* end nco_inq_dmn_grp_id */
 
-
 void 
 nco_dmn_sct_cmp   /* [fnc] Check that dims in list 2 are a subset of list 1 and that they are the same size */
 (dmn_sct ** const dim_1, /* I [sct] Dimension list 1 */
@@ -330,11 +327,9 @@ nco_dmn_sct_cmp   /* [fnc] Check that dims in list 2 are a subset of list 1 and
   int idx;
   int jdx;
 
-  for(idx=0;idx<nbr_dmn_2;idx++ ){
+  for(idx=0;idx<nbr_dmn_2;idx++){
     for(jdx=0;jdx<nbr_dmn_1;jdx++) 
-      if(!strcmp(dim_2[idx]->nm,dim_1[jdx]->nm)) {
-        break;
-      }
+      if(!strcmp(dim_2[idx]->nm,dim_1[jdx]->nm)) break;
 		 		
     if(jdx == nbr_dmn_1){
       (void)fprintf(stderr,"%s: ERROR dimension \"%s\" in second file %s is not present in first file %s\n",nco_prg_nm_get(),dim_2[idx]->nm,fl_sng_2,fl_sng_1);
@@ -348,7 +343,6 @@ nco_dmn_sct_cmp   /* [fnc] Check that dims in list 2 are a subset of list 1 and
   } /* end loop over dimensions */
 } /* end nco_dmn_sct_cmp() */
 
-
 nm_id_sct * /* O [sct] List of dimensions associated with input variable list */
 nco_dmn_lst_ass_var /* [fnc] Create list of all dimensions associated with input variable list */
 (const int nc_id, /* I [id] netCDF input-file ID */
@@ -402,7 +396,6 @@ nco_dmn_lst_ass_var /* [fnc] Create list of all dimensions associated with input
             (void)nco_inq_dimname(nc_id,idx_dmn_in,dmn_nm);
             dmn[*nbr_dmn].id=idx_dmn_in;
             dmn[*nbr_dmn].nm=(char *)strdup(dmn_nm);
-
             (*nbr_dmn)++;
           } /* end if dimension was not found in current output dimension list */
           /* ...call off the dogs for this input dimension... */
diff --git a/src/nco/nco_fl_utl.c b/src/nco/nco_fl_utl.c
index d06aa88..fe7bbe9 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -9,11 +9,6 @@
 
 #include "nco_fl_utl.h" /* File manipulation */
 
-#ifdef _MSC_VER
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h> /* MSVC sleep() */
-#endif /* !_MSC_VER */
-
 int /* O [enm] Mode flag for nco_create() call */
 nco_create_mode_mrg /* [fnc] Merge clobber mode with user-specified file format */
 (const int md_clobber, /* I [enm] Clobber mode (NC_CLOBBER or NC_NOCLOBBER) */
@@ -1069,7 +1064,7 @@ nco_fl_mk_lcl /* [fnc] Retrieve input file and return local filename */
           } /* end if */
         }else{
           /* This is appropriate place to insert invocation of shell command
-          to retrieve file asynchronously and then to return status to NCO synchronously. */
+	     to retrieve file asynchronously and then to return status to NCO synchronously. */
 
           int fl_sz_crr=-2;
           int fl_sz_ntl=-1;
@@ -1422,7 +1417,7 @@ nco_fl_open /* [fnc] Open file using appropriate buffer size hints and verbosity
   rcd+=nco_inq_format_extended(*nc_id,&fl_fmt_xtn_crr,&mode);
   if(fl_fmt_xtn_prv != nco_fmt_xtn_nil){
     /* Complain if set value of extended type does not match current type */
-    if(fl_fmt_xtn_prv != fl_fmt_xtn_crr) (void)fprintf(stderr,"%s: INFO %s reports current extended filetype = %s does not equal previous extended filetype = %s. This is expected when NCO is instructed to convert filetypes, i.e., to read from one type and write to another. It is also expected when multi-file operators receive files known to be of different types. However, it could also indicate an unexpected change in input dataset type of which the user should be cognizant.\n",nco_prg_n [...]
+    if(fl_fmt_xtn_prv != fl_fmt_xtn_crr) (void)fprintf(stderr,"%s: INFO %s reports current extended filetype = %s does not equal previous extended filetype = %s. This is expected when NCO is instructed to convert filetypes, i.e., to read from one type and write to another. And when NCO generates grids or templates (which are always netCDF3) when the input file is netCDF4. It is also expected when multi-file operators receive files known to be of different types. However, it could also in [...]
   }else{
     /* Set undefined extended file type to actual extended filetype */
     nco_fmt_xtn_set(fl_fmt_xtn_crr);
diff --git a/src/nco/nco_fl_utl.h b/src/nco/nco_fl_utl.h
index a1a044f..10cb3d7 100644
--- a/src/nco/nco_fl_utl.h
+++ b/src/nco/nco_fl_utl.h
@@ -34,6 +34,7 @@
 #endif /* !_MSC_VER */
 #ifdef _MSC_VER
 # include <process.h> /* MSVC getpid() */
+# include <windows.h> /* MSVC Sleep() */
 typedef int pid_t;
 #endif /* !_MSC_VER */
 
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 5d93bfd..15432cf 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -2167,6 +2167,8 @@ nco_grp_itr                            /* [fnc] Populate traversal table by exam
   trv_tbl->lst[idx].flg_ncs=False;                /* [flg] Group is ancestor of specified group or variable */
   trv_tbl->lst[idx].flg_nsx=False;                /* [flg] Object matches intersection criteria */
   trv_tbl->lst[idx].flg_rgr=False;                /* [flg] Regrid variable */
+  trv_tbl->lst[idx].flg_xtn=False;                /* [flg] Extensive variable */
+  trv_tbl->lst[idx].flg_mrv=False;                /* [flg] Most-Rapidly-Varying horizontal dimensions variable */ 
   trv_tbl->lst[idx].flg_rcr=False;                /* [flg] Extract group recursively */
   trv_tbl->lst[idx].flg_unn=False;                /* [flg] Object matches union criteria */
   trv_tbl->lst[idx].flg_vfp=False;                /* [flg] Variable matches full path specification */
@@ -2270,6 +2272,8 @@ nco_grp_itr                            /* [fnc] Populate traversal table by exam
     trv_tbl->lst[idx].flg_nsx=False; 
     trv_tbl->lst[idx].flg_rcr=False; 
     trv_tbl->lst[idx].flg_rgr=False; 
+    trv_tbl->lst[idx].flg_xtn=False; 
+    trv_tbl->lst[idx].flg_mrv=False;
     trv_tbl->lst[idx].flg_unn=False; 
     trv_tbl->lst[idx].flg_vfp=False; 
     trv_tbl->lst[idx].flg_vsg=False; 
@@ -5373,40 +5377,34 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
 
   nco_bool *dmn_rvr_in;            /* [flg] Reverse dimension  (Stored in GTT ) */
 
-  /* Loop table */
   for(unsigned idx_var=0;idx_var<trv_tbl->nbr;idx_var++){
     trv_sct var_trv=trv_tbl->lst[idx_var];
 
     /* Match by full variable name  */
-    if(strcmp(var_out->nm_fll,var_trv.nm_fll) == 0){
+    if(!strcmp(var_out->nm_fll,var_trv.nm_fll)){
 
       assert(var_trv.nco_typ == nco_obj_typ_var);
       assert(var_trv.flg_xtr); 
       assert(var_trv.nbr_dmn==var_out->nbr_dim);
 
       /* Transfer dimension structures to be re-ordered *from* GTT */
-
       dmn_idx_out_in=(int *)nco_malloc(var_trv.nbr_dmn*sizeof(int));
       dmn_rvr_in=(nco_bool *)nco_malloc(var_trv.nbr_dmn*sizeof(nco_bool));
 
-      /* Loop variable dimensions */
       for(int idx_dmn=0;idx_dmn<var_trv.nbr_dmn;idx_dmn++){
-
-        /* Transfer */
         dmn_idx_out_in[idx_dmn]=trv_tbl->lst[idx_var].dmn_idx_out_in[idx_dmn];
         dmn_rvr_in[idx_dmn]=trv_tbl->lst[idx_var].dmn_rvr_in[idx_dmn];
-
-      } /* Loop variable dimensions */
+      } /* !idx_dmn */
 
       /* Initialize variables to reduce indirection */
       /* NB: Number of input and output dimensions are equal for pure re-orders
-      However, keep dimension numbers in separate variables to ease relax this rule in future */
+	 However, keep dimension numbers in separate variables to ease relax this rule in future */
       dmn_in_nbr=var_in->nbr_dim;
       dmn_out_nbr=var_out->nbr_dim;
 
       /* On entry to this section of code, we assume:
-      1. var_out metadata are re-ordered
-      2. var_out->val buffer has been allocated (calling routine must do this) */
+	 1. var_out metadata are re-ordered
+	 2. var_out->val buffer has been allocated (calling routine must do this) */
 
       /* Get ready to re-order */
       /* dmn_id_out=var_out->dmn_id; */
@@ -5479,24 +5477,24 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
           dmn_out_map[dmn_out_idx]*=var_out->cnt[dmn_idx];
 
       /* There is more than one method to re-order dimensions
-      Output dimensionality is known in advance, unlike nco_var_avg()
-      Hence outer loop may be over dimensions or over elements
-      Method 1: Loop over input elements 
-      1a. Loop over 1-D input array offsets
-      1b. Invert 1-D input array offset to get N-D input subscripts
-      1c. Turn N-D input subscripts into N-D output subscripts
-      1d. Map N-D output subscripts to get 1-D output element
-      1e. Copy input element to output element
-      This method is simplified from method used in nco_var_avg()
-      Method 2: Loop over input dimensions
-      1a. Loop over input dimensions, from slowest to fastest varying
-      1b. 
+	 Output dimensionality is known in advance, unlike nco_var_avg()
+	 Hence outer loop may be over dimensions or over elements
+	 Method 1: Loop over input elements 
+	 1a. Loop over 1-D input array offsets
+	 1b. Invert 1-D input array offset to get N-D input subscripts
+	 1c. Turn N-D input subscripts into N-D output subscripts
+	 1d. Map N-D output subscripts to get 1-D output element
+	 1e. Copy input element to output element
+	 This method is simplified from method used in nco_var_avg()
+	 Method 2: Loop over input dimensions
+	 1a. Loop over input dimensions, from slowest to fastest varying
+	 1b. 
       */
-
+      
       /* Begin Method 1: Loop over input elements */
       /* var_in_lmn is offset into 1-D array */
       for(var_in_lmn=0;var_in_lmn<var_sz;var_in_lmn++){
-
+	
         /* dmn_in_sbs are corresponding indices (subscripts) into N-D array */
         dmn_in_sbs[dmn_in_nbr_m1]=var_in_lmn%var_in_cnt[dmn_in_nbr_m1];
         for(dmn_in_idx=0;dmn_in_idx<dmn_in_nbr_m1;dmn_in_idx++){
@@ -5505,13 +5503,13 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
         } /* end loop over dimensions */
 
         /* Dimension reversal:
-        Reversing a dimension changes subscripts along that dimension
-        Consider dimension of size N indexed by [0,1,2,...k-1,k,k+1,...,N-2,N-1] 
-        Reversal maps element k to element N-1-k=N-k-1 
-        Enhance speed by using that all elements along dimension share reversal */
+	   Reversing a dimension changes subscripts along that dimension
+	   Consider dimension of size N indexed by [0,1,2,...k-1,k,k+1,...,N-2,N-1] 
+	   Reversal maps element k to element N-1-k=N-k-1 
+	   Enhance speed by using that all elements along dimension share reversal */
         for(dmn_in_idx=0;dmn_in_idx<dmn_in_nbr;dmn_in_idx++)
-          if(dmn_rvr_in[dmn_in_idx]) dmn_in_sbs[dmn_in_idx]=var_in_cnt[dmn_in_idx]-dmn_in_sbs[dmn_in_idx]-1;
-
+          if(dmn_rvr_in[dmn_in_idx]) dmn_in_sbs[dmn_in_idx]=var_in_cnt[dmn_in_idx]-dmn_in_sbs[dmn_in_idx]-1L;
+	
         /* Map variable's N-D array indices to get 1-D index into output data */
         var_out_lmn=0L;
         for(dmn_out_idx=0;dmn_out_idx<dmn_out_nbr;dmn_out_idx++) 
@@ -5529,7 +5527,7 @@ nco_var_dmn_rdr_val_trv               /* [fnc] Change dimension ordering of vari
       dmn_rvr_in=(nco_bool *)nco_free(dmn_rvr_in);
 
     } /* Match by full variable name  */
-  } /* Loop table */
+  } /* !idx_tbl */
 
   return;
 
diff --git a/src/nco/nco_rgr.c b/src/nco/nco_rgr.c
index 0dae45b..5491484 100644
--- a/src/nco/nco_rgr.c
+++ b/src/nco/nco_rgr.c
@@ -1,6 +1,6 @@
 /* $Header$ */
 
-/* Purpose: NCO utilities for regridding */
+/* Purpose: NCO regridding utilities */
 
 /* Copyright (C) 2015--2015 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
@@ -19,6 +19,7 @@ nco_rgr_ctl /* [fnc] Control regridding logic */
   const char fnc_nm[]="nco_rgr_ctl()";
 
   nco_bool flg_grd=False; /* [flg] Create SCRIP-format grid file */
+  nco_bool flg_nfr=False; /* [flg] Infer SCRIP-format grid file */
   nco_bool flg_map=False; /* [flg] Regrid with external weights */
   nco_bool flg_smf=False; /* [flg] ESMF regridding */
   nco_bool flg_tps=False; /* [flg] Tempest regridding */
@@ -26,6 +27,7 @@ nco_rgr_ctl /* [fnc] Control regridding logic */
   /* Main control branching occurs here
      Branching complexity and utility will increase as regridding features are added */
   if(rgr->flg_grd) flg_grd=True;
+  if(rgr->flg_nfr) flg_nfr=True;
   if(rgr->flg_map) flg_map=True;
   if(rgr->flg_grd_src && rgr->flg_grd_dst) flg_smf=True;
   if(rgr->drc_tps && !flg_map) flg_tps=True;
@@ -36,6 +38,9 @@ nco_rgr_ctl /* [fnc] Control regridding logic */
   /* Create SCRIP-format grid file */
   if(flg_grd) rcd=nco_grd_mk(rgr);
 
+  /* Infer SCRIP-format grid file */
+  if(flg_nfr) rcd=nco_grd_nfr(rgr);
+
   /* Regrid using external mapping weights */
   if(flg_map) rcd=nco_rgr_map(rgr,trv_tbl);
 
@@ -74,6 +79,7 @@ nco_rgr_free /* [fnc] Deallocate regridding structure */
   if(rgr->fl_out_tmp) rgr->fl_out_tmp=(char *)nco_free(rgr->fl_out_tmp);
   if(rgr->fl_map) rgr->fl_map=(char *)nco_free(rgr->fl_map);
   if(rgr->var_nm) rgr->var_nm=(char *)nco_free(rgr->var_nm);
+  if(rgr->xtn_var) rgr->xtn_var=(char **)nco_sng_lst_free(rgr->xtn_var,rgr->xtn_nbr);
 
   /* free() strings associated with grid properties */
   if(rgr->fl_grd) rgr->fl_grd=(char *)nco_free(rgr->fl_grd);
@@ -88,13 +94,17 @@ nco_rgr_free /* [fnc] Deallocate regridding structure */
   if(rgr->area_nm) rgr->area_nm=(char *)nco_free(rgr->area_nm);
   if(rgr->bnd_nm) rgr->bnd_nm=(char *)nco_free(rgr->bnd_nm);
   if(rgr->bnd_tm_nm) rgr->bnd_tm_nm=(char *)nco_free(rgr->bnd_tm_nm);
-  if(rgr->col_nm) rgr->col_nm=(char *)nco_free(rgr->col_nm);
+  if(rgr->col_nm_in) rgr->col_nm_in=(char *)nco_free(rgr->col_nm_in);
+  if(rgr->col_nm_out) rgr->col_nm_out=(char *)nco_free(rgr->col_nm_out);
+  if(rgr->frc_nm) rgr->frc_nm=(char *)nco_free(rgr->frc_nm);
   if(rgr->lat_bnd_nm) rgr->lat_bnd_nm=(char *)nco_free(rgr->lat_bnd_nm);
-  if(rgr->lat_nm) rgr->lat_nm=(char *)nco_free(rgr->lat_nm);
+  if(rgr->lat_nm_in) rgr->lat_nm_in=(char *)nco_free(rgr->lat_nm_in);
+  if(rgr->lat_nm_out) rgr->lat_nm_out=(char *)nco_free(rgr->lat_nm_out);
   if(rgr->lat_vrt_nm) rgr->lat_vrt_nm=(char *)nco_free(rgr->lat_vrt_nm);
   if(rgr->lat_wgt_nm) rgr->lat_wgt_nm=(char *)nco_free(rgr->lat_wgt_nm);
   if(rgr->lon_bnd_nm) rgr->lon_bnd_nm=(char *)nco_free(rgr->lon_bnd_nm);
-  if(rgr->lon_nm) rgr->lon_nm=(char *)nco_free(rgr->lon_nm);
+  if(rgr->lon_nm_in) rgr->lon_nm_in=(char *)nco_free(rgr->lon_nm_in);
+  if(rgr->lon_nm_out) rgr->lon_nm_out=(char *)nco_free(rgr->lon_nm_out);
   if(rgr->lon_vrt_nm) rgr->lon_vrt_nm=(char *)nco_free(rgr->lon_vrt_nm);
   if(rgr->vrt_nm) rgr->vrt_nm=(char *)nco_free(rgr->vrt_nm);
 
@@ -116,7 +126,9 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
  char * const rgr_grd_dst, /* I [sng] File containing destination grid */
  char * const rgr_map, /* I [sng] File containing mapping weights from source to destination grid */
  char * const rgr_var, /* I [sng] Variable for special regridding treatment */
- const double wgt_vld_thr) /* I [frc] Weight threshold for valid destination value */
+ const double wgt_vld_thr, /* I [frc] Weight threshold for valid destination value */
+ char **xtn_var, /* [sng] I Extensive variables */
+ const int xtn_nbr) /* [nbr] I Number of extensive variables */
 {
   /* Purpose: Initialize regridding structure */
      
@@ -154,6 +166,9 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
 
   rgr->var_nm=rgr_var; /* [sng] Variable for special regridding treatment */
   
+  rgr->xtn_var=xtn_var; /* [sng] Extensive variables */
+  rgr->xtn_nbr=xtn_nbr; /* [nbr] Number of extensive variables */
+
   /* Did user explicitly request regridding? */
   if(rgr_arg_nbr > 0 || rgr_grd_src != NULL || rgr_grd_dst != NULL || rgr_map != NULL) rgr->flg_usr_rqs=True;
 
@@ -189,6 +204,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
   } /* endif */
   
   /* Parse extended kvm options */
+  int cnv_nbr; /* [nbr] Number of elements converted by sscanf() */
   int rgr_arg_idx; /* [idx] Index over rgr_arg (i.e., separate invocations of "--rgr var1[,var2]=val") */
   int rgr_var_idx; /* [idx] Index over rgr_lst (i.e., all names explicitly specified in all "--rgr var1[,var2]=val" options) */
   int rgr_var_nbr=0;
@@ -225,29 +241,40 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
   rgr->area_nm=NULL; /* [sng] Name of variable containing gridcell area */
   rgr->bnd_nm=NULL; /* [sng] Name of dimension to employ for spatial bounds */
   rgr->bnd_tm_nm=NULL; /* [sng] Name of dimension to employ for temporal bounds */
-  rgr->col_nm=NULL; /* [sng] Name of horizontal spatial dimension on unstructured grid */
+  rgr->col_nm_in=NULL; /* [sng] Name to recognize as input horizontal spatial dimension on unstructured grid */
+  rgr->col_nm_out=NULL; /* [sng] Name of horizontal spatial output dimension on unstructured grid */
+  rgr->frc_nm=NULL; /* [sng] Name of variable containing gridcell fraction */
   rgr->lat_bnd_nm=NULL; /* [sng] Name of rectangular boundary variable for latitude */
-  rgr->lat_nm=NULL; /* [sng] Name of dimension to recognize as latitude */
+  rgr->lat_nm_in=NULL; /* [sng] Name of input dimension to recognize as latitude */
+  rgr->lat_nm_out=NULL; /* [sng] Name of output dimension for latitude */
   rgr->lat_vrt_nm=NULL; /* [sng] Name of non-rectangular boundary variable for latitude */
   rgr->lat_wgt_nm=NULL; /* [sng] Name of variable containing latitude weights */
   rgr->lon_bnd_nm=NULL; /* [sng] Name of rectangular boundary variable for longitude */
-  rgr->lon_nm=NULL; /* [sng] Name of dimension to recognize as longitude */
+  rgr->lon_nm_in=NULL; /* [sng] Name of dimension to recognize as longitude */
+  rgr->lon_nm_out=NULL; /* [sng] Name of output dimension for longitude */
   rgr->lon_vrt_nm=NULL; /* [sng] Name of non-rectangular boundary variable for longitude */
   rgr->vrt_nm=NULL; /* [sng] Name of dimension to employ for vertices */
 
   /* Initialize key-value properties used in grid generation */
   rgr->fl_grd=NULL; /* [sng] Name of grid file to create */
+  rgr->fl_skl=NULL; /* [sng] Name of skeleton data file to create */
+  rgr->flg_crv=False; /* [flg] Use curvilinear coordinates */
   rgr->flg_grd=False; /* [flg] Create SCRIP-format grid file */
+  rgr->flg_nfr=False; /* [flg] Infer SCRIP-format grid file */
   rgr->grd_ttl=strdup("None given (supply with --rgr grd_ttl=\"Grid Title\")"); /* [enm] Grid title */
   rgr->grd_typ=nco_grd_2D_eqa; /* [enm] Grid type */
+  rgr->idx_dbg=0; /* [idx] Index of gridcell for debugging */
   rgr->lat_typ=nco_grd_lat_eqa; /* [enm] Latitude grid type */
   rgr->lon_typ=nco_grd_lon_Grn_ctr; /* [enm] Longitude grid type */
   rgr->lat_nbr=180; /* [nbr] Number of latitudes in destination grid */
   rgr->lon_nbr=360; /* [nbr] Number of longitudes in destination grid */
+  rgr->lat_crv=0.0; /* [dgr] Latitudinal  curvilinearity */
+  rgr->lon_crv=0.0; /* [dgr] Longitudinal curvilinearity */
   rgr->lat_sth=NC_MAX_DOUBLE; /* [dgr] Latitude of southern edge of grid */
   rgr->lon_wst=NC_MAX_DOUBLE; /* [dgr] Longitude of western edge of grid */
   rgr->lat_nrt=NC_MAX_DOUBLE; /* [dgr] Latitude of northern edge of grid */
   rgr->lon_est=NC_MAX_DOUBLE; /* [dgr] Longitude of eastern edge of grid */
+  rgr->tst=0L; /* [enm] Generic key for testing (undocumented) */
   
   /* Parse key-value properties */
   char *sng_cnv_rcd=NULL_CEWI; /* [sng] strtol()/strtoul() return code */
@@ -256,48 +283,96 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
       rgr->fl_grd=(char *)strdup(rgr_lst[rgr_var_idx].val);
       rgr->flg_grd=True;
       continue;
-    } /* endif */
+    } /* !grid */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"skl")){
+      rgr->fl_skl=(char *)strdup(rgr_lst[rgr_var_idx].val);
+      rgr->flg_grd=True;
+      continue;
+    } /* !skl */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"curvilinear") || !strcasecmp(rgr_lst[rgr_var_idx].key,"crv")){
+      rgr->flg_crv=True;
+      continue;
+    } /* !curvilinear */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"infer") || !strcasecmp(rgr_lst[rgr_var_idx].key,"nfr")){
+      rgr->flg_nfr=True;
+      continue;
+    } /* !infer */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"grd_ttl")){
       if(rgr->grd_ttl) rgr->grd_ttl=(char *)nco_free(rgr->grd_ttl);
       rgr->grd_ttl=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !grd_ttl */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"idx_dbg")){
+      rgr->idx_dbg=strtol(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
+      if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtol",sng_cnv_rcd);
+      continue;
+    } /* !idx_dbg */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"latlon")){
+      cnv_nbr=sscanf(rgr_lst[rgr_var_idx].val,"%ld,%ld",&rgr->lat_nbr,&rgr->lon_nbr);
+      assert(cnv_nbr == 2);
+      continue;
+    } /* !latlon */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lonlat")){
+      cnv_nbr=sscanf(rgr_lst[rgr_var_idx].val,"%ld,%ld",&rgr->lon_nbr,&rgr->lat_nbr);
+      assert(cnv_nbr == 2);
+      continue;
+    } /* !lonlat */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nbr")){
       rgr->lat_nbr=strtol(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtol",sng_cnv_rcd);
       continue;
-    } /* endif */
+    } /* !lat_nbr */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_nbr")){
       rgr->lon_nbr=strtol(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtol",sng_cnv_rcd);
       continue;
-    } /* endif */
+    } /* !lon_nbr */
+    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);
+      continue;
+    } /* !snwe */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"wesn")){
+      cnv_nbr=sscanf(rgr_lst[rgr_var_idx].val,"%lf,%lf,%lf,%lf",&rgr->lon_wst,&rgr->lon_est,&rgr->lat_sth,&rgr->lat_nrt);
+      assert(cnv_nbr == 4);
+      continue;
+    } /* !wesn */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_crv")){
+      rgr->lat_crv=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
+      if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
+      continue;
+    } /* !lat_crv */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_crv")){
+      rgr->lon_crv=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
+      if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
+      continue;
+    } /* !lon_crv */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_sth")){
       rgr->lat_sth=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
       //      rgr->lat_typ=nco_grd_lat_bb;
       continue;
-    } /* endif */
+    } /* !lat_sth */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_wst")){
       rgr->lon_wst=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
       rgr->lon_typ=nco_grd_lon_bb;
       continue;
-    } /* endif */
+    } /* !lon_wst */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nrt")){
       rgr->lat_nrt=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
       //rgr->lat_typ=nco_grd_lat_bb;
       continue;
-    } /* endif */
+    } /* !lat_nrt */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_est")){
       rgr->lon_est=strtod(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd);
       if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtod",sng_cnv_rcd);
       rgr->lon_typ=nco_grd_lon_bb;
       continue;
-    } /* endif */
+    } /* !lon_est */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_typ")){
-      if(!strcasecmp(rgr_lst[rgr_var_idx].val,"cap") || !strcasecmp(rgr_lst[rgr_var_idx].val,"fv") || !strcasecmp(rgr_lst[rgr_var_idx].val,"fix")){
+      if(!strcasecmp(rgr_lst[rgr_var_idx].val,"cap") || !strcasecmp(rgr_lst[rgr_var_idx].val,"fv") || !strcasecmp(rgr_lst[rgr_var_idx].val,"fix") || !strcasecmp(rgr_lst[rgr_var_idx].val,"yarmulke")){
 	rgr->lat_typ=nco_grd_lat_fv;
 	rgr->grd_typ=nco_grd_2D_fv;
       }else if(!strcasecmp(rgr_lst[rgr_var_idx].val,"eqa") || !strcasecmp(rgr_lst[rgr_var_idx].val,"rgl") || !strcasecmp(rgr_lst[rgr_var_idx].val,"unf") || !strcasecmp(rgr_lst[rgr_var_idx].val,"uni")){
@@ -308,7 +383,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
 	rgr->grd_typ=nco_grd_2D_gss;
       }else abort();
       continue;
-    } /* endif */
+    } /* !lat_typ */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_typ")){
       if(!strcasecmp(rgr_lst[rgr_var_idx].val,"180_wst"))
 	rgr->lon_typ=nco_grd_lon_180_wst;
@@ -320,74 +395,104 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
 	rgr->lon_typ=nco_grd_lon_Grn_ctr;
       else abort();
       continue;
-    } /* endif */
+    } /* !lon_typ */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"area_nm")){
       rgr->area_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !area_nm */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"bnd_nm")){
       rgr->bnd_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !bnd_nm */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"bnd_tm_nm")){
       rgr->bnd_tm_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
-    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"col_nm")){
-      rgr->col_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
+    } /* !bnd_tm_nm */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"col_nm_in") || !strcasecmp(rgr_lst[rgr_var_idx].key,"col_nm")){
+      rgr->col_nm_in=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !col_nm_in */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"col_nm_out")){
+      rgr->col_nm_out=(char *)strdup(rgr_lst[rgr_var_idx].val);
+      continue;
+    } /* !col_nm_out */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"frc_nm")){
+      rgr->frc_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
+      continue;
+    } /* !frc_nm */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_bnd_nm")){
       rgr->lat_bnd_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
-    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nm")){
-      rgr->lat_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
+    } /* !lat_bnd_nm */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nm_in") || !strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nm")){
+      rgr->lat_nm_in=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !lat_nm_in */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_nm_out")){
+      rgr->lat_nm_out=(char *)strdup(rgr_lst[rgr_var_idx].val);
+      continue;
+    } /* !lat_nm_out */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_vrt_nm")){
       rgr->lat_vrt_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !lat_vrt_nm */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lat_wgt_nm")){
       rgr->lat_wgt_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !lat_wgt_nm */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_bnd_nm")){
       rgr->lon_bnd_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
-    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_nm")){
-      rgr->lon_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
+    } /* !lon_bnd_nm */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_nm_in") || !strcasecmp(rgr_lst[rgr_var_idx].key,"lon_nm")){
+      rgr->lon_nm_in=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !lon_nm_in */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_nm_out")){
+      rgr->lon_nm_out=(char *)strdup(rgr_lst[rgr_var_idx].val);
+      continue;
+    } /* !lon_nm_out */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"lon_vrt_nm")){
       rgr->lon_vrt_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !lon_vrt_nm */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"tst")){
+      rgr->tst=strtol(rgr_lst[rgr_var_idx].val,&sng_cnv_rcd,NCO_SNG_CNV_BASE10);
+      if(*sng_cnv_rcd) nco_sng_cnv_err(rgr_lst[rgr_var_idx].val,"strtol",sng_cnv_rcd);
+      continue;
+    } /* !tst */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"vrt_nm")){
       rgr->vrt_nm=(char *)strdup(rgr_lst[rgr_var_idx].val);
       continue;
-    } /* endif */
+    } /* !vrt_nm */
     (void)fprintf(stderr,"%s: ERROR %s reports unrecognized key-value option to --rgr switch: %s\n",nco_prg_nm_get(),fnc_nm,rgr_lst[rgr_var_idx].key);
     nco_exit(EXIT_FAILURE);
   } /* end for */
 
+  /* Eliminate sticky wickets: Give nfr precedence over grd */
+  if(rgr->flg_nfr && rgr->flg_grd) rgr->flg_grd=False; 
+
   /* Revert to defaults for any names not specified on command-line */
   if(!rgr->area_nm) rgr->area_nm=(char *)strdup("area"); /* [sng] Name of variable containing gridcell area */
   if(!rgr->bnd_nm) rgr->bnd_nm=(char *)strdup("nbnd"); /* [sng] Name of dimension to employ for spatial bounds */
   /* NB: CESM uses nbnd for temporal bounds. NCO defaults to nbnd for all bounds with two endpoints */
   if(!rgr->bnd_tm_nm) rgr->bnd_tm_nm=(char *)strdup("nbnd"); /* [sng] Name of dimension to employ for spatial bounds */
-  if(!rgr->col_nm) rgr->col_nm=(char *)strdup("ncol"); /* [sng] Name of horizontal spatial dimension on unstructured grid */
+  if(!rgr->col_nm_in) rgr->col_nm_in=(char *)strdup("ncol"); /* [sng] Name to recognize as input horizontal spatial dimension on unstructured grid */
+  if(!rgr->frc_nm) rgr->frc_nm=(char *)strdup("frac_b"); /* [sng] Name of variable containing gridcell fraction */
   if(!rgr->lat_bnd_nm) rgr->lat_bnd_nm=(char *)strdup("lat_bnds"); /* [sng] Name of rectangular boundary variable for latitude */
-  if(!rgr->lat_nm) rgr->lat_nm=(char *)strdup("lat"); /* [sng] Name of dimension to recognize as latitude */
+  if(!rgr->lat_nm_in) rgr->lat_nm_in=(char *)strdup("lat"); /* [sng] Name of input dimension to recognize as latitude */
   if(!rgr->lat_vrt_nm) rgr->lat_vrt_nm=(char *)strdup("lat_vertices"); /* [sng] Name of non-rectangular boundary variable for latitude */
   if(!rgr->lat_wgt_nm) rgr->lat_wgt_nm=(char *)strdup("gw"); /* [sng] Name of variable containing latitude weights */
   if(!rgr->lon_bnd_nm) rgr->lon_bnd_nm=(char *)strdup("lon_bnds"); /* [sng] Name of rectangular boundary variable for longitude */
-  if(!rgr->lon_nm) rgr->lon_nm=(char *)strdup("lon"); /* [sng] Name of dimension to recognize as longitude */
+  if(!rgr->lon_nm_in) rgr->lon_nm_in=(char *)strdup("lon"); /* [sng] Name of dimension to recognize as longitude */
   if(!rgr->lon_vrt_nm) rgr->lon_vrt_nm=(char *)strdup("lon_vertices"); /* [sng] Name of non-rectangular boundary variable for longitude */
   if(!rgr->vrt_nm) rgr->vrt_nm=(char *)strdup("nv"); /* [sng] Name of dimension to employ for vertices */
 
+  /* Derived from defaults and command-line arguments */
+  // On second thought, do no strdup() these here. This way, NULL means user never specified lon/lat-out names
+  //  if(!rgr->lat_nm_out) rgr->lat_nm_out=(char *)strdup(rgr_lat_nm_in); /* [sng] Name of output dimension for latitude */
+  //  if(!rgr->lon_nm_out) rgr->lon_nm_out=(char *)strdup(rgr_lon_nm_in); /* [sng] Name of output dimension for longitude */
+
   /* Free kvms */
   if(rgr_lst) rgr_lst=nco_kvm_lst_free(rgr_lst,rgr_var_nbr);
 
@@ -415,7 +520,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      http://www.earthsystemmodeling.org/esmf_releases/public/ESMF_6_3_0rp1/ESMF_refdoc/node3.html#sec:fileformat:scrip
 
      Conventions:
-     grid_size: Number of grid cells (product of lat*lon)
+     grid_size: Number of gridcells (product of lat*lon)
      address: Source and destination index for each link pair
      num_links: Number of unique address pairs in remapping, i.e., size of sparse matrix
      num_wgts: Number of weights per vertice for given remapping
@@ -461,6 +566,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      NCL special cases described in popRemap.ncl, e.g., at
      https://github.com/yyr/ncl/blob/master/ni/src/examples/gsun/popRemap.ncl
 
+     ESMF Regridding Status:
+     http://www.earthsystemmodeling.org/esmf_releases/last/regridding_status.html
+
      Sample regrid T42->POP43, SCRIP:
      ncks -O --map=${DATA}/scrip/rmp_T42_to_POP43_conserv.nc ${DATA}/rgr/essgcm14_clm.nc ~/foo.nc */
 
@@ -501,6 +609,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   nco_bool flg_bnd_1D_usable=False; /* [flg] Usable 1D cell vertices exist */
   
   nco_grd_2D_typ_enm nco_grd_2D_typ=nco_grd_2D_nil; /* [enm] Two-dimensional grid-type enum */
+  nco_grd_lat_typ_enm nco_grd_lat_typ=nco_grd_lat_nil; /* [enm] Latitude grid-type enum */
+  nco_grd_lon_typ_enm nco_grd_lon_typ=nco_grd_lon_nil; /* [enm] Longitude grid-type enum */
 
   nco_mpf_sct rgr_map;
 
@@ -518,7 +628,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* Identify mapping file type using string generated by weight-generator:
      ESMF_Regridder: conventions = "NCAR-CSM"
-     NCO: conventions = "fxm"
+     NCO: conventions = "fxm" (Currently NCO produces gridfiles, not mapfiles)
      SCRIP: conventions = "SCRIP"
      Tempest: Title = "TempestRemap Offline Regridding Weight Generator" */
   char *att_val;
@@ -527,7 +637,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   char cnv_sng_UC[]="Conventions"; /* Unidata standard     string (uppercase) */
   char cnv_sng_LC[]="conventions"; /* Unidata non-standard string (lowercase) */
   char cnv_sng_tps[]="Title"; /* Tempest uses "Title" not "Conventions" attribute */
-  char name0_sng[]="name0"; /* [sng] Attribute where Tempest stores least rapidly varying dimension name */
+  char name0_sng[]="name0"; /* [sng] Attribute where Tempest stores least-rapidly-varying dimension name */
   
   long att_sz;
 
@@ -595,7 +705,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     break;
   } /* end switch */
 
-  /* Now we have dimension IDs, get dimension sizes */
+  /* Use dimension IDs to get dimension sizes */
   rcd+=nco_inq_dimlen(in_id,src_grid_size_id,&rgr_map.src_grid_size);
   rcd+=nco_inq_dimlen(in_id,dst_grid_size_id,&rgr_map.dst_grid_size);
   rcd+=nco_inq_dimlen(in_id,src_grid_corners_id,&rgr_map.src_grid_corners);
@@ -671,6 +781,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(nco_rgr_typ == nco_rgr_grd_2D_to_1D || nco_rgr_typ == nco_rgr_grd_2D_to_2D) flg_grd_in_2D=True;
   if(nco_rgr_typ == nco_rgr_grd_1D_to_1D || nco_rgr_typ == nco_rgr_grd_2D_to_1D) flg_grd_out_1D=True;
   if(nco_rgr_typ == nco_rgr_grd_1D_to_2D || nco_rgr_typ == nco_rgr_grd_2D_to_2D) flg_grd_out_2D=True;
+  int dmn_nbr_hrz_crd; /* [nbr] Number of horizontal dimensions in output grid */
+  if(flg_grd_out_2D) dmn_nbr_hrz_crd=2; else dmn_nbr_hrz_crd=1;
 
   /* Obtain grid values necessary to compute output latitude and longitude coordinates */
   int area_dst_id; /* [id] Area variable ID */
@@ -737,14 +849,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int lon_psn_dst=int_CEWI; /* [idx] Ordinal position of longitude size in rectangular destination grid */
   int lat_psn_dst=int_CEWI; /* [idx] Ordinal position of latitude  size in rectangular destination grid */
   if(flg_grd_in_2D){
-    lon_psn_src=0;
+    lon_psn_src=0; /* SCRIP introduced [lon,lat] convention because more natural for Fortran */
     lat_psn_src=1;
     if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest){
       /* Until 20150814, Tempest stored [src/dst]_grid_dims as [lat,lon] unlike SCRIP's [lon,lat] order
 	 Newer behavior follows SCRIP [lon,lat] order
 	 Challenge: Support both older and newer Tempest mapfiles
-	 Tempest (unlike SCRIP and ESMF) annotates [src/dst]_grid_dims with attributes that identify axis to which each element of [src/dst]_grid_dims refers
-	 Solution: Use Tempest [src/dst]_grid_dims attributes "name0" and/or "name1" to determine if axes' positions follow old order */
+	 Tempest (unlike SCRIP and ESMF) annotates mapfile [src/dst]_grid_dims with attributes that identify axis to which each element of [src/dst]_grid_dims refers
+	 Solution: Use Tempest mapfile [src/dst]_grid_dims attributes "name0" and/or "name1" to determine if axes' positions follow old order */
       rcd=nco_inq_att_flg(in_id,dmn_sz_in_int_id,name0_sng,&att_typ,&att_sz);
       if(rcd == NC_NOERR && att_typ == NC_CHAR){
 	att_val=(char *)nco_malloc((att_sz+1L)*nco_typ_lng(att_typ));
@@ -752,8 +864,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	/* NUL-terminate attribute before using strstr() */
 	att_val[att_sz]='\0';
 	if(strstr(att_val,"lat")){
-	  lat_psn_src=0;
 	  lon_psn_src=1;
+	  lat_psn_src=0;
 	} /* !lat */
 	if(att_val) att_val=(char *)nco_free(att_val);
       } /* end rcd && att_typ */
@@ -770,8 +882,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	/* NUL-terminate attribute before using strstr() */
 	att_val[att_sz]='\0';
 	if(strstr(att_val,"lat")){
-	  lat_psn_dst=0;
 	  lon_psn_dst=1;
+	  lat_psn_dst=0;
 	} /* !lat */
 	if(att_val) att_val=(char *)nco_free(att_val);
       } /* end rcd && att_typ */
@@ -779,7 +891,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* !flg_grd_out_2D */
   const int dmn_nbr_1D=1; /* [nbr] Rank of 1-D grid variables */
   const int dmn_nbr_2D=2; /* [nbr] Rank of 2-D grid variables */
-  const int dmn_nbr_grd_max=dmn_nbr_2D; /* [nbr] Maximum rank of grid variables */
+  const int dmn_nbr_3D=3; /* [nbr] Rank of 3-D grid variables */
+  const int dmn_nbr_grd_max=dmn_nbr_3D; /* [nbr] Maximum rank of grid variables */
   double *area_out; /* [sr] Area of destination grid */
   double *frc_out=NULL; /* [frc] Fraction of destination grid */
   double *lat_bnd_out=NULL_CEWI; /* [dgr] Latitude  boundaries of rectangular destination grid */
@@ -797,6 +910,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int *msk_out=NULL; /* [flg] Mask of destination grid */
   int *dmn_sz_in_int; /* [nbr] Array of dimension sizes of source grid */
   int *dmn_sz_out_int; /* [nbr] Array of dimension sizes of destination grid */
+  long *dmn_cnt_in=NULL;
+  long *dmn_cnt_out=NULL;
   long *dmn_cnt=NULL;
   long *dmn_srt=NULL;
   long *dmn_srd=NULL;
@@ -816,21 +931,21 @@ 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);
 
-  if(nco_rgr_mpf_typ == nco_rgr_mpf_Tempest){
-    /* Check-for and workaround faulty Tempest 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 in Tempest mapfile. Attempting workaround ...\n",nco_prg_nm_get(),fnc_nm,rgr_map.src_grid_size,dmn_sz_in_int[0]);
+  /* Check-for and workaround faulty Tempest and MPAS-O 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]);
       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 in Tempest mapfile. 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 */
-  } /* !Tempest */
+  } /* !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]);
+    dmn_sz_out_int[0]=rgr_map.dst_grid_size;
+  } /* !bug */
  
   long col_nbr_in; /* [idx] Number of columns in source grid */
   long lon_nbr_in; /* [idx] Number of longitudes in rectangular source grid */
   long lat_nbr_in; /* [idx] Number of latitudes  in rectangular source grid */
+  const size_t grd_sz_in=rgr_map.src_grid_size; /* [nbr] Number of elements in single layer of input grid */
+  const size_t grd_sz_out=rgr_map.dst_grid_size; /* [nbr] Number of elements in single layer of output grid */
   if(flg_grd_in_1D){
     col_nbr_in=dmn_sz_in_int[0];
     lon_nbr_in=dmn_sz_in_int[0];
@@ -840,12 +955,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     lon_nbr_in=dmn_sz_in_int[lon_psn_src];
     lat_nbr_in=dmn_sz_in_int[lat_psn_src];
     /* Sanity-check */
-    assert(lat_nbr_in*lon_nbr_in == rgr_map.src_grid_size);
+    assert(lat_nbr_in*lon_nbr_in == (long)grd_sz_in);
   } /* !src_grid_rank */
 
   const int bnd_tm_nbr_out=2; /* [nbr] Number of boundaries for output time */
   int bnd_nbr_out=int_CEWI; /* [nbr] Number of boundaries for output time and rectangular grid coordinates, and number of vertices for output non-rectangular grid coordinates */
-  long col_nbr_out; /* [nbr] Number of columns in destination grid */
+  long col_nbr_out=long_CEWI; /* [nbr] Number of columns in destination grid */
   long lon_nbr_out=long_CEWI; /* [nbr] Number of longitudes in rectangular destination grid */
   long lat_nbr_out=long_CEWI; /* [nbr] Number of latitudes  in rectangular destination grid */
   if(flg_grd_out_1D){
@@ -853,58 +968,102 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     col_nbr_out=dmn_sz_out_int[0];
     lat_nbr_out=dmn_sz_out_int[0];
     lon_nbr_out=dmn_sz_out_int[0];
+    /* Sanity-check */
+    assert(col_nbr_out == (long)grd_sz_out);
   }else if(flg_grd_out_2D){
-    bnd_nbr_out=2; /* NB: Assumes rectangular latitude and longitude and is invalid for other quadrilaterals */
     col_nbr_out=lat_nbr_out*lon_nbr_out;
     lat_nbr_out=dmn_sz_out_int[lat_psn_dst];
     lon_nbr_out=dmn_sz_out_int[lon_psn_dst];
     /* Sanity-check */
-    assert(lat_nbr_out*lon_nbr_out == rgr_map.dst_grid_size);
+    assert(lat_nbr_out*lon_nbr_out == (long)grd_sz_out);
   } /* !dst_grid_rank */
 
+  /* Ensure coordinates are in degrees not radians for simplicity and CF-compliance
+     NB: ${DATA}/scrip/rmp_T42_to_POP43_conserv.nc has [xy]?_a in degrees and [xy]?_b in radians! */
+  nco_bool flg_crd_rdn=False; /* [flg] Destination coordinates are in radians not degrees */
+  char unt_sng[]="units";
+  rcd=nco_inq_att_flg(in_id,dst_grd_ctr_lat_id,unt_sng,&att_typ,&att_sz);
+  if(rcd == NC_NOERR && att_typ == NC_CHAR){
+    att_val=(char *)nco_malloc((att_sz+1L)*nco_typ_lng(att_typ));
+    rcd+=nco_get_att(in_id,dst_grd_ctr_lat_id,unt_sng,att_val,att_typ);
+    /* NUL-terminate attribute before using strstr() */
+    att_val[att_sz]='\0';
+    /* Match "radian" and "radians" */
+    if(strstr(att_val,"radian")) flg_crd_rdn=True;
+    if(att_val) att_val=(char *)nco_free(att_val);
+  } /* end rcd && att_typ */
+
+  nco_bool flg_grd_out_crv=False; /* [flg] Curvilinear coordinates */
+  nco_bool flg_grd_out_rct=False; /* [flg] Rectangular coordinates */
+  const nc_type crd_typ_out=NC_DOUBLE;
+  if(flg_grd_out_2D){
+    lon_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
+    lat_ctr_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
+    lon_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
+    lat_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*grd_sz_out*nco_typ_lng(crd_typ_out));
+
+    dmn_srt[0]=0L;
+    dmn_cnt[0]=grd_sz_out;
+    rcd=nco_get_vara(in_id,dst_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_out,crd_typ_out);
+    rcd=nco_get_vara(in_id,dst_grd_ctr_lat_id,dmn_srt,dmn_cnt,lat_ctr_out,crd_typ_out);
+    dmn_srt[0]=dmn_srt[1]=0L;
+    dmn_cnt[0]=grd_sz_out;
+    dmn_cnt[1]=rgr_map.dst_grid_corners;
+    rcd=nco_get_vara(in_id,dst_grd_crn_lon_id,dmn_srt,dmn_cnt,lon_crn_out,crd_typ_out);
+    rcd=nco_get_vara(in_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_crn_out,crd_typ_out);
+
+    /* User may specify curvilinear grid (with --rgr crv='y'). If not specified, manually test output grid for curvilinearity... */
+    flg_grd_out_crv=rgr->flg_crv; /* [flg] Curvilinear coordinates */
+    if(flg_grd_out_crv){
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid specified to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
+    }else{
+      long idx_tst=long_CEWI; /* [idx] Index of first latitude or longitude */
+      for(idx=0;idx<(long)grd_sz_out;idx++){
+	if(idx%lon_nbr_out == 0) idx_tst=idx;
+	if(lat_ctr_out[idx] != lat_ctr_out[idx_tst]) break;
+	// (void)fprintf(stdout,"%s: DEBUG lat_ctr_out[%li] = %g, lat_ctr_out[%li] = %g\n",nco_prg_nm_get(),idx,lat_ctr_out[idx],idx_tst,lat_ctr_out[idx_tst]);
+	/* fxm: also test lon */
+      } /* !rectangular */
+      if(idx != (long)grd_sz_out) flg_grd_out_crv=True; else flg_grd_out_rct=True;
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid detected to be %s\n",nco_prg_nm_get(),flg_grd_out_crv ? "Curvilinear" : "Rectangular");
+    } /* !flg_grd_out_crv */
+
+    if(flg_grd_out_crv) bnd_nbr_out=rgr_map.dst_grid_corners;
+    if(flg_grd_out_rct) bnd_nbr_out=2; /* NB: Assumes rectangular latitude and longitude and is invalid for other quadrilaterals */
+  } /* !flg_grd_out_2D */
+
   if(nco_dbg_lvl_get() >= nco_dbg_scl){
     (void)fprintf(stderr,"%s: INFO %s grid conversion type = %s with expected input and prescribed output grid sizes: ",nco_prg_nm_get(),fnc_nm,nco_rgr_grd_sng(nco_rgr_typ));
     (void)fprintf(stderr,"lat_in = %li, lon_in = %li, col_in = %li, lat_out = %li, lon_out = %li, col_out = %li\n",lat_nbr_in,lon_nbr_in,col_nbr_in,lat_nbr_out,lon_nbr_out,col_nbr_out);
   } /* endif dbg */
 
   /* Allocate space for and obtain coordinates */
-  const nc_type crd_typ_out=NC_DOUBLE;
   if(flg_grd_out_1D){
     lon_ctr_out=(double *)nco_malloc(col_nbr_out*nco_typ_lng(crd_typ_out));
     lat_ctr_out=(double *)nco_malloc(col_nbr_out*nco_typ_lng(crd_typ_out));
     lon_bnd_out=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
     lat_bnd_out=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
   } /* !flg_grd_out_1D */
-  if(flg_grd_out_2D){
+
+  if(flg_grd_out_rct){
+    if(lat_ctr_out) lat_ctr_out=(double *)nco_free(lat_ctr_out);
+    if(lon_ctr_out) lon_ctr_out=(double *)nco_free(lon_ctr_out);
+    if(lat_crn_out) lat_crn_out=(double *)nco_free(lat_crn_out);
+    if(lon_crn_out) lon_crn_out=(double *)nco_free(lon_crn_out);
     lon_ctr_out=(double *)nco_malloc(lon_nbr_out*nco_typ_lng(crd_typ_out));
     lat_ctr_out=(double *)nco_malloc(lat_nbr_out*nco_typ_lng(crd_typ_out));
-    lat_wgt_out=(double *)nco_malloc(lat_nbr_out*nco_typ_lng(crd_typ_out));
     lon_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*lon_nbr_out*nco_typ_lng(crd_typ_out));
     lat_crn_out=(double *)nco_malloc(rgr_map.dst_grid_corners*lat_nbr_out*nco_typ_lng(crd_typ_out));
+    lat_wgt_out=(double *)nco_malloc(lat_nbr_out*nco_typ_lng(crd_typ_out));
     lon_ntf_out=(double *)nco_malloc((lon_nbr_out+1L)*nco_typ_lng(crd_typ_out));
     lat_ntf_out=(double *)nco_malloc((lat_nbr_out+1L)*nco_typ_lng(crd_typ_out));
     lon_bnd_out=(double *)nco_malloc(lon_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
     lat_bnd_out=(double *)nco_malloc(lat_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-  } /* !flg_grd_out_2D */
-
-  /* Be sure all coordinates are in degrees not radians for simplicity and CF-compliance
-     NB: ${DATA}/scrip/rmp_T42_to_POP43_conserv.nc has [xy]?_a in degrees and [xy]?_b in radians */
-  nco_bool flg_crd_in_rdn=False; /* [flg] Destination coordinates are in radians not degrees */
-  char unt_sng[]="units";
-  rcd=nco_inq_att_flg(in_id,dst_grd_ctr_lat_id,unt_sng,&att_typ,&att_sz);
-  if(rcd == NC_NOERR && att_typ == NC_CHAR){
-    att_val=(char *)nco_malloc((att_sz+1L)*nco_typ_lng(att_typ));
-    rcd+=nco_get_att(in_id,dst_grd_ctr_lat_id,unt_sng,att_val,att_typ);
-    /* NUL-terminate attribute before using strstr() */
-    att_val[att_sz]='\0';
-    /* Match "radian" and "radians" */
-    if(strstr(att_val,"radian")) flg_crd_in_rdn=True;
-    if(att_val) att_val=(char *)nco_free(att_val);
-  } /* end rcd && att_typ */
+  } /* !flg_grd_out_rct */
 
   /* Arrays unroll into all longitudes for first latitude, then second latitude, ...
-     Thus longitudes obtained by reading first block contiguously (unstrided)
-     Latitudes obtained by reading unrolled data with stride of lon_nbr */
+     Obtain longitudes by reading first block contiguously (unstrided)
+     Obtain latitudes by reading unrolled data with stride of lon_nbr */
   if(flg_grd_out_1D){
     dmn_srt[0]=0L;
     dmn_cnt[0]=col_nbr_out;
@@ -920,7 +1079,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     dmn_cnt[0]=col_nbr_out;
     dmn_cnt[1]=bnd_nbr_out;
     rcd=nco_get_vara(in_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,lat_bnd_out,crd_typ_out);
-    if(flg_crd_in_rdn){
+    if(flg_crd_rdn){
       for(idx=0;idx<col_nbr_out;idx++){
 	lon_ctr_out[idx]*=rdn2dgr;
 	lat_ctr_out[idx]*=rdn2dgr;
@@ -931,7 +1090,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       } /* !idx */
     } /* !rdn */
     /* Is 1D interface information usable? Yes, unless if all interfaces are zeros
-       NB: Better algorithm for "usable" is that not all interfaces any cell are equal */
+       NB: fxm Better algorithm for "usable" is that not all interfaces in any cell are equal */
     flg_bnd_1D_usable=True;
     for(idx=0;idx<col_nbr_out*bnd_nbr_out;idx++)
       if(lon_bnd_out[idx] != 0.0) break;
@@ -944,20 +1103,21 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !usable */
       
     if(nco_dbg_lvl_get() >= nco_dbg_crr){
-      for(idx=0;idx<lon_nbr_out;idx++){
-	(void)fprintf(stdout,"lon[%li] = %g, vertices = ",idx,lon_ctr_out[idx]);
-	for(bnd_idx=0;bnd_idx<bnd_nbr_out;bnd_idx++)
-	  (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lon_bnd_out[bnd_nbr_out*idx+bnd_idx],bnd_idx == bnd_nbr_out-1 ? "]\n" : ", ");
-      } /* end loop over lon */
       for(idx=0;idx<lat_nbr_out;idx++){
 	(void)fprintf(stdout,"lat[%li] = %g, vertices = ",idx,lat_ctr_out[idx]);
 	for(bnd_idx=0;bnd_idx<bnd_nbr_out;bnd_idx++)
 	  (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lat_bnd_out[bnd_nbr_out*idx+bnd_idx],bnd_idx == bnd_nbr_out-1 ? "]\n" : ", ");
       } /* end loop over lat */
+      for(idx=0;idx<lon_nbr_out;idx++){
+	(void)fprintf(stdout,"lon[%li] = %g, vertices = ",idx,lon_ctr_out[idx]);
+	for(bnd_idx=0;bnd_idx<bnd_nbr_out;bnd_idx++)
+	  (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lon_bnd_out[bnd_nbr_out*idx+bnd_idx],bnd_idx == bnd_nbr_out-1 ? "]\n" : ", ");
+      } /* end loop over lon */
     } /* endif dbg */
   } /* !flg_grd_out_1D */
 
-  if(flg_grd_out_2D){
+  if(flg_grd_out_rct){
+    /* fxm: sub-sample these from the already-read ctr/crn arrays */
     dmn_srt[0]=0L;
     dmn_cnt[0]=lon_nbr_out;
     rcd=nco_get_vara(in_id,dst_grd_ctr_lon_id,dmn_srt,dmn_cnt,lon_ctr_out,crd_typ_out);
@@ -976,29 +1136,38 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     dmn_cnt[1]=rgr_map.dst_grid_corners;
     dmn_srd[1]=1L;
     rcd=nco_get_vars(in_id,dst_grd_crn_lat_id,dmn_srt,dmn_cnt,dmn_srd,lat_crn_out,crd_typ_out);
-    if(flg_crd_in_rdn){
+    if(flg_crd_rdn){
       for(idx=0;idx<lon_nbr_out;idx++) lon_ctr_out[idx]*=rdn2dgr;
       for(idx=0;idx<lat_nbr_out;idx++) lat_ctr_out[idx]*=rdn2dgr;
       for(idx=0;idx<lon_nbr_out*rgr_map.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
       for(idx=0;idx<lat_nbr_out*rgr_map.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
     } /* !rdn */
-  } /* !flg_grd_out_2D */
+  } /* !flg_grd_out_rct */
     
+  if(flg_grd_out_crv){
+    if(flg_crd_rdn){
+      for(idx=0;idx<(long)grd_sz_out;idx++) lon_ctr_out[idx]*=rdn2dgr;
+      for(idx=0;idx<(long)grd_sz_out;idx++) lat_ctr_out[idx]*=rdn2dgr;
+      for(idx=0;idx<(long)grd_sz_out*rgr_map.dst_grid_corners;idx++) lon_crn_out[idx]*=rdn2dgr;
+      for(idx=0;idx<(long)grd_sz_out*rgr_map.dst_grid_corners;idx++) lat_crn_out[idx]*=rdn2dgr;
+    } /* !rdn */
+  } /* !flg_grd_out_crv */
+
   /* Allocate space for and obtain area, fraction, and mask, which are needed for both 1D and 2D grids */
-  area_out=(double *)nco_malloc(rgr_map.dst_grid_size*nco_typ_lng(crd_typ_out));
+  area_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.dst_grid_size;
+  dmn_cnt[0]=grd_sz_out;
   rcd=nco_get_vara(in_id,area_dst_id,dmn_srt,dmn_cnt,area_out,crd_typ_out);
 
+  frc_out=(double *)nco_malloc(grd_sz_out*nco_typ_lng(crd_typ_out));
   dmn_srt[0]=0L;
-  dmn_cnt[0]=rgr_map.dst_grid_size;
-  frc_out=(double *)nco_malloc(rgr_map.dst_grid_size*nco_typ_lng(crd_typ_out));
+  dmn_cnt[0]=grd_sz_out;
   rcd=nco_get_vara(in_id,frc_dst_id,dmn_srt,dmn_cnt,frc_out,crd_typ_out);
 
   if(msk_dst_id != NC_MIN_INT){
-    msk_out=(int *)nco_malloc(rgr_map.dst_grid_size*nco_typ_lng(NC_INT));
+    msk_out=(int *)nco_malloc(grd_sz_out*nco_typ_lng(NC_INT));
     dmn_srt[0]=0L;
-    dmn_cnt[0]=rgr_map.dst_grid_size;
+    dmn_cnt[0]=grd_sz_out;
     rcd=nco_get_vara(in_id,msk_dst_id,dmn_srt,dmn_cnt,msk_out,NC_INT);
   } /* !msk */
   
@@ -1025,13 +1194,18 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      lon_ntf_out[lon_nbr_out]=lon_ntf_out[0]+360.0;
      lat_ntf_out[lat_nbr_out]=lat_ctr_out[lat_nbr_out-1]+0.5*(lat_ctr_out[lat_nbr_out-1]-lat_ctr_out[lat_nbr_out-2]); */
 
-  if(flg_grd_out_2D){
+  if(flg_grd_out_rct){
+    double lon_spn; /* [dgr] Longitude span */
+    double lat_spn; /* [dgr] Latitude span */
+
     /* Obtain 1-D rectangular interfaces from unrolled 1-D vertice arrays */
     for(idx=0;idx<lon_nbr_out;idx++) lon_ntf_out[idx]=lon_crn_out[rgr_map.dst_grid_corners*idx];
     lon_ntf_out[lon_nbr_out]=lon_crn_out[rgr_map.dst_grid_corners*lon_nbr_out-(rgr_map.dst_grid_corners-1L)];
+    lon_spn=lon_ntf_out[lon_nbr_out]-lon_ntf_out[0];
     for(idx=0;idx<lat_nbr_out;idx++) lat_ntf_out[idx]=lat_crn_out[rgr_map.dst_grid_corners*idx];
     lat_ntf_out[lat_nbr_out]=lat_crn_out[rgr_map.dst_grid_corners*lat_nbr_out-1L];
-    
+    lat_spn=lat_ntf_out[lat_nbr_out]-lat_ntf_out[0];
+
     /* Place 1-D rectangular interfaces into 2-D coordinate boundaries */
     for(idx=0;idx<lon_nbr_out;idx++){
       lon_bnd_out[2*idx]=lon_ntf_out[idx];
@@ -1041,27 +1215,27 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       lat_bnd_out[2*idx]=lat_ntf_out[idx];
       lat_bnd_out[2*idx+1]=lat_ntf_out[idx+1];
     } /* end loop over latitude */
-  } /* !flg_grd_out_2D */
-  
-  if(flg_grd_out_2D){
+
     if(nco_dbg_lvl_get() >= nco_dbg_crr){
       for(idx=0;idx<lon_nbr_out;idx++) (void)fprintf(stdout,"lon[%li] = [%g, %g, %g]\n",idx,lon_bnd_out[2*idx],lon_ctr_out[idx],lon_bnd_out[2*idx+1]);
       for(idx=0;idx<lat_nbr_out;idx++) (void)fprintf(stdout,"lat[%li] = [%g, %g, %g]\n",idx,lat_bnd_out[2*idx],lat_ctr_out[idx],lat_bnd_out[2*idx+1]);
     } /* endif dbg */
 
-    /* Diagnose type of two-dimensional output grid by testing second latitude center against formulae */
-    nco_grd_xtn_enm nco_grd_xtn=nco_grd_xtn_glb; /* [enm] Extent of grid */
-    const double lat_ctr_tst_fv=-90.0+180.0/(lat_nbr_out-1);
-    const double lat_ctr_tst_eqa=-90.0+180.0*1.5/lat_nbr_out;
+    /* Global or regional grid? */
+    nco_grd_xtn_enm nco_grd_xtn; /* [enm] Extent of grid */
+    if(lon_spn == 360.0 && lat_spn == 180.0) nco_grd_xtn=nco_grd_xtn_glb; else nco_grd_xtn=nco_grd_xtn_rgn;
+    /* Diagnose type of latitude output grid by testing second latitude center against formulae */
+    const double lat_ctr_tst_eqa=lat_ntf_out[0]+lat_spn*1.5/lat_nbr_out;
+    const double lat_ctr_tst_fv=lat_ntf_out[0]+lat_spn/(lat_nbr_out-1);
     double lat_ctr_tst_gss;
     /* In diagnosing grids, agreement with input to single-precision is "good enough for government work"
        Hence some comparisons cast from double to float before comparison
-       20150526: T42 grid from SCRIP and related maps
+       20150526: T42 grid from SCRIP and related maps are only accurate to ~eight digits
        20150611: map_ne120np4_to_fv801x1600_bilin.150418.nc has yc_b[1600]=-89.775000006 not expected exact value lat_ctr[1]=-89.775000000000006 */
-    if((float)lat_ctr_out[1] == (float)lat_ctr_tst_eqa) nco_grd_2D_typ=nco_grd_2D_eqa;
-    if((float)lat_ctr_out[1] == (float)lat_ctr_tst_fv) nco_grd_2D_typ=nco_grd_2D_fv;
+    if((float)lat_ctr_out[1] == (float)lat_ctr_tst_eqa) nco_grd_lat_typ=nco_grd_lat_eqa;
+    if((float)lat_ctr_out[1] == (float)lat_ctr_tst_fv) nco_grd_lat_typ=nco_grd_lat_fv;
     double *wgt_Gss_out=NULL; // [frc] Gaussian weights double precision
-    if(nco_grd_2D_typ == nco_grd_2D_nil){
+    if(nco_grd_lat_typ == nco_grd_lat_nil){
       /* Check for Gaussian grid */
       double *lat_sin_out; // [frc] Sine of Gaussian latitudes double precision
       lat_sin_out=(double *)nco_malloc(lat_nbr_out*sizeof(double));
@@ -1071,263 +1245,108 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       /* Gaussian weights on output grid will be double-precision accurate
 	 Grid itself is kept as user-specified so area diagnosed by ESMF_RegridWeightGen may be slightly inconsistent with weights */
       if(nco_dbg_lvl_get() >= nco_dbg_sbr) (void)fprintf(stderr,"%s: INFO %s reports lat_ctr_out[1] = %g, lat_ctr_tst_gss = %g\n",nco_prg_nm_get(),fnc_nm,lat_ctr_out[1],lat_ctr_tst_gss);
-      if((float)lat_ctr_out[1] == (float)lat_ctr_tst_gss) nco_grd_2D_typ=nco_grd_2D_gss;
+      if((float)lat_ctr_out[1] == (float)lat_ctr_tst_gss) nco_grd_lat_typ=nco_grd_lat_gss;
       if(lat_sin_out) lat_sin_out=(double *)nco_free(lat_sin_out);
     } /* !Gaussian */
-    if(nco_grd_2D_typ == nco_grd_2D_nil){
-      /* If still of unknown type, this 2D grid may be regional (not global) and rectangular
-	 This occurs, e.g., with the RRM CONUS regional equi-angular destination grid
-	 Find latitude increment, check if apparently constant throughout grid */
-      double lat_ctr_ncr_srt; /* [dgr] First latitude increment */
-      double lat_ctr_ncr_end; /* [dgr] Last latitude increment */
-      lat_ctr_ncr_srt=lat_ctr_out[1]-lat_ctr_out[0];
-      lat_ctr_ncr_end=lat_ctr_out[lat_nbr_out-1]-lat_ctr_out[lat_nbr_out-2];
-      if(lat_ctr_ncr_srt == lat_ctr_ncr_end){
-	/* Type appears to be equi-angular in latitude, check if it is consistent with regional equi-angular grid */
-	if(lat_ctr_out[0]-lat_ctr_ncr_srt > -90.0 && lat_ctr_out[lat_nbr_out-1]+lat_ctr_ncr_end < 90.0){
-	  if((float)(lat_ctr_out[0]+((lat_nbr_out-1)*lat_ctr_ncr_srt)) == (float)lat_ctr_out[lat_nbr_out-1]){
-	    nco_grd_2D_typ=nco_grd_2D_fv;
-	    nco_grd_xtn=nco_grd_xtn_rgn;
-	  } /* !rct */
-	} /* !rgn */
-      } /* srt!=end */
-    } /* !nil */
-    if(nco_grd_2D_typ == nco_grd_2D_nil){
+    if(nco_grd_lat_typ == nco_grd_lat_nil){
       /* If still of unknown type, this 2D grid may be weird
-	 This occurs, e.g., with the POP3 destination grid
+	 This occurs, e.g., with POP3 destination grid
 	 Change gridtype from nil (which means not-yet-set) to unknown (which means none of the others matched) */
-      nco_grd_2D_typ=nco_grd_2D_unk;
+      nco_grd_lat_typ=nco_grd_lat_unk;
     } /* !nil */
-    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed output latitude grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_2D_sng(nco_grd_2D_typ));
+
+    /* Currently grd_lat_typ and grd_2D_typ are equivalent, though that may be relaxed in future */
+    if(nco_grd_lat_typ == nco_grd_lat_unk) nco_grd_2D_typ=nco_grd_2D_unk;
+    else if(nco_grd_lat_typ == nco_grd_lat_gss) nco_grd_2D_typ=nco_grd_2D_gss;
+    else if(nco_grd_lat_typ == nco_grd_lat_fv) nco_grd_2D_typ=nco_grd_2D_fv;
+    else if(nco_grd_lat_typ == nco_grd_lat_eqa) nco_grd_2D_typ=nco_grd_2D_eqa;
+    else assert(False);
+
+    if(nco_grd_lon_typ == nco_grd_lon_nil){
+      /* NB: Longitude grid diagnosis is susceptible to mistakes when input mapfile embeds common faulty grids, e.g., ACME *150418* FV maps
+	 map_ne30np4_to_fv129x256_aave.150418.nc is diagnosed as regional grid of unknown type because of input grid flaws
+	 map_ne30np4_to_fv129x256_aave.20150901.nc is (correctly) diagnosed as global grid of with lon_Grn_ctr */
+      if(     (float)lon_ctr_out[0] ==   0.0 && (float)lon_ctr_out[1] == (float)(lon_ctr_out[0]+lon_spn/lon_nbr_out)) nco_grd_lon_typ=nco_grd_lon_Grn_ctr;
+      else if((float)lon_ctr_out[0] == 180.0 && (float)lon_ctr_out[1] == (float)(lon_ctr_out[0]+lon_spn/lon_nbr_out)) nco_grd_lon_typ=nco_grd_lon_180_ctr;
+      else if((float)lon_ntf_out[0] ==   0.0 && (float)lon_ntf_out[1] == (float)(lon_ntf_out[0]+lon_spn/lon_nbr_out)) nco_grd_lon_typ=nco_grd_lon_Grn_wst;
+      else if((float)lon_ntf_out[0] == 180.0 && (float)lon_ntf_out[1] == (float)(lon_ntf_out[0]+lon_spn/lon_nbr_out)) nco_grd_lon_typ=nco_grd_lon_180_wst;
+      else if((float)lon_ctr_out[1] == (float)(lon_ctr_out[0]+lon_spn/lon_nbr_out)) nco_grd_lon_typ=nco_grd_lon_bb;
+      else nco_grd_lon_typ=nco_grd_lon_unk;
+    } /* !nco_grd_lon_typ */
+
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed output latitude grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_lat_sng(nco_grd_lat_typ));
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed output longitude grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_lon_sng(nco_grd_lon_typ));
     if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed output grid-extent: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_xtn_sng(nco_grd_xtn));
     
-    switch(nco_grd_2D_typ){
-    case nco_grd_2D_eqa:
-    case nco_grd_2D_fv:
+    switch(nco_grd_lat_typ){
+    case nco_grd_lat_eqa:
+    case nco_grd_lat_fv:
       for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_out[idx]=sin(dgr2rdn*lat_bnd_out[2*idx+1])-sin(dgr2rdn*lat_bnd_out[2*idx]);
       break;
-    case nco_grd_2D_gss:
+    case nco_grd_lat_gss:
       for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_out[idx]=wgt_Gss_out[idx];
-      break;
       if(wgt_Gss_out) wgt_Gss_out=(double *)nco_free(wgt_Gss_out);
-    case nco_grd_2D_unk:
+      break;
+    case nco_grd_lat_unk:
       for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_out[idx]=0.0;
-      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: WARNING %s reports unknown output latitude grid-type\n",nco_prg_nm_get(),fnc_nm);
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: WARNING %s reports unknown output latitude grid-type. Unable to guess what latitude weights should be.\n",nco_prg_nm_get(),fnc_nm);
       break;
     default:
       nco_dfl_case_generic_err(); break;
-    } /* end nco_grd_2D_typ switch */
+    } /* end nco_grd_lat_typ switch */
     
     /* Fuzzy test of latitude weight normalization */
     double lat_wgt_ttl_xpc; /* [frc] Expected sum of latitude weights */
     lat_wgt_ttl=0.0;
     for(idx=0;idx<lat_nbr_out;idx++) lat_wgt_ttl+=lat_wgt_out[idx];
     lat_wgt_ttl_xpc=sin(dgr2rdn*lat_bnd_out[2*(lat_nbr_out-1)+1])-sin(dgr2rdn*lat_bnd_out[0]);
-    if(nco_grd_2D_typ != nco_grd_2D_unk) assert(1.0-lat_wgt_ttl/lat_wgt_ttl_xpc < eps_rlt);
-  } /* !flg_grd_out_2D */
+    if(nco_grd_lat_typ != nco_grd_lat_unk) assert(1.0-lat_wgt_ttl/lat_wgt_ttl_xpc < eps_rlt);
+  } /* !flg_grd_out_rct */
     
   /* When possible, ensure area_out is non-zero
      20150722: ESMF documentation says "The grid area array is only output when the conservative remapping option is used"
-     Actually, ESMF does (always?) output area, but area==0.0 unless conservative remapping is used
-     20150721: ESMF bilinear interpolation map ${DATA}/maps/map_ne30np4_to_fv257x512_bilin.150418.nc has area==0.0
-     20150710: Tempest regionally refined grids like bilinearly interpolated CONUS for ACME RRM has area_out==0
-     20150821: ESMF always outputs area_out=0.0 for bilinear interpolation
+     Actually, ESMF does (always?) output area, but area == 0.0 unless conservative remapping is used
+     20150721: ESMF bilinear interpolation map ${DATA}/maps/map_ne30np4_to_fv257x512_bilin.150418.nc has area == 0.0
+     20150710: Tempest regionally refined grids like bilinearly interpolated CONUS for ACME RRM has area_out == 0
+     20150821: ESMF always outputs area_out == 0.0 for bilinear interpolation
      Check whether NCO must diagnose and provide its own area_out */
   /* If area_out contains any zero... */
-  for(idx=0;idx<rgr_map.dst_grid_size;idx++)
+  for(idx=0;idx<(long)grd_sz_out;idx++)
     if(area_out[idx] == 0.0) break;
-  if(idx != rgr_map.dst_grid_size){
+  if(idx != (long)grd_sz_out){
     if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO Output grid detected with zero-valued output area(s) at idx = %ld (and likely others, too).\n",nco_prg_nm_get(),idx);
   } /* !zero */
 
-  for(idx=0;idx<rgr_map.dst_grid_size;idx++)
+  for(idx=0;idx<(long)grd_sz_out;idx++)
     if(area_out[idx] != 0.0) break;
-  if(idx == rgr_map.dst_grid_size){
-    (void)fprintf(stdout,"%s: INFO %s reports area_out from mapfile is everywhere zero. This is expected for bilinearly interpolated output maps produced by ESMF_RegridWeightGen. ",nco_prg_nm_get(),fnc_nm);
-    if(flg_grd_out_2D && (bnd_nbr_out == 2 || bnd_nbr_out == 4)){
-      (void)fprintf(stdout,"Since the destination grid provides cell bounds information, NCO will diagnose area (and output it as a variable named \"%s\") from the destination gridcell boundaries. NCO diagnoses quadrilateral area for rectangular output grids from a formula that assumes that cell boundaries follow arcs of constant latitude and longitude. This differs from the area of cells with boundaries that follow great circle arcs (used by, e.g., ESMF_RegridWeightGen and Tempest). To  [...]
+  if(idx == (long)grd_sz_out){
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO %s reports area_out from mapfile is everywhere zero. This is expected for bilinearly interpolated output maps produced by ESMF_RegridWeightGen. ",nco_prg_nm_get(),fnc_nm);
+    if(flg_grd_out_2D && flg_grd_out_rct && (bnd_nbr_out == 2 || bnd_nbr_out == 4)){
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"Since the destination grid provides cell bounds information, NCO will diagnose area (and output it as a variable named \"%s\") from the destination gridcell boundaries. NCO diagnoses quadrilateral area for rectangular output grids from a formula that assumes that cell boundaries follow arcs of constant latitude and longitude. This differs from the area of cells with boundaries that follow great circle arcs (used by, e.g., E [...]
+      flg_dgn_area_out=True;
+    }else if(flg_grd_out_2D && flg_grd_out_crv && (bnd_nbr_out == 2 || bnd_nbr_out == 4)){
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"Since the destination grid provides cell bounds information, NCO will diagnose area (and output it as a variable named \"%s\") from the destination gridcell boundaries. NCO diagnoses quadrilateral area for curvilinear output grids from formulae that assume that cell boundaries follow great circle arcs (as do, e.g., ESMF_RegridWeightGen and Tempest). This differs from the area of cells with boundaries that follow lines of co [...]
       flg_dgn_area_out=True;
     }else if(flg_grd_out_1D && flg_bnd_1D_usable){
-      (void)fprintf(stdout,"Since the destination grid provides cell bounds information, NCO will diagnose area (and output it as a variable name \"%s\") from the destination gridcell boundaries. NCO diagnoses spherical polygon area for unstructured output grids from formulae that assume that cell boundaries follow great circle arcs (as do, e.g., ESMFRegridWeightGen and Tempest). This differs from the area of cells with boundaries that follow lines of constant latitude or longitude. To d [...]
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"Since the destination grid provides cell bounds information, NCO will diagnose area (and output it as a variable name \"%s\") from the destination gridcell boundaries. NCO diagnoses spherical polygon area for unstructured output grids from formulae that assume that cell boundaries follow great circle arcs (as do, e.g., ESMFRegridWeightGen and Tempest). This differs from the area of cells with boundaries that follow lines of [...]
       flg_dgn_area_out=True;
     }else{ /* !1D */
-      (void)fprintf(stdout,"However, NCO cannot find enough boundary information, or it is too stupid about spherical trigonometry, to diagnose area_out. NCO will output an area variable (named \"%s\") copied from the input mapfile. This area will be everywhere zero.\n",rgr->area_nm);
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"However, NCO cannot find enough boundary information, or it is too stupid about spherical trigonometry, to diagnose area_out. NCO will output an area variable (named \"%s\") copied from the input mapfile. This area will be everywhere zero.\n",rgr->area_nm);
     } /* !2D */
   } /* !area */
       
   if(flg_dgn_area_out){
     if(flg_grd_out_1D && flg_bnd_1D_usable){
       if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"INFO: Diagnosing area_out for 1D grid\n");
-      /* Use L'Huilier's Theorem not Girard's Formula
-	 http://mathworld.wolfram.com/LHuiliersTheorem.html
-	 Girard's formula depends on pi-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
-	 semi-perimeter = half-perimeter of triangle = 0.5*(a+b+c)
-	 Spherical Excess (SE) difference between the sum of the angles of a spherical triangle area and a planar triangle area with same interior angles (which has sum equal to pi)
-	 SE is also the solid angle subtended by the spherical triangle and that's, well, astonishing and pretty cool
-	 Wikipedia shows a better SE formula for triangles which are ill-conditions L'Huillier's formula because a = b ~ 0.5c
-	 https://en.wikipedia.org/wiki/Spherical_trigonometry#Area_and_spherical_excess 
-	 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:
-	 cos(a)=u dot v=cos(theta1)*cos(phi1)*cos(theta2)*cos(phi2)+cos(theta1)*sin(phi1)*cos(theta2)*sin(phi2)+sin(theta1)*sin(theta2)
-	 Spherical law of cosines relates interior angles/arc-lengths (a,b,c) to surface angles (A,B,C) in spherical triangle:
-	 https://en.wikipedia.org/wiki/Spherical_law_of_cosines
-	 cos(a)=cos(b)*cos(c)+sin(b)*sin(c)*cos(A)
-	 cos(b)=cos(c)*cos(a)+sin(c)*sin(a)*cos(B)
-	 cos(c)=cos(a)*cos(b)+sin(a)*sin(b)*cos(C)
-	 cos(A)=[cos(a)-cos(b)*cos(c)]/[sin(b)*sin(c)]
-	 cos(B)=[cos(b)-cos(c)*cos(a)]/[sin(c)*sin(a)]
-	 cos(C)=[cos(c)-cos(a)*cos(b)]/[sin(a)*sin(b)]
-	 Bounds information on unstructured grids will use bounds_nbr=maximum(vertice_nbr)
-	 Unused vertices are stored as either repeated points (ACME does this) or, conceiveably, as missing values
-	 Given (lat,lon) for N-points algorithm to find area of spherical polygon is:
-	 1. Girard method:
-	   A. Find interior angles/arc-lengths (a,b,c,d...) using spherical law of cosines along each edge
-	   B. Apply generalized Girard formula SE_n = Sum(A_n) - (N-2) - pi
-	 2. L'Huillier method
-	   A. First three non-identical points form first triangle with sides A,B,C (first+second point define A, etc.)
-	      i. First vertice anchors all triangles
-	     ii. Last vertice of preceding triangle becomes second vertice of next triangle
-	    iii. Next non-identical point becomes last vertice of next triangle
-	     iv. Side C of previous triangle is side A of next triangle
-	   B. For each triangle, compute area with L'Huillier formula unless A = B ~ 0.5*C */
-      double *lat_bnd_rdn=NULL_CEWI; /* [rdn] Latitude  boundaries of rectangular destination grid */
-      double *lon_bnd_rdn=NULL_CEWI; /* [rdn] Longitude boundaries of rectangular destination grid */
-      double *lat_bnd_sin=NULL_CEWI; /* [frc] Sine of latitude  boundaries of rectangular destination grid */
-      double *lon_bnd_sin=NULL_CEWI; /* [frc] Sine of longitude boundaries of rectangular destination grid */
-      double *lat_bnd_cos=NULL_CEWI; /* [frc] Cosine of latitude  boundaries of rectangular destination grid */
-      double *lon_bnd_cos=NULL_CEWI; /* [frc] Cosine of longitude boundaries of rectangular destination grid */
-      lon_bnd_rdn=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      lat_bnd_rdn=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      lon_bnd_cos=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      lat_bnd_cos=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      lon_bnd_sin=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      lat_bnd_sin=(double *)nco_malloc(col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      memcpy(lat_bnd_rdn,lat_bnd_out,col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      memcpy(lon_bnd_rdn,lon_bnd_out,col_nbr_out*bnd_nbr_out*nco_typ_lng(crd_typ_out));
-      for(idx=0;idx<col_nbr_out*bnd_nbr_out;idx++){
-	lon_bnd_rdn[idx]*=dgr2rdn;
-	lat_bnd_rdn[idx]*=dgr2rdn;
-	lon_bnd_cos[idx]=cos(lon_bnd_rdn[idx]);
-	lat_bnd_cos[idx]=cos(lat_bnd_rdn[idx]);
-	lon_bnd_sin[idx]=sin(lon_bnd_rdn[idx]);
-	lat_bnd_sin[idx]=sin(lat_bnd_rdn[idx]);
-      } /* !idx */
-      double lon_dlt; /* [rdn] Longitudinal difference */
-      double lat_dlt; /* [rdn] Latitudinal difference */
-      double sin_hlf_tht; /* [frc] Sine of half angle/great circle arc theta connecting two points */
-      double ngl_a; /* [rdn] Interior angle/great circle arc a */
-      double ngl_b; /* [rdn] Interior angle/great circle arc b */
-      double ngl_c; /* [rdn] Interior angle/great circle arc c */
-      double prm_smi; /* [rdn] Semi-perimeter of triangle */
-      double xcs_sph_qtr_tan; /* [frc] Tangent of one-quarter the spherical excess */
-      double xcs_sph; /* [sr] Spherical excess */
-      int tri_nbr; /* [nbr] Number of triangles in polygon */
-      long idx_a; /* [idx] Point A 1-D index */
-      long idx_b; /* [idx] Point B 1-D index */
-      long idx_c; /* [idx] Point C 1-D index */
-      for(unsigned int col_idx=0;col_idx<col_nbr_out;col_idx++){
-	area_out[col_idx]=0.0;
-	tri_nbr=0;
-	/* A is always first vertice */
-	idx_a=bnd_nbr_out*col_idx; 
-	/* Start search for B at next vertice */
-	bnd_idx=1;
-	/* bnd_idx labels offset from point A of potential location of triangle points B and C 
-	   We know that bnd_idx(A) == 0, bnd_idx(B) < bnd_nbr_out-1, bnd_idx(C) < bnd_nbr_out */
-	while(bnd_idx<bnd_nbr_out-1){
-	  /* Only first triangle must search for B, subsequent triangles recycle previous C as current B */
-	  if(tri_nbr == 0){
-	    /* Skip repeated points that must occur when polygon has fewer than allowed vertices */
-	    while(lon_bnd_out[idx_a] == lon_bnd_out[idx_a+bnd_idx] && lat_bnd_out[idx_a] == lat_bnd_out[idx_a+bnd_idx]){
-	      /* Next vertice may not duplicate A */
-	      bnd_idx++;
-	      /* If there is no room for C then all triangles found */
-	      if(bnd_idx == bnd_nbr_out-1) break;
-	    } /* !while */
-	    /* Jump to next column when all triangles found */
-	    if(bnd_idx == bnd_nbr_out-1) break;
-	  } /* !tri_nbr */
-	  idx_b=idx_a+bnd_idx;
-	  /* Search for C at next vertice */
-	  bnd_idx++;
-	  while(lon_bnd_out[idx_b] == lon_bnd_out[idx_a+bnd_idx] && lat_bnd_out[idx_b] == lat_bnd_out[idx_a+bnd_idx]){
-	    /* Next vertice may not duplicate B */
-	    bnd_idx++;
-	    /* If there is no room for C then all triangles found */
-	    if(bnd_idx == bnd_nbr_out) break;
-	  } /* !while */
-	  /* Jump to next column when all triangles found */
-	  if(bnd_idx == bnd_nbr_out) break;
-	  idx_c=idx_a+bnd_idx;
-	  /* Valid triangle, vertices are known and labeled */
-	  tri_nbr++;
-	  /* Compute interior angle/great circle arc a for first triangle; subsequent triangles recycle previous arc c */
-	  if(tri_nbr == 1){
-           /* 20150831: Test by computing ncol=0 area in conus chevrons grid:
-	      ncks -O -D 5 -v FSNT --map ${DATA}/maps/map_ne30np4_to_fv257x512_aave.20150823.nc ${DATA}/ne30/rgr/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc ${DATA}/ne30/rgr/fv_FSNT.nc
-	      ncks -O -D 5 -v FSNT --map ${DATA}/maps/map_fv257x512_to_conusx4v1np4_chevrons_bilin.20150901.nc ${DATA}/ne30/rgr/fv_FSNT.nc ${DATA}/ne30/rgr/dogfood.nc
-	      ncks -H -s %20.15e -v area -d ncol,0 ${DATA}/ne30/rgr/dogfood.nc
-	      ncks -H -s %20.15e -v grid_area -d grid_size,0 ${DATA}/grids/conusx4v1np4_chevrons_scrip_c150815.nc
-
-	      ncol=0 on conus chevrons file:
-	      3.653857995295246e-05 raw GLL weight
-	      3.653857995294302e-05 matlab N-2 triangles
-	      3.653857995294301e-05 matlab N   triangles
-	      3.653857995294258e-05 new NCO (haversine)
-	      3.653857995289623e-05 old NCO (acos) */
-           /* Computing great circle arcs over small arcs requires care since the central angle is near 0 degrees
-	       Cosine small angles changes slowly for such angles, and leads to precision loss
-	       Use haversine formula instead of sphereical law of cosines formula
-	       https://en.wikipedia.org/wiki/Great-circle_distance */
-            /* Interior angle/great circle arc a, spherical law of cosines formula (loses precision):
-	       cos_a=lat_bnd_cos[idx_a]*lon_bnd_cos[idx_a]*lat_bnd_cos[idx_b]*lon_bnd_cos[idx_b]+
-	       lat_bnd_cos[idx_a]*lon_bnd_sin[idx_a]*lat_bnd_cos[idx_b]*lon_bnd_sin[idx_b]+
-	       lat_bnd_sin[idx_a]*lat_bnd_sin[idx_b];ngl_a=acos(cos_a); */
-	    /* Interior angle/great circle arc a, haversine formula: */
-	    lon_dlt=fabs(lon_bnd_rdn[idx_a]-lon_bnd_rdn[idx_b]);
-	    lat_dlt=fabs(lat_bnd_rdn[idx_a]-lat_bnd_rdn[idx_b]);
-	    sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_a]*lat_bnd_cos[idx_b]*pow(sin(0.5*lon_dlt),2));
-	    ngl_a=2.0*asin(sin_hlf_tht);
-          }else{
-	    ngl_a=ngl_c;
-	  } /* !tri_nbr */
-	  /* Interior angle/great circle arc b */
-	  lon_dlt=fabs(lon_bnd_rdn[idx_b]-lon_bnd_rdn[idx_c]);
-	  lat_dlt=fabs(lat_bnd_rdn[idx_b]-lat_bnd_rdn[idx_c]);
-          sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_b]*lat_bnd_cos[idx_c]*pow(sin(0.5*lon_dlt),2));
-	  ngl_b=2.0*asin(sin_hlf_tht);
-	  /* Interior angle/great circle arc c */
-	  lon_dlt=fabs(lon_bnd_rdn[idx_c]-lon_bnd_rdn[idx_a]);
-	  lat_dlt=fabs(lat_bnd_rdn[idx_c]-lat_bnd_rdn[idx_a]);
-          sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_c]*lat_bnd_cos[idx_a]*pow(sin(0.5*lon_dlt),2));
-	  ngl_c=2.0*asin(sin_hlf_tht);
-	  /* Ill-conditioned? */
-	  if(((float)ngl_a == (float)ngl_b && (float)ngl_a == (float)(0.5*ngl_c)) || /* c is half a and b */
-          ((float)ngl_b == (float)ngl_c && (float)ngl_b == (float)(0.5*ngl_a)) || /* a is half b and c */
-          ((float)ngl_c == (float)ngl_a && (float)ngl_c == (float)(0.5*ngl_b))){  /* b is half c and a */
-          (void)fprintf(stdout,"%s: WARNING %s reports col_idx = %u triangle %d is ill-conditioned. Spherical excess and thus cell area are likely inaccurate. Ask Charlie to implement SAS formula...\n",nco_prg_nm_get(),fnc_nm,col_idx,tri_nbr);
-	  } /* !ill */
-	  /* Semi-perimeter */
-	  prm_smi=0.5*(ngl_a+ngl_b+ngl_c);
-	  /* L'Huillier's formula */
-	  xcs_sph_qtr_tan=sqrt(tan(0.5*prm_smi)*tan(0.5*(prm_smi-ngl_a))*tan(0.5*(prm_smi-ngl_b))*tan(0.5*(prm_smi-ngl_c)));
-	  xcs_sph=4.0*atan(xcs_sph_qtr_tan);
-	  area_out[col_idx]+=xcs_sph;
-	  /* Begin search for next B at current C */
-	  bnd_idx=idx_c-idx_a;
-	} /* !tri_idx */
-	if(nco_dbg_lvl_get() >= nco_dbg_io) (void)fprintf(stdout,"%s: INFO %s reports col_idx = %u has %d triangles\n",nco_prg_nm_get(),fnc_nm,col_idx,tri_nbr);
-      } /* !col_idx */
-      if(lat_bnd_rdn) lat_bnd_rdn=(double *)nco_free(lat_bnd_rdn);
-      if(lon_bnd_rdn) lon_bnd_rdn=(double *)nco_free(lon_bnd_rdn);
-      if(lat_bnd_cos) lat_bnd_cos=(double *)nco_free(lat_bnd_cos);
-      if(lon_bnd_cos) lon_bnd_cos=(double *)nco_free(lon_bnd_cos);
-      if(lat_bnd_sin) lat_bnd_sin=(double *)nco_free(lat_bnd_sin);
-      if(lon_bnd_sin) lon_bnd_sin=(double *)nco_free(lon_bnd_sin);
+      /* Area of unstructured grids requires spherical trigonometry */
+      nco_sph_plg_area(lat_bnd_out,lon_bnd_out,col_nbr_out,bnd_nbr_out,area_out);
     } /* !1D */
-    if(flg_grd_out_2D && nco_grd_2D_typ != nco_grd_2D_unk){
+    if(flg_grd_out_crv){
+      if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"INFO: Diagnosing area_out for curvilinear grid\n");
+      /* Area of curvilinear grids requires spherical trigonometry */
+      nco_sph_plg_area(lat_crn_out,lon_crn_out,grd_sz_out,bnd_nbr_out,area_out);
+    } /* !flg_grd_out_crv */
+    if(flg_grd_out_rct && nco_grd_2D_typ != nco_grd_2D_unk){
       /* Mr. Enenstein and George O. Abell taught me the area of spherical zones
 	 Spherical zone area is exact and faithful to underlying rectangular equi-angular grid
 	 However, ESMF and Tempest both appear to always approximate spherical polygons as connected by great circle arcs
@@ -1338,27 +1357,36 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !spherical zones */
   } /* !flg_dgn_area_out */
 
-  /* Verify frc_out is sometimes non-zero */
-  for(idx=0;idx<rgr_map.dst_grid_size;idx++)
+  if(rgr->tst == -1){
+    /* Passing --rgr tst=-1 causes regridder to fail here 
+       This failure should cause host climo script to abort */
+    (void)fprintf(stdout,"%s: ERROR %s reports regridder instructed to fail here. This tests failure mode in climo scripts...\n",nco_prg_nm_get(),fnc_nm);
+    nco_exit(EXIT_FAILURE);
+  } /* !tst */
+
+  /* Verify frc_out is sometimes non-zero
+     ESMF: "For bilinear and patch remapping, the destination grid frac array [brac_b] is one where the grid point participates in the remapping and zero otherwise. For bilinear and patch remapping, the source grid frac array is always set to zero." */
+  for(idx=0;idx<(long)grd_sz_out;idx++)
     if(frc_out[idx] != 0.0) break;
-  if(idx == rgr_map.dst_grid_size){
+  if(idx == (long)grd_sz_out){
     (void)fprintf(stdout,"%s: ERROR %s reports frc_out contains all zeros\n",nco_prg_nm_get(),fnc_nm);
     nco_exit(EXIT_FAILURE);
   } /* !always zero */
   /* Test whether frc_out is ever zero... */
-  for(idx=0;idx<rgr_map.dst_grid_size;idx++)
+  for(idx=0;idx<(long)grd_sz_out;idx++)
     if(frc_out[idx] == 0.0) break;
   if(nco_dbg_lvl_get() >= nco_dbg_std)
-    if(idx != rgr_map.dst_grid_size)
+    if(idx != (long)grd_sz_out)
       (void)fprintf(stdout,"%s: INFO %s reports frc_out contains zero-elements (e.g., at 1D idx=%ld)\n",nco_prg_nm_get(),fnc_nm,idx);
   /* Normalizing by frc_out is redundant iff frc_out == 1.0, so we can save time without sacrificing accuracy
      However, frc_out is often (e.g., for CS <-> RLL maps) close but not equal to unity (an ESMF_Regrid_Weight_Gen issue?)
      Hence, decide whether to normalize by frc_out by diagnosing the furthest excursion of frc_out from unity */
   nco_bool flg_frc_out_one=True;
+  nco_bool flg_frc_out_wrt=False;
   double frc_out_dff_one; /* [frc] Deviation of frc_out from 1.0 */
   double frc_out_dff_one_max=0.0; /* [frc] Maximum deviation of frc_out from 1.0 */
   long idx_max_dvn; /* [idx] Index of maximum deviation from 1.0 */
-  for(idx=0;idx<rgr_map.dst_grid_size;idx++){
+  for(idx=0;idx<(long)grd_sz_out;idx++){
     frc_out_dff_one=fabs(frc_out[idx]-1.0);
     if(frc_out_dff_one > frc_out_dff_one_max){
       frc_out_dff_one_max=frc_out_dff_one;
@@ -1366,37 +1394,42 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !max */
   } /* !idx */
   if(frc_out_dff_one_max > eps_rlt) flg_frc_out_one=False;
-  nco_bool flg_frc_nrm=False;
-  if(!flg_frc_out_one && (nco_rgr_nrm_typ == nco_rgr_nrm_destarea || nco_rgr_nrm_typ == nco_rgr_nrm_none)) flg_frc_nrm=True;
-  if(flg_frc_nrm){
-    (void)fprintf(stdout,"%s: INFO %s reports global metadata specifies normalization with type = %s and frc_dst = dst_frac = frac_b = frc_out contains non-unity elements (maximum deviation of %g occurs for frc_out[%ld] = %g). Will apply \'destarea\' normalization to all regridded arrays.\n",nco_prg_nm_get(),fnc_nm,nco_rgr_nrm_sng(nco_rgr_nrm_typ),frc_out_dff_one_max,idx_max_dvn,frc_out[idx_max_dvn]);
+  nco_bool flg_frc_nrm=False; /* [flg] Must normalize by frc_out because frc_out is not always unity and specified normalization is destarea or none */
+  if(!flg_frc_out_one && nco_rgr_mth_typ == nco_rgr_mth_conservative && (nco_rgr_nrm_typ == nco_rgr_nrm_destarea || nco_rgr_nrm_typ == nco_rgr_nrm_none)){
+    flg_frc_nrm=True;
+    flg_frc_out_wrt=True;
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: INFO %s reports global metadata specifies conservative remapping with normalization of type = %s. Furthermore, destination fractions frc_dst = dst_frac = frac_b = frc_out contain non-unity elements (maximum deviation from unity of %g occurs for frc_out[%ld] = %g). Thus normalization issues cannot be ignored. Will apply \'destarea\' normalization (i.e., divide by non-zero frc_out[dst_idx]) to all regridded arrays.\n",nco_p [...]
   } /* !sometimes non-unity */
   if(flg_frc_nrm && rgr->flg_rnr){
-    (void)fprintf(stdout,"%s: ERROR %s reports manual request (with --rnr) to renormalize fields with non-unity frc_dst = dst_frac = frac_b at same time global metadata specifies normalization type = %s. Normalizing twice may be an error, depending on intent of each. Call Charlie and tell him how NCO should handle this.\n",nco_prg_nm_get(),fnc_nm,nco_rgr_nrm_sng(nco_rgr_nrm_typ));
+    (void)fprintf(stdout,"%s: ERROR %s reports manual request (with --rnr) to renormalize fields with non-unity frc_dst = dst_frac = frac_b at same time global metadata specifies normalization type = %s. Normalizing twice may be an error, depending on intent of each. Call Charlie and tell him how NCO should handle this :)\n",nco_prg_nm_get(),fnc_nm,nco_rgr_nrm_sng(nco_rgr_nrm_typ));
     nco_exit(EXIT_FAILURE);
   } /* !flg_rnr */
 
   /* Detailed summary of 2D grids now available including quality-checked coordinates and area */
-  if(flg_grd_out_2D){
-    if(nco_dbg_lvl_get() >= nco_dbg_sbr){
+  if(nco_dbg_lvl_get() >= nco_dbg_sbr){
+    lat_wgt_ttl=0.0;
+    area_out_ttl=0.0;
+    if(flg_grd_out_rct){
       (void)fprintf(stderr,"%s: INFO %s reports destination rectangular latitude grid:\n",nco_prg_nm_get(),fnc_nm);
-      lat_wgt_ttl=0.0;
-      area_out_ttl=0.0;
       for(idx=0;idx<lat_nbr_out;idx++)
 	lat_wgt_ttl+=lat_wgt_out[idx];
-      for(lat_idx=0;lat_idx<lat_nbr_out;lat_idx++)
-	for(lon_idx=0;lon_idx<lon_nbr_out;lon_idx++)
-	  area_out_ttl+=area_out[lat_idx*lon_nbr_out+lon_idx];
-      (void)fprintf(stdout,"lat_wgt_ttl = %20.15f, frc_lat_wgt = %20.15f, area_ttl = %20.15f, frc_area = %20.15f\n",lat_wgt_ttl,lat_wgt_ttl/2.0,area_out_ttl,area_out_ttl/(4.0*M_PI));
+    } /* !flg_grd_out_rct */
+    for(lat_idx=0;lat_idx<lat_nbr_out;lat_idx++)
+      for(lon_idx=0;lon_idx<lon_nbr_out;lon_idx++)
+	area_out_ttl+=area_out[lat_idx*lon_nbr_out+lon_idx];
+    (void)fprintf(stdout,"lat_wgt_ttl = %20.15f, frc_lat_wgt = %20.15f, area_ttl = %20.15f, frc_area = %20.15f\n",lat_wgt_ttl,lat_wgt_ttl/2.0,area_out_ttl,area_out_ttl/(4.0*M_PI));
+    if(flg_grd_out_rct){
       for(idx=0;idx<lon_nbr_out;idx++) (void)fprintf(stdout,"lon[%li] = [%g, %g, %g]\n",idx,lon_bnd_out[2*idx],lon_ctr_out[idx],lon_bnd_out[2*idx+1]);
       for(idx=0;idx<lat_nbr_out;idx++) (void)fprintf(stdout,"lat[%li] = [%g, %g, %g]\n",idx,lat_bnd_out[2*idx],lat_ctr_out[idx],lat_bnd_out[2*idx+1]);
       for(idx=0;idx<lat_nbr_out;idx++) (void)fprintf(stdout,"lat[%li], wgt[%li] = %20.15f, %20.15f\n",idx,idx,lat_ctr_out[idx],lat_wgt_out[idx]);
-      if(nco_dbg_lvl_get() > nco_dbg_crr)
-	for(lat_idx=0;lat_idx<lat_nbr_out;lat_idx++)
-	  for(lon_idx=0;lon_idx<lon_nbr_out;lon_idx++)
-	    (void)fprintf(stdout,"lat[%li] = %g, lon[%li] = %g, area[%li,%li] = %g\n",lat_idx,lat_ctr_out[lat_idx],lon_idx,lon_ctr_out[lon_idx],lat_idx,lon_idx,area_out[lat_idx*lon_nbr_out+lon_idx]);
-    } /* endif dbg */
-  } /* !flg_grd_out_2D */
+    } /* !flg_grd_out_rct */
+    if(nco_dbg_lvl_get() > nco_dbg_crr)
+      for(lat_idx=0;lat_idx<lat_nbr_out;lat_idx++)
+	for(lon_idx=0;lon_idx<lon_nbr_out;lon_idx++)
+	  (void)fprintf(stdout,"lat[%li] = %g, lon[%li] = %g, area[%li,%li] = %g\n",lat_idx,lat_ctr_out[lat_idx],lon_idx,lon_ctr_out[lon_idx],lat_idx,lon_idx,area_out[lat_idx*lon_nbr_out+lon_idx]);
+    assert(area_out_ttl > 0.0);
+    assert(area_out_ttl <= 4.0*M_PI);
+  } /* endif dbg */
 
   /* Allocate space for and obtain weights and addresses */
   wgt_raw=(double *)nco_malloc_dbg(rgr_map.num_links*nco_typ_lng(NC_DOUBLE),fnc_nm,"Unable to malloc() value buffer for remapping weights");
@@ -1423,7 +1456,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     rcd=nco_get_vars(in_id,wgt_raw_id,dmn_srt,dmn_cnt,dmn_srd,wgt_raw,NC_DOUBLE);
   } /* !SCRIP */
 
-  /* Optimize row/column access by pre-subtracting one to account for Fortran index offset relative to C */
+  /* Pre-subtract one from row/column addresses (stored, by convention, as Fortran indices) to optimize access with C indices */
   size_t lnk_nbr; /* [nbr] Number of links */
   size_t lnk_idx; /* [idx] Link index */
   lnk_nbr=rgr_map.num_links;
@@ -1453,15 +1486,15 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   out_id=rgr->out_id;
 
   /* Sanity check that input data file matches expectations from mapfile */
-  char *col_nm=rgr->col_nm; /* [sng] Name of horizontal spatial dimension on unstructured grid */
-  char *lat_nm=rgr->lat_nm; /* [sng] Name of dimension to recognize as latitude */
-  char *lon_nm=rgr->lon_nm; /* [sng] Name of dimension to recognize as longitude */
+  char *col_nm_in=rgr->col_nm_in; /* [sng] Name to recognize as input horizontal spatial dimension on unstructured grid */
+  char *lat_nm_in=rgr->lat_nm_in; /* [sng] Name of input dimension to recognize as latitude */
+  char *lon_nm_in=rgr->lon_nm_in; /* [sng] Name of input dimension to recognize as longitude */
   int dmn_id_col; /* [id] Dimension ID */
   int dmn_id_lat; /* [id] Dimension ID */
   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,&dmn_id_col);
+    rcd=nco_inq_dimid(in_id,col_nm_in,&dmn_id_col);
     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);
@@ -1470,14 +1503,44 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* !1D */
   if(flg_grd_in_2D){
     long lat_nbr_in_dat; /* [nbr] Number of latitudes in input datafile */
-    rcd=nco_inq_dimid(in_id,lat_nm,&dmn_id_lat);
+    rcd=nco_inq_dimid_flg(in_id,lat_nm_in,&dmn_id_lat);
+    if(rcd != NC_NOERR){
+      if((rcd=nco_inq_dimid_flg(in_id,"latitude",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("latitude");
+      else if((rcd=nco_inq_dimid_flg(in_id,"lat",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("lat"); /* CAM */
+      else if((rcd=nco_inq_dimid_flg(in_id,"Latitude",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("Latitude");
+      else if((rcd=nco_inq_dimid_flg(in_id,"Lat",&dmn_id_lat)) == NC_NOERR) lat_nm_in=strdup("Lat");
+      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,"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{
+	(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);
+      } /* !lat */
+    } /* !rcd */
     rcd=nco_inq_dimlen(in_id,dmn_id_lat,&lat_nbr_in_dat);
     if(lat_nbr_in != lat_nbr_in_dat){
       (void)fprintf(stdout,"%s: ERROR %s reports mapfile and data file dimension sizes disagree: mapfile lat_nbr_in = %ld != %ld = lat_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,lat_nbr_in,lat_nbr_in_dat);
       nco_exit(EXIT_FAILURE);
     } /* !err */
     long lon_nbr_in_dat; /* [nbr] Number of longitudes in input datafile */
-    rcd=nco_inq_dimid(in_id,lon_nm,&dmn_id_lon);
+    rcd=nco_inq_dimid_flg(in_id,lon_nm_in,&dmn_id_lon);
+    if(rcd != NC_NOERR){
+      if((rcd=nco_inq_dimid_flg(in_id,"longitude",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("longitude");
+      else if((rcd=nco_inq_dimid_flg(in_id,"lon",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("lon");
+      else if((rcd=nco_inq_dimid_flg(in_id,"Longitude",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("Longitude");
+      else if((rcd=nco_inq_dimid_flg(in_id,"Lon",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("Lon");
+      else if((rcd=nco_inq_dimid_flg(in_id,"west_east",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("west_east");
+      else if((rcd=nco_inq_dimid_flg(in_id,"west_east_stag",&dmn_id_lon)) == NC_NOERR) lon_nm_in=strdup("west_east_stag");
+      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,"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");
+      else{
+	(void)fprintf(stdout,"%s: ERROR %s reports unable to find longitude dimension in input file. Tried the usual suspects. HINT: Inform regridder of longitude dimension name with --rgr lon_nm=name\n",nco_prg_nm_get(),fnc_nm);
+	nco_exit(EXIT_FAILURE);
+      } /* !lat */
+    } /* !rcd */
     rcd=nco_inq_dimlen(in_id,dmn_id_lon,&lon_nbr_in_dat);
     if(lon_nbr_in != lon_nbr_in_dat){
       (void)fprintf(stdout,"%s: ERROR %s reports mapfile and data file dimension sizes disagree: mapfile lon_nbr_in = %ld != %ld = lon_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,lon_nbr_in,lon_nbr_in_dat);
@@ -1485,14 +1548,26 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !err */
   } /* !2D */
     
-  /* Do not extract extensive variables like lon, lat, and area
-     If necessary, create them from scratch from remap data */
-  const int var_xcl_lst_nbr=13; /* [nbr] Number of objects on exclusion list */
-  const char *var_xcl_lst[]={"/area","/gridcell_area","/gw","/lat","/latitude","/lat_bnds","/lat_vertices","/bounds_lat","/lon","/longitude","/lon_bnds","/lon_vertices","/bounds_lon"};
+  /* 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=17; /* [nbr] Number of objects on exclusion list */
+  /* Exception list source:
+     CAM, CERES, CMIP5: lat, lon
+     CAM, CMIP5: gw, lat_bnds, lon_bnds
+     CAM-SE: area
+     ESMF: gridcell_area
+     MAR: LAT, LON
+     MPAS-O: areaCell, latCell, lonCell
+     NCO: lat_vertices, lon_vertices
+     UV-CDAT regridder: bounds_lat, bounds_lon
+     WRF: XLAT, XLONG */
+  const char *var_xcl_lst[]={"/area","/gridcell_area","/gw","/LAT","/lat","/latitude","/XLAT","/lat_bnds","/lat_vertices","/bounds_lat","/LON","/lon","/longitude","/XLONG","/lon_bnds","/lon_vertices","/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 */
   int var_crt_nbr=0; /* [nbr] Number of created variables */
+  int var_xtn_nbr=0; /* [nbr] Number of extensive variables */
   unsigned int idx_tbl; /* [idx] Counter for traversal table */
   const unsigned int trv_nbr=trv_tbl->nbr; /* [idx] Number of traversal table entries */
   for(idx=0;idx<var_xcl_lst_nbr;idx++){
@@ -1526,14 +1601,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	  /* Pre-determine flags necessary during next loop */
 	  dmn_nm_cp=trv.var_dmn[dmn_idx].dmn_nm;
 	  /* fxm: generalize to include any variable containing two coordinates with "standard_name" = "latitude" and "longitude" */
-	  if(!has_lon) has_lon=!strcmp(dmn_nm_cp,lon_nm);
-	  if(!has_lat) has_lat=!strcmp(dmn_nm_cp,lat_nm);
+	  if(!has_lon) has_lon=!strcmp(dmn_nm_cp,lon_nm_in);
+	  if(!has_lat) has_lat=!strcmp(dmn_nm_cp,lat_nm_in);
 	} /* end loop over dimensions */
       } /* !flg_grd_in_2D */
       for(dmn_idx=0;dmn_idx<dmn_nbr_in;dmn_idx++){
 	dmn_nm_cp=trv.var_dmn[dmn_idx].dmn_nm;
 	/* Regrid variables containing the horizontal spatial dimension on 1D grids, and both latitude and longitude on 2D grids */
-	if(!strcmp(dmn_nm_cp,col_nm) || (has_lon && has_lat)){
+	if(!strcmp(dmn_nm_cp,col_nm_in) || (has_lon && has_lat)){
 	  trv_tbl->lst[idx_tbl].flg_rgr=True;
 	  var_rgr_nbr++;
 	  break;
@@ -1543,10 +1618,10 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	/* Not regridded, so must be omitted or copied... */
 	if(flg_grd_in_2D && (has_lon || has_lat)){
 	/* Single spatial dimensional variables on 2D input grids are likely extensive (e.g., grd_mrd_lng from bds)
-	   They can only be salvaged with explicit rules or implicit assumptions */
+	   These could be salvaged with explicit rules or implicit assumptions */
 	  trv_tbl->lst[idx_tbl].flg_xtr=False;
 	  var_xcl_nbr++;
-	  if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"%s: INFO automatically omitting (not copying or regridding from input) extensive-seeming (i.e., 1D spatial variable in 2D input grid) variable %s\n",nco_prg_nm_get(),trv_tbl->lst[idx_tbl].nm_fll);
+	  if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"%s: INFO automatically omitting (not copying or regridding from input) extensive-seeming (e.g., 1D spatial variable in 2D input grid, or 2D spatial variable without primary grid dimensions from multi-grid file (e.g., west_east_stag or south_north_stag instead of west_east or south_north)) variable %s\n",nco_prg_nm_get(),trv_tbl->lst[idx_tbl].nm_fll);
 	}else{ /* !omitted */
 	  /* Copy all variables that are not regridded or omitted */
 	  var_cpy_nbr++;
@@ -1556,6 +1631,24 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* end idx_tbl */
   if(!var_rgr_nbr) (void)fprintf(stdout,"%s: WARNING %s reports no variables fit regridding criteria. The regridder expects something to regrid, and variables not regridded are copied straight to output. HINT: If the name(s) of the input horizontal spatial dimensions to be regridded (e.g., latitude and longitude or column) do not match NCO's preset defaults (case-insensitive unambiguous forms and abbreviations of \"latitude\", \"longitude\", and \"ncol\", respectively) then change the di [...]
   
+  for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
+    trv=trv_tbl->lst[idx_tbl];
+    if(trv.flg_rgr){
+      for(int xtn_idx=0;xtn_idx<rgr->xtn_nbr;xtn_idx++){
+	/* 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
+	   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;
+	  var_xtn_nbr++;
+	  if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"%s: INFO Variable %s will be treated as extensive (summed not averaged)\n",nco_prg_nm_get(),trv.nm_fll);
+	} /* !strcmp */
+      } /* !xtn_idx */
+    } /* !flg_rgr */
+  } /* !idx_tbl */
+    
   if(nco_dbg_lvl_get() >= nco_dbg_sbr){
     for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
       trv=trv_tbl->lst[idx_tbl];
@@ -1570,6 +1663,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   char *bnd_nm_out;
   char *bnd_tm_nm_out;
   char *col_nm_out;
+  char *frc_nm_out;
   char *lat_bnd_nm_out;
   char *lat_nm_out;
   char *lat_wgt_nm;
@@ -1578,6 +1672,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int dmn_id_bnd; /* [id] Dimension ID */
   int dmn_id_bnd_tm; /* [id] Dimension ID */
   int area_out_id; /* [id] Variable ID for area */
+  int frc_out_id; /* [id] Variable ID for fraction */
   int lon_out_id; /* [id] Variable ID for longitude */
   int lat_out_id; /* [id] Variable ID for latitude */
   int lat_wgt_id; /* [id] Variable ID for latitude weight */
@@ -1585,18 +1680,20 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int lat_bnd_id; /* [id] Variable ID for lat_bnds/lat_vertices */
   int dmn_ids_out[dmn_nbr_grd_max]; /* [id] Dimension IDs array for output variable */
   long dmn_srt_out[dmn_nbr_grd_max];
-  long dmn_cnt_out[dmn_nbr_grd_max];
+  long dmn_cnt_tuo[dmn_nbr_grd_max];
 
-  /* Name output dimensions */
+  /* Name output dimensions/variables */
   area_nm_out=rgr->area_nm;
   bnd_nm_out=rgr->bnd_nm;
   bnd_tm_nm_out=rgr->bnd_tm_nm;
-  col_nm_out=rgr->col_nm;
+  frc_nm_out=rgr->frc_nm;
   lat_bnd_nm_out=rgr->lat_bnd_nm;
-  lat_nm_out=rgr->lat_nm;
   lat_wgt_nm=rgr->lat_wgt_nm;
   lon_bnd_nm_out=rgr->lon_bnd_nm;
-  lon_nm_out=rgr->lon_nm;
+  /* Use explicitly specified output names, if any, otherwise use input names (either explicitly specified or discovered by fuzzing) */
+  if(rgr->col_nm_out) col_nm_out=rgr->col_nm_out; else col_nm_out=col_nm_in;
+  if(rgr->lat_nm_out) lat_nm_out=rgr->lat_nm_out; else lat_nm_out=lat_nm_in;
+  if(rgr->lon_nm_out) lon_nm_out=rgr->lon_nm_out; else lon_nm_out=lon_nm_in;
   if(flg_grd_out_1D){
     bnd_nm_out=rgr->vrt_nm;
     lat_bnd_nm_out=rgr->lat_vrt_nm;
@@ -1662,8 +1759,33 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     var_crt_nbr++;
     (void)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);
+      var_crt_nbr++;
+    } /* !flg_frc_out_wrt */
   } /* !flg_grd_out_1D */
-  if(flg_grd_out_2D){
+  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);
+    var_crt_nbr++;
+    (void)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);
+    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);
+      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);
+    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);
+    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);
     var_crt_nbr++;
     (void)nco_def_var(out_id,lon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_lon,&lon_out_id);
@@ -1682,10 +1804,16 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     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);
     var_crt_nbr++;
-  } /* !flg_grd_out_2D */
+    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);
+      var_crt_nbr++;
+    } /* !flg_frc_out_wrt */
+  } /* !flg_grd_out_rct */
 
   /* Pre-allocate dimension ID and cnt/srt space */
   int dmn_nbr_max; /* [nbr] Maximum number of dimensions variable can have in input or output */
+  int dmn_in_fst; /* [idx] Offset of input- relative to output-dimension due to non-MRV dimension insertion */
+  //int dmn_idx_in_out_pre_rgr[dmn_nbr_max];
   rcd+=nco_inq_ndims(in_id,&dmn_nbr_max);
   dmn_nbr_max++; /* Safety in case regridding adds dimension */
   dmn_id_in=(int *)nco_malloc(dmn_nbr_max*sizeof(int));
@@ -1695,6 +1823,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* 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;
     trv=trv_tbl->lst[idx_tbl];
     if(trv.nco_typ == nco_obj_typ_var && trv.flg_xtr){
       var_nm=trv.nm;
@@ -1708,44 +1837,70 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	if(trv.flg_rgr){
 	  /* Regrid */
 	  rcd=nco_inq_vardimid(in_id,var_id_in,dmn_id_in);
+	  dmn_in_fst=0;
 	  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 */
+		(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 */
+	    } /* !flg_grd_in_1D */
+	    if(flg_grd_in_2D && (!strcmp(dmn_nm,lat_nm_in) || !strcmp(dmn_nm,lon_nm_in))){
+	      /* Are horizontal dimensions most-rapidly-varying? */
+	      if(dmn_idx != dmn_nbr_in-1 && dmn_idx != dmn_nbr_in-2){
+		/* NB: Lat/lon input grid has lat/lon in non-MRV location (expect this with, e.g., AIRS L2 grid dimension-ordering */
+		(void)fprintf(stdout,"%s: WARNING %s reports lat-lon 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 lat-lon dimension(s) that are not last two dimensions of input variable.\nHINT: Consider re-arranging input file dimensions to place horizontal dimensions last with, e.g., \'ncpdq -a time,lev,lat,lon in.nc out.nc\' prior to calling regridder\n",nco_prg_nm_get(),fnc_nm,dm [...]
+		trv_tbl->lst[idx_tbl].flg_mrv=False;
+	      } /* !dmn_idx */
+	    } /* !flg_grd_in_2D */	      
 	    if(flg_grd_out_1D){
-	      if((nco_rgr_typ == nco_rgr_grd_2D_to_1D) && (!strcmp(dmn_nm,lat_nm) || !strcmp(dmn_nm,lon_nm))){
+	      if((nco_rgr_typ == nco_rgr_grd_2D_to_1D) && (!strcmp(dmn_nm,lat_nm_in) || !strcmp(dmn_nm,lon_nm_in))){
 		/* Replace orthogonal horizontal dimensions by unstructured horizontal dimension already defined */
-		if(!strcmp(dmn_nm,lat_nm)){
+		if(!strcmp(dmn_nm,lat_nm_in)){
+		  /* Replace lat with col */
 		  dmn_id_out[dmn_idx]=dmn_id_col;
 		  dmn_cnt[dmn_idx]=col_nbr_out;
 		} /* endif lat */
-		if(!strcmp(dmn_nm,lon_nm)){
+		if(!strcmp(dmn_nm,lon_nm_in)){
+		  /* Assume non-MRV dimensions are ordered lat/lon. Replace lat with col. Shift MRV dimensions to left after deleting lon. */
 		  dmn_id_out[dmn_idx]=NC_MIN_INT;
 		  dmn_cnt[dmn_idx]=NC_MIN_INT;
 		  dmn_nbr_out--;
+		  /* Reduce output dimension position of all subsequent input dimensions by one */
+		  if(!trv_tbl->lst[idx_tbl].flg_mrv) dmn_in_fst=-1; 
 		} /* endif lon */
 	      }else{
-		/* Dimension col_nm has already been defined, replicate all other dimensions */
-		rcd=nco_inq_dimid_flg(out_id,dmn_nm,dmn_id_out+dmn_idx);
+		/* Dimension col_nm_in has already been defined as col_nm_out, replicate all other dimensions */
+		if(!strcmp(dmn_nm,col_nm_in)) rcd=nco_inq_dimid_flg(out_id,col_nm_out,dmn_id_out+dmn_idx);
+		else rcd=nco_inq_dimid_flg(out_id,dmn_nm,dmn_id_out+dmn_idx+dmn_in_fst);
 		if(rcd != NC_NOERR){
-		  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt+dmn_idx);
-		  rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt[dmn_idx],dmn_id_out+dmn_idx);
+		  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt+dmn_idx+dmn_in_fst);
+		  rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt[dmn_idx+dmn_in_fst],dmn_id_out+dmn_idx+dmn_in_fst);
 		} /* !rcd */
 	      } /* !lat && !lon */
-	    } /* !2D_to_1D */
+	    } /* !flg_grd_out_1D */
 	    if(flg_grd_out_2D){
-	      if(nco_rgr_typ == nco_rgr_grd_1D_to_2D && !strcmp(dmn_nm,col_nm)){
+	      if(nco_rgr_typ == nco_rgr_grd_1D_to_2D && !strcmp(dmn_nm,col_nm_in)){
 		/* Replace unstructured horizontal dimension by orthogonal horizontal dimensions already defined */
 		dmn_id_out[dmn_idx]=dmn_id_lat;
 		dmn_id_out[dmn_idx+1]=dmn_id_lon;
 		dmn_cnt[dmn_idx]=lat_nbr_out;
 		dmn_cnt[dmn_idx+1]=lon_nbr_out;
-		dmn_idx++;
 		dmn_nbr_out++;
+		/* Increase output dimension position of all subsequent input dimensions by one */
+		if(!trv_tbl->lst[idx_tbl].flg_mrv) dmn_in_fst=1; 
 	      }else{
-		/* Dimensions lat_nm and lon_nm have already been defined, replicate all other dimensions */
-		rcd=nco_inq_dimid_flg(out_id,dmn_nm,dmn_id_out+dmn_idx);
+		/* Dimensions lat/lon_nm_in have already been defined as lat/lon_nm_out, replicate all other dimensions */
+		if(!strcmp(dmn_nm,lat_nm_in)) rcd=nco_inq_dimid_flg(out_id,lat_nm_out,dmn_id_out+dmn_idx);
+		else if(!strcmp(dmn_nm,lon_nm_in)) rcd=nco_inq_dimid_flg(out_id,lon_nm_out,dmn_id_out+dmn_idx);
+		else rcd=nco_inq_dimid_flg(out_id,dmn_nm,dmn_id_out+dmn_idx+dmn_in_fst);
 		if(rcd != NC_NOERR){
-		  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt+dmn_idx);
-		  rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt[dmn_idx],dmn_id_out+dmn_idx);
+		  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt+dmn_idx+dmn_in_fst);
+		  rcd=nco_def_dim(out_id,dmn_nm,dmn_cnt[dmn_idx+dmn_in_fst],dmn_id_out+dmn_idx+dmn_in_fst);
 		} /* !rcd */
 	      } /* !col */
 	    } /* !1D_to_2D */
@@ -1781,7 +1936,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* Define new metadata in regridded file */
   att_nm=strdup("long_name");
-  att_val=strdup("solid angle subtended by grid cell");
+  att_val=strdup("solid angle subtended by gridcell");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=area_nm_out;
   aed_mtd.id=area_out_id;
@@ -1820,7 +1975,8 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_val) att_val=(char *)nco_free(att_val);
 
   att_nm=strdup("cell_methods");
-  att_val=strdup("lat, lon: sum");
+  att_val=(char *)nco_calloc((strlen(lat_nm_out)+strlen(lon_nm_out)+8L),sizeof(char));
+  (void)sprintf(att_val,"%s, %s: sum",lat_nm_out,lon_nm_out);
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=area_nm_out;
   aed_mtd.id=area_out_id;
@@ -1832,6 +1988,35 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_nm) att_nm=(char *)nco_free(att_nm);
   if(att_val) att_val=(char *)nco_free(att_val);
 
+  if(flg_frc_out_wrt){
+    att_nm=strdup("long_name");
+    att_val=strdup("fraction of gridcell valid on destination grid");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=frc_nm_out;
+    aed_mtd.id=frc_out_id;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,frc_out_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("cell_methods");
+    att_val=(char *)nco_calloc((strlen(lat_nm_out)+strlen(lon_nm_out)+8L),sizeof(char));
+    (void)sprintf(att_val,"%s, %s: sum",lat_nm_out,lon_nm_out);
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=frc_nm_out;
+    aed_mtd.id=frc_out_id;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,frc_out_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+  } /* !flg_frc_out_wrt */
+  
   att_nm=strdup("long_name");
   att_val=strdup("latitude");
   aed_mtd.att_nm=att_nm;
@@ -1961,32 +2146,36 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_nm) att_nm=(char *)nco_free(att_nm);
   if(att_val) att_val=(char *)nco_free(att_val);
 
-  /* UGRID Conventions define "topology" and "modulo" attributes
-     https://github.com/ugrid-conventions/ugrid-conventions/blob/master/ugrid-conventions.md */
-  att_nm=strdup("modulo");
-  double modulo=360.0;
-  aed_mtd.att_nm=att_nm;
-  aed_mtd.var_nm=lon_nm_out;
-  aed_mtd.id=lon_out_id;
-  aed_mtd.sz=1;
-  aed_mtd.type=NC_DOUBLE;
-  aed_mtd.val.dp=&modulo;
-  aed_mtd.mode=aed_create;
-  (void)nco_aed_prc(out_id,lon_out_id,aed_mtd);
-  if(att_nm) att_nm=(char *)nco_free(att_nm);
-
-  att_nm=strdup("topology");
-  att_val=strdup("circular");
-  aed_mtd.att_nm=att_nm;
-  aed_mtd.var_nm=lon_nm_out;
-  aed_mtd.id=lon_out_id;
-  aed_mtd.sz=strlen(att_val);
-  aed_mtd.type=NC_CHAR;
-  aed_mtd.val.cp=att_val;
-  aed_mtd.mode=aed_create;
-  (void)nco_aed_prc(out_id,lon_out_id,aed_mtd);
-  if(att_nm) att_nm=(char *)nco_free(att_nm);
-  if(att_val) att_val=(char *)nco_free(att_val);
+  /* UGRID Conventions define "topology" and "modulo" attributes 
+     https://github.com/ugrid-conventions/ugrid-conventions/blob/master/ugrid-conventions.md
+     My understanding is these should only be utilized for global grids */
+  if(nco_rgr_typ == nco_rgr_grd_2D_to_2D){
+    /* fxm: change this to check whether lon_spn >= 360 or nco_grd_xtn == global */
+    att_nm=strdup("modulo");
+    double modulo=360.0;
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=lon_nm_out;
+    aed_mtd.id=lon_out_id;
+    aed_mtd.sz=1;
+    aed_mtd.type=NC_DOUBLE;
+    aed_mtd.val.dp=&modulo;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,lon_out_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    
+    att_nm=strdup("topology");
+    att_val=strdup("circular");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=lon_nm_out;
+    aed_mtd.id=lon_out_id;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,lon_out_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+  } /* !nco_rgr_grd_2D_to_2D */
 
   att_nm=strdup("bounds");
   att_val=lon_bnd_nm_out;
@@ -2058,8 +2247,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(flg_grd_out_1D){
     aed_mtd_crd.var_nm=area_nm_out;
     aed_mtd_crd.id=area_out_id;
-    (void)nco_aed_prc(out_id,lat_out_id,aed_mtd_crd);
-    
+    (void)nco_aed_prc(out_id,area_out_id,aed_mtd_crd);
+
+    if(flg_frc_out_wrt){
+      aed_mtd_crd.var_nm=frc_nm_out;
+      aed_mtd_crd.id=frc_out_id;
+      (void)nco_aed_prc(out_id,frc_out_id,aed_mtd_crd);
+    } /* !flg_frc_out_wrt */
+
     aed_mtd_crd.var_nm=lat_nm_out;
     aed_mtd_crd.id=lat_out_id;
     (void)nco_aed_prc(out_id,lat_out_id,aed_mtd_crd);
@@ -2079,60 +2274,78 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   /* Write new coordinates and variables to regridded file */
   if(flg_grd_out_1D){
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=col_nbr_out;
-    (void)nco_put_vara(out_id,lat_out_id,dmn_srt_out,dmn_cnt_out,lat_ctr_out,crd_typ_out);
+    dmn_cnt_tuo[0]=col_nbr_out;
+    (void)nco_put_vara(out_id,lat_out_id,dmn_srt_out,dmn_cnt_tuo,lat_ctr_out,crd_typ_out);
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=col_nbr_out;
-    (void)nco_put_vara(out_id,lon_out_id,dmn_srt_out,dmn_cnt_out,lon_ctr_out,crd_typ_out);
+    dmn_cnt_tuo[0]=col_nbr_out;
+    (void)nco_put_vara(out_id,lon_out_id,dmn_srt_out,dmn_cnt_tuo,lon_ctr_out,crd_typ_out);
     dmn_srt_out[0]=dmn_srt_out[1]=0L;
-    dmn_cnt_out[0]=col_nbr_out;
-    dmn_cnt_out[1]=bnd_nbr_out;
-    (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt_out,dmn_cnt_out,lat_bnd_out,crd_typ_out);
+    dmn_cnt_tuo[0]=col_nbr_out;
+    dmn_cnt_tuo[1]=bnd_nbr_out;
+    (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt_out,dmn_cnt_tuo,lat_bnd_out,crd_typ_out);
     dmn_srt_out[0]=dmn_srt_out[1]=0L;
-    dmn_cnt_out[0]=col_nbr_out;
-    dmn_cnt_out[1]=bnd_nbr_out;
-    (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt_out,dmn_cnt_out,lon_bnd_out,crd_typ_out);
+    dmn_cnt_tuo[0]=col_nbr_out;
+    dmn_cnt_tuo[1]=bnd_nbr_out;
+    (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt_out,dmn_cnt_tuo,lon_bnd_out,crd_typ_out);
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=col_nbr_out;
-    (void)nco_put_vara(out_id,area_out_id,dmn_srt_out,dmn_cnt_out,area_out,crd_typ_out);
+    dmn_cnt_tuo[0]=col_nbr_out;
+    (void)nco_put_vara(out_id,area_out_id,dmn_srt_out,dmn_cnt_tuo,area_out,crd_typ_out);
   } /* !flg_grd_out_1D */
-  if(flg_grd_out_2D){
+  if(flg_grd_out_crv){
+    dmn_srt_out[0]=dmn_srt_out[1]=0L;
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    dmn_cnt_tuo[1]=lon_nbr_out;
+    (void)nco_put_vara(out_id,lat_out_id,dmn_srt_out,dmn_cnt_tuo,lat_ctr_out,crd_typ_out);
+    (void)nco_put_vara(out_id,lon_out_id,dmn_srt_out,dmn_cnt_tuo,lon_ctr_out,crd_typ_out);
+    (void)nco_put_vara(out_id,area_out_id,dmn_srt_out,dmn_cnt_tuo,area_out,crd_typ_out);
+    if(flg_frc_out_wrt){
+      (void)nco_put_vara(out_id,frc_out_id,dmn_srt_out,dmn_cnt_tuo,frc_out,crd_typ_out);
+    } /* !flg_frc_out_wrt */
+    dmn_srt_out[0]=dmn_srt_out[1]=dmn_srt_out[2]=0L;
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    dmn_cnt_tuo[1]=lon_nbr_out;
+    dmn_cnt_tuo[2]=bnd_nbr_out;
+    (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt_out,dmn_cnt_tuo,lat_bnd_out,crd_typ_out);
+    (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt_out,dmn_cnt_tuo,lon_bnd_out,crd_typ_out);
+  } /* !flg_grd_out_crv */
+  if(flg_grd_out_rct){
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=lat_nbr_out;
-    (void)nco_put_vara(out_id,lat_out_id,dmn_srt_out,dmn_cnt_out,lat_ctr_out,crd_typ_out);
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    (void)nco_put_vara(out_id,lat_out_id,dmn_srt_out,dmn_cnt_tuo,lat_ctr_out,crd_typ_out);
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=lon_nbr_out;
-    (void)nco_put_vara(out_id,lon_out_id,dmn_srt_out,dmn_cnt_out,lon_ctr_out,crd_typ_out);
+    dmn_cnt_tuo[0]=lon_nbr_out;
+    (void)nco_put_vara(out_id,lon_out_id,dmn_srt_out,dmn_cnt_tuo,lon_ctr_out,crd_typ_out);
     dmn_srt_out[0]=0L;
-    dmn_cnt_out[0]=lat_nbr_out;
-    (void)nco_put_vara(out_id,lat_wgt_id,dmn_srt_out,dmn_cnt_out,lat_wgt_out,crd_typ_out);
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    (void)nco_put_vara(out_id,lat_wgt_id,dmn_srt_out,dmn_cnt_tuo,lat_wgt_out,crd_typ_out);
     dmn_srt_out[0]=dmn_srt_out[1]=0L;
-    dmn_cnt_out[0]=lat_nbr_out;
-    dmn_cnt_out[1]=bnd_nbr_out;
-    (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt_out,dmn_cnt_out,lat_bnd_out,crd_typ_out);
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    dmn_cnt_tuo[1]=bnd_nbr_out;
+    (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt_out,dmn_cnt_tuo,lat_bnd_out,crd_typ_out);
     dmn_srt_out[0]=dmn_srt_out[1]=0L;
-    dmn_cnt_out[0]=lon_nbr_out;
-    dmn_cnt_out[1]=bnd_nbr_out;
-    (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt_out,dmn_cnt_out,lon_bnd_out,crd_typ_out);
+    dmn_cnt_tuo[0]=lon_nbr_out;
+    dmn_cnt_tuo[1]=bnd_nbr_out;
+    (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt_out,dmn_cnt_tuo,lon_bnd_out,crd_typ_out);
     dmn_srt_out[0]=dmn_srt_out[1]=0L;
-    dmn_cnt_out[0]=lat_nbr_out;
-    dmn_cnt_out[1]=lon_nbr_out;
-    (void)nco_put_vara(out_id,area_out_id,dmn_srt_out,dmn_cnt_out,area_out,crd_typ_out);
-  } /* !flg_grd_out_2D */
+    dmn_cnt_tuo[0]=lat_nbr_out;
+    dmn_cnt_tuo[1]=lon_nbr_out;
+    (void)nco_put_vara(out_id,area_out_id,dmn_srt_out,dmn_cnt_tuo,area_out,crd_typ_out);
+    if(flg_frc_out_wrt){
+      (void)nco_put_vara(out_id,frc_out_id,dmn_srt_out,dmn_cnt_tuo,frc_out,crd_typ_out);
+    } /* !flg_frc_out_wrt */
+  } /* !flg_grd_out_rct */
 
   /* Regrid or copy variable values */
   const double wgt_vld_thr=rgr->wgt_vld_thr; /* [frc] Weight threshold for valid destination value */
   const nco_bool flg_rnr=rgr->flg_rnr; /* [flg] Renormalize destination values by valid area */
-  const size_t grd_sz_in=rgr_map.src_grid_size; /* [nbr] Number of elements in single layer of input grid */
-  const size_t grd_sz_out=rgr_map.dst_grid_size; /* [nbr] Number of elements in single layer of output grid */
   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 */
-  int idx_in; /* [idx] Input grid index */
-  int idx_out; /* [idx] Output grid index */
+  size_t idx_in; /* [idx] Input grid index */
+  size_t idx_out; /* [idx] Output grid index */
   int lvl_idx; /* [idx] Level index */
   int lvl_nbr; /* [nbr] Number of levels */
   int thr_idx; /* [idx] Thread index */
@@ -2151,9 +2364,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   /* OpenMP notes:
      default(): None
-     firstprivate(): Pointers that could inadvertently be free()'d if they lost their NULL-initialization
+     firstprivate(): Pointers that could be inadvertently free()'d if they lost their NULL-initialization
      private(): Almost everything else
-     shared(): uggh...
+     shared(): uggh...shared clause depends on both compiler and compiler-version
      1. All const variables are default shared for gcc >= 4.9.2,
      2. fnc_nm (only!) must be explicit shared for g++ 4.6.3 (travis)
      3. flg_rnr,fnc_nm,wgt_vld_thr must be explicit shared for icc 13.1.3 (rhea) */
@@ -2164,12 +2377,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 # endif /* 480 */
 #endif /* !__GNUC__ */
 #if defined( __INTEL_COMPILER)
-# pragma omp parallel for default(none) firstprivate(dmn_cnt,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,flg_frc_nrm,flg_rnr,fnc_nm,frc_out,lnk_nbr,out_id,row_dst_adr,wgt_ra [...]
+# pragma omp parallel for default(none) firstprivate(dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,dmn_nbr_hrz_crd,flg_frc_nrm,flg_rnr,fnc_nm,frc_out,ln [...]
 #else /* !__INTEL_COMPILER */
 # ifdef GXX_OLD_OPENMP_SHARED_TREATMENT
-#  pragma omp parallel for default(none) firstprivate(dmn_cnt,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,flg_frc_nrm,fnc_nm,frc_out,lnk_nbr,out_id,row_dst_adr,wgt_raw)
+#  pragma omp parallel for default(none) firstprivate(dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,dmn_nbr_hrz_crd,flg_frc_nrm,fnc_nm,frc_out,lnk_nbr,o [...]
 # else /* !old g++ */
-#  pragma omp parallel for default(none) firstprivate(dmn_cnt,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,flg_frc_nrm,frc_out,lnk_nbr,out_id,row_dst_adr,wgt_raw)
+#  pragma omp parallel for default(none) firstprivate(dmn_cnt_in,dmn_cnt_out,dmn_srt,dmn_id_in,dmn_id_out,tally,var_val_dbl_in,var_val_dbl_out,wgt_vld_out) private(dmn_idx,dmn_nbr_in,dmn_nbr_out,dmn_nbr_max,dst_idx,has_mss_val,idx,idx_in,idx_out,idx_tbl,in_id,lnk_idx,lvl_idx,lvl_nbr,mss_val_dbl,rcd,thr_idx,trv,val_in_fst,val_out_fst,var_id_in,var_id_out,var_nm,var_sz_in,var_sz_out,var_typ_out,var_typ_rgr,var_val_crr) shared(col_src_adr,dmn_nbr_hrz_crd,flg_frc_nrm,frc_out,lnk_nbr,out_id,r [...]
 # endif /* !old g++ */
 #endif /* !__INTEL_COMPILER */
   for(idx_tbl=0;idx_tbl<trv_nbr;idx_tbl++){
@@ -2197,27 +2410,25 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	dmn_id_in=(int *)nco_malloc(dmn_nbr_in*sizeof(int));
 	dmn_id_out=(int *)nco_malloc(dmn_nbr_out*sizeof(int));
 	dmn_srt=(long *)nco_malloc(dmn_nbr_max*sizeof(long)); /* max() for both input and output grids */
-	dmn_cnt=(long *)nco_malloc(dmn_nbr_max*sizeof(long));
+	dmn_cnt_in=(long *)nco_malloc(dmn_nbr_max*sizeof(long));
+	dmn_cnt_out=(long *)nco_malloc(dmn_nbr_max*sizeof(long));
 	rcd=nco_inq_vardimid(out_id,var_id_out,dmn_id_out);
 	rcd=nco_inq_vardimid(in_id,var_id_in,dmn_id_in);
 	for(dmn_idx=0;dmn_idx<dmn_nbr_in;dmn_idx++){
-	  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt+dmn_idx);
-	  var_sz_in*=dmn_cnt[dmn_idx];
+	  rcd=nco_inq_dimlen(in_id,dmn_id_in[dmn_idx],dmn_cnt_in+dmn_idx);
+	  var_sz_in*=dmn_cnt_in[dmn_idx];
 	  dmn_srt[dmn_idx]=0L;
 	} /* end loop over dimensions */
 	var_val_dbl_in=(double *)nco_malloc_dbg(var_sz_in*nco_typ_lng(var_typ_rgr),fnc_nm,"Unable to malloc() input value buffer");
-	rcd=nco_get_vara(in_id,var_id_in,dmn_srt,dmn_cnt,var_val_dbl_in,var_typ_rgr);
+	rcd=nco_get_vara(in_id,var_id_in,dmn_srt,dmn_cnt_in,var_val_dbl_in,var_typ_rgr);
 
 	for(dmn_idx=0;dmn_idx<dmn_nbr_out;dmn_idx++){
-	  rcd=nco_inq_dimlen(out_id,dmn_id_out[dmn_idx],dmn_cnt+dmn_idx);
-	  var_sz_out*=dmn_cnt[dmn_idx];
+	  rcd=nco_inq_dimlen(out_id,dmn_id_out[dmn_idx],dmn_cnt_out+dmn_idx);
+	  var_sz_out*=dmn_cnt_out[dmn_idx];
 	  dmn_srt[dmn_idx]=0L;
 	} /* end loop over dimensions */
-	var_val_dbl_out=(double *)nco_malloc_dbg(var_sz_out*nco_typ_lng(var_typ_rgr),fnc_nm,"Unable to malloc() input value buffer");
+	var_val_dbl_out=(double *)nco_malloc_dbg(var_sz_out*nco_typ_lng(var_typ_rgr),fnc_nm,"Unable to malloc() output value buffer");
 	
-	lvl_nbr=1;
-	for(dmn_idx=0;dmn_idx<dmn_nbr_out-2;dmn_idx++) lvl_nbr*=dmn_cnt[dmn_idx];
-
 	/* Initialize output */
 	for(dst_idx=0;dst_idx<var_sz_out;dst_idx++) var_val_dbl_out[dst_idx]=0.0;
 	/* Missing value setup */
@@ -2227,6 +2438,110 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	if(has_mss_val && flg_rnr) 
 	  for(dst_idx=0;dst_idx<var_sz_out;dst_idx++) wgt_vld_out[dst_idx]=0.0;
 
+	int dmn_idx_in; /* [idx] Index to input dimensions */
+	int dmn_idx_out; /* [idx] Index to output dimensions */
+	int *dmn_idx_out_in=NULL; /* [idx] Dimension correspondence, output->input */
+	long *dmn_map_in=NULL; /* [idx] Map for each dimension of input variable */
+	long *dmn_map_out=NULL; /* [idx] Map for each dimension of output variable */
+	long *dmn_sbs_in=NULL; /* [idx] Dimension subscripts into N-D input array */
+	long *dmn_sbs_out=NULL; /* [idx] Dimension subscripts into N-D output array */
+
+	const int dmn_nbr_in_m1=dmn_nbr_in-1; /* [nbr] Number of input dimensions less one (fast) */
+	const int dmn_nbr_out_m1=dmn_nbr_out-1; /* [nbr] Number of output dimensions less one (fast) */
+	char *var_val_cp_in=NULL; /* [] Non-MRV input values permuted into MRV order */
+	char *var_val_cp_out=NULL; /* [] Non-MRV output values permuted into MRV order */
+	
+	if(!trv.flg_mrv){
+	  dmn_idx_out_in=(int *)nco_malloc(dmn_nbr_out*sizeof(int));
+	  dmn_map_in=(long *)nco_malloc(dmn_nbr_in*sizeof(long));
+	  dmn_map_out=(long *)nco_malloc(dmn_nbr_out*sizeof(long));
+	  dmn_sbs_in=(long *)nco_malloc(dmn_nbr_in*sizeof(long));
+	  dmn_sbs_out=(long *)nco_malloc(dmn_nbr_out*sizeof(long));
+
+	  /* 20151012: Juggle indices to extent possible before main weight loop */
+	  for(dmn_idx_out=0;dmn_idx_out<dmn_nbr_out;dmn_idx_out++)
+	    dmn_idx_out_in[dmn_idx_out]=-73;
+	  
+	  /* Map for each dimension of input variable */
+	  for(dmn_idx_in=0;dmn_idx_in<dmn_nbr_in;dmn_idx_in++) dmn_map_in[dmn_idx_in]=1L;
+	  for(dmn_idx_in=0;dmn_idx_in<dmn_nbr_in-1;dmn_idx_in++)
+	    for(dmn_idx=dmn_idx_in+1;dmn_idx<dmn_nbr_in;dmn_idx++)
+	      dmn_map_in[dmn_idx_in]*=dmn_cnt_in[dmn_idx];
+  
+	  /* Map for each dimension of output variable */
+	  for(dmn_idx_out=0;dmn_idx_out<dmn_nbr_out;dmn_idx_out++) dmn_map_out[dmn_idx_out]=1L;
+	  for(dmn_idx_out=0;dmn_idx_out<dmn_nbr_out-1;dmn_idx_out++)
+	    for(dmn_idx=dmn_idx_out+1;dmn_idx<dmn_nbr_out;dmn_idx++)
+	      dmn_map_out[dmn_idx_out]*=dmn_cnt_out[dmn_idx];
+	} /* !flg_mrv */
+	      
+	/* Compute number and size of non-lat/lon or non-col dimensions (e.g., level, time, species, wavelength)
+	   Denote their convolution by level or 'lvl' for shorthand
+	   There are lvl_nbr elements for each lat/lon or col position
+	   20151011: Until today assume lat/lon and col are most-rapidly varying dimensions 
+	   20151011: Until today lvl_nbr missed last non-spatial dimension for 1D output */
+	lvl_nbr=1;
+	/* Simple prescription of lvl_nbr works when horizontal dimension(s) is/are MRV */
+	for(dmn_idx=0;dmn_idx<dmn_nbr_out-dmn_nbr_hrz_crd;dmn_idx++) lvl_nbr*=dmn_cnt_out[dmn_idx];
+	if(!trv.flg_mrv){
+	  /* fxm: 20151011 generalize for non-MRV input */
+	  for(dmn_idx=0;dmn_idx<dmn_nbr_out-dmn_nbr_hrz_crd;dmn_idx++) lvl_nbr*=dmn_cnt_out[dmn_idx];
+	} /* !flg_mrv */
+	
+	if(!trv.flg_mrv){
+	  /* Nomenclature for var_val_cp buffers is confusing because _in and _out both refer to pre- and post-permutation */
+	  var_val_cp_in=(char *)var_val_dbl_in;
+	  var_val_cp_out=(char *)nco_malloc_dbg(var_sz_in*nco_typ_lng(var_typ_rgr),fnc_nm,"Unable to malloc() permuted output value buffer");
+	
+	  for(idx_in=0;idx_in<var_sz_in;idx_in++){
+
+	    /* fxm CEWI fixes uninitialized warning*/
+	    idx_out=73;
+	    
+	    /* dmn_sbs_in are corresponding indices (subscripts) into N-D array */
+	    dmn_sbs_in[dmn_nbr_in_m1]=idx_in%dmn_cnt_in[dmn_nbr_in_m1];
+	    for(dmn_idx_in=0;dmn_idx_in<dmn_nbr_in_m1;dmn_idx_in++){
+	      dmn_sbs_in[dmn_idx_in]=(long int)(idx_in/dmn_map_in[dmn_idx_in]);
+	      dmn_sbs_in[dmn_idx_in]%=dmn_cnt_in[dmn_idx_in];
+	    } /* end loop over dimensions */
+	    
+	    /* dmn_sbs_out are corresponding indices (subscripts) into N-D array */
+	    dmn_sbs_out[dmn_nbr_out_m1]=idx_out%dmn_cnt_out[dmn_nbr_out_m1];
+	    for(dmn_idx_out=0;dmn_idx_out<dmn_nbr_out_m1;dmn_idx_out++){
+	      dmn_sbs_out[dmn_idx_out]=(long int)(idx_out/dmn_map_out[dmn_idx_out]);
+	      dmn_sbs_out[dmn_idx_out]%=dmn_cnt_out[dmn_idx_out];
+	    } /* end loop over dimensions */
+	    
+	    /* Map variable's N-D array indices to get 1-D index into output data */
+	    idx_out=0L;
+	    for(dmn_idx_out=0;dmn_idx_out<dmn_nbr_out;dmn_idx_out++) 
+	      // fxm
+	      idx_out+=0*(dmn_sbs_in[dmn_idx_out_in[dmn_idx_out]]*dmn_map_out[dmn_idx_out]);
+	    
+	    /* Copy current input element into its slot in output array */
+	    (void)memcpy(var_val_cp_out+idx_out*sizeof(double),var_val_cp_in+idx_in*sizeof(double),(size_t)sizeof(double));
+	  } /* end loop over idx_in */
+
+	  /* Free non-MRV input buffer */
+	  if(var_val_dbl_in) var_val_dbl_in=(double *)nco_free(var_val_dbl_in);
+	  /* Point input buffer to MRV var_val_cp_out, then regrid that */
+	  var_val_dbl_in=(double *)var_val_cp_out;
+
+	  if(dmn_idx_out_in) dmn_idx_out_in=(int *)nco_free(dmn_idx_out_in);
+	  if(dmn_map_in) dmn_map_in=(long *)nco_free(dmn_map_in);
+	  if(dmn_map_out) dmn_map_out=(long *)nco_free(dmn_map_out);
+	  if(dmn_sbs_in) dmn_sbs_in=(long *)nco_free(dmn_sbs_in);
+	  if(dmn_sbs_out) dmn_sbs_out=(long *)nco_free(dmn_sbs_out);
+
+	} /* !flg_mrv */
+	
+	/* 20150914: Intensive variables require normalization, extensive do not
+	   Intensive variables (temperature, wind speed, mixing ratio) do not depend on gridcell boundaries
+	   Extensive variables (population, counts, numbers of things) depend on gridcell boundaries
+	   Extensive variables are the exception in models, yet are commonly used for sampling information, e.g., 
+	   number of photons, number of overpasses 
+	   Pass NCO the extensive variable list with, e.g., --xtn=TSurfStd_ct,... */
+	  
 	/* Apply weights */
 	if(!has_mss_val){
 	  if(lvl_nbr == 1){
@@ -2245,44 +2560,102 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	  } /* lvl_nbr > 1 */
 	}else{ /* has_mss_val */
 	  if(lvl_nbr == 1){
-	    for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++){
-	      idx_in=col_src_adr[lnk_idx];
-	      idx_out=row_dst_adr[lnk_idx];
-	      if((var_val_crr=var_val_dbl_in[idx_in]) != mss_val_dbl){
-		var_val_dbl_out[idx_out]+=var_val_crr*wgt_raw[lnk_idx];
-		if(flg_rnr) wgt_vld_out[idx_out]+=wgt_raw[lnk_idx];
-		tally[idx_out]++;
-	      } /* endif */
-	    } /* end loop over link */
-	  }else{ /* lvl_nbr > 1 */
-	    val_in_fst=0L;
-	    val_out_fst=0L;
-	    for(lvl_idx=0;lvl_idx<lvl_nbr;lvl_idx++){
+	    if(trv.flg_xtn){
+	      /* 20150914: fxm extensive block needs work and once debugged, must be implemented in !has_mss_val branch and in lvl_nbr > 1 branch */
+	      for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++){
+		idx_in=col_src_adr[lnk_idx];
+		idx_out=row_dst_adr[lnk_idx];
+		if((var_val_crr=var_val_dbl_in[idx_in]) != mss_val_dbl){
+		  var_val_dbl_out[idx_out]+=var_val_crr;
+		  if(flg_rnr) wgt_vld_out[idx_out]+=wgt_raw[lnk_idx];
+		  tally[idx_out]++;
+		} /* endif */
+	      } /* end loop over link */
+	    }else{
 	      for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++){
-		idx_in=col_src_adr[lnk_idx]+val_in_fst;
-		idx_out=row_dst_adr[lnk_idx]+val_out_fst;
+		idx_in=col_src_adr[lnk_idx];
+		idx_out=row_dst_adr[lnk_idx];
 		if((var_val_crr=var_val_dbl_in[idx_in]) != mss_val_dbl){
 		  var_val_dbl_out[idx_out]+=var_val_crr*wgt_raw[lnk_idx];
 		  if(flg_rnr) wgt_vld_out[idx_out]+=wgt_raw[lnk_idx];
 		  tally[idx_out]++;
 		} /* endif */
 	      } /* end loop over link */
-	      val_in_fst+=grd_sz_in;
-	      val_out_fst+=grd_sz_out;
-	    } /* end loop over lvl */
+	    } /* !flg_xtn */
+	  }else{ /* lvl_nbr > 1 */
+	    val_in_fst=0L;
+	    val_out_fst=0L;
+	    if(trv.flg_mrv){
+	      for(lvl_idx=0;lvl_idx<lvl_nbr;lvl_idx++){
+		for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++){
+		  idx_in=col_src_adr[lnk_idx]+val_in_fst;
+		  idx_out=row_dst_adr[lnk_idx]+val_out_fst;
+		  if((var_val_crr=var_val_dbl_in[idx_in]) != mss_val_dbl){
+		    var_val_dbl_out[idx_out]+=var_val_crr*wgt_raw[lnk_idx];
+		    if(flg_rnr) wgt_vld_out[idx_out]+=wgt_raw[lnk_idx];
+		    tally[idx_out]++;
+		  } /* endif */
+		} /* end loop over link */
+		val_in_fst+=grd_sz_in;
+		val_out_fst+=grd_sz_out;
+	      } /* end loop over lvl */
+	    }else{ /* !flg_mrv */
+	      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(fp_stdout,"INFO: Non-MRV variable %s: lvl_nbr = %d\n",trv.nm,lvl_nbr);
+	      /* Algorithm to regrid non-MRV variables:
+		 Permute input data until horizontal coordinates are MRV
+		 Regrid as usual
+		 Permute output data into original non-MRV order */
+
+	      for(lnk_idx=0;lnk_idx<lnk_nbr;lnk_idx++){
+		/* Translate col_src/row_dst addresses (which are 1-D offsets) into lon/lat/col indices in src/dst arrays */
+		idx_in=col_src_adr[lnk_idx];
+		idx_out=row_dst_adr[lnk_idx];
+
+	      } /* end loop over link */
+	    } /* !flg_mrv */
 	  } /* lvl_nbr > 1 */
+	} /* !has_mss_val */
 
-	  if(!flg_frc_nrm){
+	/* Rounding can be important for integer-type extensive variables */
+	if(trv.flg_xtn){
+	  if(nco_typ_ntg(var_typ_out)){
+	    if(!has_mss_val){
+	      for(dst_idx=0;dst_idx<var_sz_out;dst_idx++)
+		var_val_dbl_out[dst_idx]=round(var_val_dbl_out[dst_idx]);
+	    }else{ /* has_mss_val */
+	      for(dst_idx=0;dst_idx<var_sz_out;dst_idx++)
+		if(tally[dst_idx]) var_val_dbl_out[dst_idx]=round(var_val_dbl_out[dst_idx]);
+	    } /* !has_mss_val */
+	  } /* !nco_typ_ntg */
+	} /* !flg_xtn */
+	  
+	if(!has_mss_val){
+	  if(flg_frc_nrm){
 	    /* frc_dst = frc_out = dst_frac = frac_b contains non-unity elements and normalization type is "destarea" or "none"
-	       When this occurs, follow "destarea" normalization procedure
+	       When this occurs for conservative remapping, follow "destarea" normalization procedure
 	       See SCRIP manual p. 11 and http://www.earthsystemmodeling.org/esmf_releases/public/ESMF_6_3_0rp1/ESMF_refdoc/node3.html#SECTION03028000000000000000
+	       NB: Non-conservative interpolation methods (e.g., bilinear) should NOT apply this normalization (theoretically there is no danger in doing so because frc_out == 1 always for all gridcells that participate in bilinear remapping and frc_out == 0 otherwise, but still, best not to tempt the Fates)
 	       NB: Both frc_out and NCO's renormalization (below) could serve the same purpose
-	       Applying both could lead to double-normalizing by missing values
-	       fxm: Be sure this does not occur! */
-	    for(dst_idx=0;dst_idx<var_sz_out;dst_idx++)
-	      if(frc_out[dst_idx] != 0.0) var_val_dbl_out[dst_idx]/=frc_out[dst_idx];
-	  } /* flg_frc_out_one */
+	       Applying both could lead to double-normalizing by missing values!
+	       20151018: Be sure this does not occur! current this is done by only executing flg_frc_nrm block when !has_mss_val
+	       and having a separate normalization block for has_mss_val
+	       fxm: Use better logic and more metadata information to determine code path */
+	    if(lvl_nbr == 1){
+	      for(dst_idx=0;dst_idx<grd_sz_out;dst_idx++)
+		if(frc_out[dst_idx] != 0.0) var_val_dbl_out[dst_idx]/=frc_out[dst_idx];
+	    }else{
+	      for(dst_idx=0;dst_idx<grd_sz_out;dst_idx++){
+		if(frc_out[dst_idx] != 0.0){
+		  for(lvl_idx=0;lvl_idx<lvl_nbr;lvl_idx++){
+		    var_val_dbl_out[dst_idx+lvl_idx*grd_sz_out]/=frc_out[dst_idx];
+		  } /* !lvl_idx */
+		} /* !frc_out */
+	      } /* !dst_idx */
+	    } /* lvl_nbr > 1 */
+	  } /* flg_frc_nrm */
+	} /* !has_mss_val */
  
+	if(has_mss_val){
 	  /* NCL and ESMF treatment of weights and missing values described at
 	     https://www.ncl.ucar.edu/Applications/ESMF.shtml#WeightsAndMasking
 	     http://earthsystemmodeling.org/esmf_releases/non_public/ESMF_6_1_1/ESMF_refdoc/node5.html#SECTION05012600000000000000
@@ -2305,17 +2678,29 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 		if(wgt_vld_out[dst_idx] >= wgt_vld_thr){var_val_dbl_out[dst_idx]/=wgt_vld_out[dst_idx];}else{var_val_dbl_out[dst_idx]=mss_val_dbl;}
 	    } /* !wgt_vld_thr */
 	  } /* !flg_rnr */
+
+	  /* 20150914: fxm extensive block */
+	  if(flg_rnr && trv.flg_xtn){
+	    for(dst_idx=0;dst_idx<var_sz_out;dst_idx++){
+	      if(tally[dst_idx] > 0){
+		if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(fp_stdout,"Extensive variable %s: dst_idx = %li, tally = %d, val_out_b4 = %g, wgt_vld_out = %g, val_out_after = %g\n",trv.nm,dst_idx,tally[dst_idx],var_val_dbl_out[dst_idx],wgt_vld_out[dst_idx],var_val_dbl_out[dst_idx]*wgt_vld_out[dst_idx]);
+		var_val_dbl_out[dst_idx]*=wgt_vld_out[dst_idx];
+	      } /* !tally */
+	    } /* !dst_idx */
+	  } /* !flg_xtn */
+
 	} /* !has_mss_val */
 	
 #pragma omp critical
 	{ /* begin OpenMP critical */
-	  rcd=nco_put_vara(out_id,var_id_out,dmn_srt,dmn_cnt,var_val_dbl_out,var_typ_rgr);
+	  rcd=nco_put_vara(out_id,var_id_out,dmn_srt,dmn_cnt_out,var_val_dbl_out,var_typ_rgr);
 	} /* end OpenMP critical */
 	
 	if(dmn_id_in) dmn_id_out=(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);
-	if(dmn_cnt) dmn_cnt=(long *)nco_free(dmn_cnt);
+	if(dmn_cnt_in) dmn_cnt_in=(long *)nco_free(dmn_cnt_in);
+	if(dmn_cnt_out) dmn_cnt_out=(long *)nco_free(dmn_cnt_out);
 	if(tally) tally=(int *)nco_free(tally);
 	if(var_val_dbl_out) var_val_dbl_out=(double *)nco_free(var_val_dbl_out);
 	if(var_val_dbl_in) var_val_dbl_in=(double *)nco_free(var_val_dbl_in);
@@ -2330,7 +2715,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     } /* !xtr */
   } /* end (OpenMP parallel for) loop over idx_tbl */
   if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stdout,"\n");
-  if(nco_dbg_lvl_get() >= nco_dbg_fl) (void)fprintf(stdout,"%s: INFO %s completion report. Variables regridded = %d, copied unmodified = %d, omitted = %d, created = %d\n",nco_prg_nm_get(),fnc_nm,var_rgr_nbr,var_cpy_nbr,var_xcl_nbr,var_crt_nbr);
+  if(nco_dbg_lvl_get() >= nco_dbg_fl) (void)fprintf(stdout,"%s: INFO %s completion report. Variables regridded = %d (%d extensive), copied unmodified = %d, omitted = %d, created = %d\n",nco_prg_nm_get(),fnc_nm,var_rgr_nbr,var_xtn_nbr,var_cpy_nbr,var_xcl_nbr,var_crt_nbr);
   
   /* Free memory allocated for grid reading/writing */
   if(area_out) area_out=(double *)nco_free(area_out);
@@ -2351,8 +2736,22 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(row_dst_adr) row_dst_adr=(int *)nco_free(row_dst_adr);
   if(wgt_raw) wgt_raw=(double *)nco_free(wgt_raw);
   
+  if(False && flg_grd_out_crv){
+    /* WRF curvilinear grid: 
+       ncks -C -m -v XLAT,XLONG ${DATA}/hdf/wrfout_v2_Lambert.nc # Interrogate file
+       ncwa -O -a Time ${DATA}/hdf/wrfout_v2_Lambert.nc ${DATA}/hdf/wrfout_v2_Lambert_notime.nc # Create simpler input
+       ncks -C -d south_north,0 -d west_east,0 -v XLAT,XLONG ${DATA}/hdf/wrfout_v2_Lambert_notime.nc # Interrogate file
+       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
+       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);
+  } /* !flg_grd_out_crv */
+
   return rcd;
-} /* nco_rgr_map() */
+} /* end nco_rgr_map() */
 
 void
 nco_bsl_zro /* Return Bessel function zeros */
@@ -2540,13 +2939,209 @@ nco_lat_wgt_gss /* [fnc] Compute and return sine of Gaussian latitudes and their
   return;
 } /* end nco_lat_wgt_gss() */
   
-int /* O [enm] Return code */
-nco_rgr_tps /* [fnc] Regrid using Tempest library */
-(rgr_sct * const rgr) /* I/O [sct] Regridding structure */
+void
+nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
+(const double * const lat_bnd, /* [dgr] Latitude  boundaries of rectangular grid */
+ const double * const lon_bnd, /* [dgr] Longitude boundaries of rectangular grid */
+ const long col_nbr, /* [nbr] Number of columns in grid */
+ const int bnd_nbr, /* [nbr] Number of bounds in gridcell */
+ double * const area) /* [sr] Gridcell area */
 {
-  /* Purpose: Regrid fields using Tempest remapping "library" (more precisely, executables)
-
-     Test Tempest library: no way to activate yet
+  /* Purpose: Compute area of spherical polygon */
+  /* Use L'Huilier's Theorem not 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
+     semi-perimeter = half-perimeter of triangle = 0.5*(a+b+c)
+     Spherical Excess (SE) difference between the sum of the angles of a spherical triangle area and a planar triangle area with same interior angles (which has sum equal to pi)
+     SE is also the solid angle subtended by the spherical triangle and that's, well, astonishing and pretty cool
+     Wikipedia shows a better SE formula for triangles which are ill-conditioned for L'Huillier's formula because a = b ~ 0.5c
+     https://en.wikipedia.org/wiki/Spherical_trigonometry#Area_and_spherical_excess 
+     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:
+     cos(a)=u dot v=cos(theta1)*cos(phi1)*cos(theta2)*cos(phi2)+cos(theta1)*sin(phi1)*cos(theta2)*sin(phi2)+sin(theta1)*sin(theta2)
+     Spherical law of cosines relates interior angles/arc-lengths (a,b,c) to surface angles (A,B,C) in spherical triangle:
+     https://en.wikipedia.org/wiki/Spherical_law_of_cosines
+     cos(a)=cos(b)*cos(c)+sin(b)*sin(c)*cos(A)
+     cos(b)=cos(c)*cos(a)+sin(c)*sin(a)*cos(B)
+     cos(c)=cos(a)*cos(b)+sin(a)*sin(b)*cos(C)
+     cos(A)=[cos(a)-cos(b)*cos(c)]/[sin(b)*sin(c)]
+     cos(B)=[cos(b)-cos(c)*cos(a)]/[sin(c)*sin(a)]
+     cos(C)=[cos(c)-cos(a)*cos(b)]/[sin(a)*sin(b)]
+     Bounds information on unstructured grids will use bounds_nbr=maximum(vertice_nbr)
+     Unused vertices are stored as either repeated points (ACME does this) or, conceiveably, as missing values
+     Given (lat,lon) for N-points algorithm to find area of spherical polygon is:
+     1. Girard method: Loses precision due to mismatch between pi and small spherical excesses
+        A. Find interior angles/arc-lengths (a,b,c,d...) using spherical law of cosines along each edge
+        B. Apply generalized Girard formula SE_n = Sum(A_n) - (N-2) - pi
+     2. L'Huillier method, N-2 triangle version by Zender: 
+        Convert polygon into triangles by cycling spoke through all sides from common apex
+        This method requires computation of N-2 (not N) triangles, though fewer sides due to optimization
+	It works on all convex polygons (interior angles less than 180) but not, in general, concave polygons
+	Whether it works or not on concave polygons depends upon their exact shape and the choice of apex point
+        A. First three non-identical points form first triangle with sides A,B,C (first+second point define A, etc.)
+	   i. First vertice anchors all triangles
+	   ii. Third vertice of preceding triangle becomes second vertice of next triangle
+	   iii. Next non-identical point becomes last vertice of next triangle
+	   iv. Side C of previous triangle is side A of next triangle
+	B. For each triangle, compute area with L'Huillier formula unless A = B ~ 0.5*C
+     3. L'Huillier method, N triangle version by Taylor: 
+        Compute polygon centroid and treat this as hub from which spokes are drawn to all vertices
+        This method requires computation of N triangles, though fewer sides due to optimization
+	Moreover, it works on all convex polygons and on slightly concave polygons
+	The centroid/hub has a clear view of the interior of most simple concave polygons */
+
+  const char fnc_nm[]="nco_sph_plg_area()";
+  const double dgr2rdn=M_PI/180.0;
+  short int bnd_idx;
+  long idx; /* [idx] Counting index for unrolled grids */
+
+  double *lat_bnd_rdn=NULL_CEWI; /* [rdn] Latitude  boundaries of rectangular destination grid */
+  double *lon_bnd_rdn=NULL_CEWI; /* [rdn] Longitude boundaries of rectangular destination grid */
+  double *lat_bnd_sin=NULL_CEWI; /* [frc] Sine of latitude  boundaries of rectangular destination grid */
+  double *lon_bnd_sin=NULL_CEWI; /* [frc] Sine of longitude boundaries of rectangular destination grid */
+  double *lat_bnd_cos=NULL_CEWI; /* [frc] Cosine of latitude  boundaries of rectangular destination grid */
+  double *lon_bnd_cos=NULL_CEWI; /* [frc] Cosine of longitude boundaries of rectangular destination grid */
+  lon_bnd_rdn=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  lat_bnd_rdn=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  lon_bnd_cos=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  lat_bnd_cos=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  lon_bnd_sin=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  lat_bnd_sin=(double *)nco_malloc(col_nbr*bnd_nbr*sizeof(double));
+  memcpy(lat_bnd_rdn,lat_bnd,col_nbr*bnd_nbr*sizeof(double));
+  memcpy(lon_bnd_rdn,lon_bnd,col_nbr*bnd_nbr*sizeof(double));
+  for(idx=0;idx<col_nbr*bnd_nbr;idx++){
+    lon_bnd_rdn[idx]*=dgr2rdn;
+    lat_bnd_rdn[idx]*=dgr2rdn;
+    lon_bnd_cos[idx]=cos(lon_bnd_rdn[idx]);
+    lat_bnd_cos[idx]=cos(lat_bnd_rdn[idx]);
+    lon_bnd_sin[idx]=sin(lon_bnd_rdn[idx]);
+    lat_bnd_sin[idx]=sin(lat_bnd_rdn[idx]);
+  } /* !idx */
+  double lat_dlt; /* [rdn] Latitudinal difference */
+  double lon_dlt; /* [rdn] Longitudinal difference */
+  double ngl_a; /* [rdn] Interior angle/great circle arc a */
+  double ngl_b; /* [rdn] Interior angle/great circle arc b */
+  double ngl_c; /* [rdn] Interior angle/great circle arc c */
+  double prm_smi; /* [rdn] Semi-perimeter of triangle */
+  double sin_hlf_tht; /* [frc] Sine of half angle/great circle arc theta connecting two points */
+  double xcs_sph; /* [sr] Spherical excess */
+  double xcs_sph_qtr_tan; /* [frc] Tangent of one-quarter the spherical excess */
+  int tri_nbr; /* [nbr] Number of triangles in polygon */
+  long idx_a; /* [idx] Point A 1-D index */
+  long idx_b; /* [idx] Point B 1-D index */
+  long idx_c; /* [idx] Point C 1-D index */
+  for(unsigned int col_idx=0;col_idx<col_nbr;col_idx++){
+    ngl_c=double_CEWI; /* Otherwise compiler unsure ngl_c is initialized first use */
+    area[col_idx]=0.0;
+    tri_nbr=0;
+    /* A is always first vertice */
+    idx_a=bnd_nbr*col_idx; 
+    /* Start search for B at next vertice */
+    bnd_idx=1;
+    /* bnd_idx labels offset from point A of potential location of triangle points B and C 
+       We know that bnd_idx(A) == 0, bnd_idx(B) < bnd_nbr-1, bnd_idx(C) < bnd_nbr */
+    while(bnd_idx<bnd_nbr-1){
+      /* Only first triangle must search for B, subsequent triangles recycle previous C as current B */
+      if(tri_nbr == 0){
+	/* Skip repeated points that must occur when polygon has fewer than allowed vertices */
+	while(lon_bnd[idx_a] == lon_bnd[idx_a+bnd_idx] && lat_bnd[idx_a] == lat_bnd[idx_a+bnd_idx]){
+	  /* Next vertice may not duplicate A */
+	  bnd_idx++;
+	  /* If there is no room for C then all triangles found */
+	  if(bnd_idx == bnd_nbr-1) break;
+	} /* !while */
+	/* Jump to next column when all triangles found */
+	if(bnd_idx == bnd_nbr-1) break;
+      } /* !tri_nbr */
+      idx_b=idx_a+bnd_idx;
+      /* Search for C at next vertice */
+      bnd_idx++;
+      while(lon_bnd[idx_b] == lon_bnd[idx_a+bnd_idx] && lat_bnd[idx_b] == lat_bnd[idx_a+bnd_idx]){
+	/* Next vertice may not duplicate B */
+	bnd_idx++;
+	/* If there is no room for C then all triangles found */
+	if(bnd_idx == bnd_nbr) break;
+      } /* !while */
+      /* Jump to next column when all triangles found */
+      if(bnd_idx == bnd_nbr) break;
+      idx_c=idx_a+bnd_idx;
+      /* Valid triangle, vertices are known and labeled */
+      tri_nbr++;
+      /* Compute interior angle/great circle arc a for first triangle; subsequent triangles recycle previous arc c */
+      if(tri_nbr == 1){
+	/* 20150831: Test by computing ncol=0 area in conus chevrons grid:
+	   ncks -O -D 5 -v FSNT --map ${DATA}/maps/map_ne30np4_to_fv257x512_aave.20150823.nc ${DATA}/ne30/rgr/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc ${DATA}/ne30/rgr/fv_FSNT.nc
+	   ncks -O -D 5 -v FSNT --map ${DATA}/maps/map_fv257x512_to_conusx4v1np4_chevrons_bilin.20150901.nc ${DATA}/ne30/rgr/fv_FSNT.nc ${DATA}/ne30/rgr/dogfood.nc
+	   ncks -H -s %20.15e -v area -d ncol,0 ${DATA}/ne30/rgr/dogfood.nc
+	   ncks -H -s %20.15e -v grid_area -d grid_size,0 ${DATA}/grids/conusx4v1np4_chevrons_scrip_c150815.nc
+	   
+	   ncol=0 on conus chevrons file:
+	   3.653857995295246e-05 raw GLL weight
+	   3.653857995294302e-05 matlab N-2 triangles
+	   3.653857995294301e-05 matlab N   triangles
+	   3.653857995294258e-05 new NCO (haversine)
+	   3.653857995289623e-05 old NCO (acos) */
+	/* Computing great circle arcs over small arcs requires care since the central angle is near 0 degrees
+	   Cosine small angles changes slowly for such angles, and leads to precision loss
+	   Use haversine formula instead of sphereical law of cosines formula
+	   https://en.wikipedia.org/wiki/Great-circle_distance */
+	/* Interior angle/great circle arc a, spherical law of cosines formula (loses precision):
+	   cos_a=lat_bnd_cos[idx_a]*lon_bnd_cos[idx_a]*lat_bnd_cos[idx_b]*lon_bnd_cos[idx_b]+
+	   lat_bnd_cos[idx_a]*lon_bnd_sin[idx_a]*lat_bnd_cos[idx_b]*lon_bnd_sin[idx_b]+
+	   lat_bnd_sin[idx_a]*lat_bnd_sin[idx_b];ngl_a=acos(cos_a); */
+	/* Interior angle/great circle arc a, haversine formula: */
+	lon_dlt=fabs(lon_bnd_rdn[idx_a]-lon_bnd_rdn[idx_b]);
+	lat_dlt=fabs(lat_bnd_rdn[idx_a]-lat_bnd_rdn[idx_b]);
+	sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_a]*lat_bnd_cos[idx_b]*pow(sin(0.5*lon_dlt),2));
+	ngl_a=2.0*asin(sin_hlf_tht);
+      }else{
+	ngl_a=ngl_c;
+      } /* !tri_nbr */
+      /* Interior angle/great circle arc b */
+      lon_dlt=fabs(lon_bnd_rdn[idx_b]-lon_bnd_rdn[idx_c]);
+      lat_dlt=fabs(lat_bnd_rdn[idx_b]-lat_bnd_rdn[idx_c]);
+      sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_b]*lat_bnd_cos[idx_c]*pow(sin(0.5*lon_dlt),2));
+      ngl_b=2.0*asin(sin_hlf_tht);
+      /* Interior angle/great circle arc c */
+      lon_dlt=fabs(lon_bnd_rdn[idx_c]-lon_bnd_rdn[idx_a]);
+      lat_dlt=fabs(lat_bnd_rdn[idx_c]-lat_bnd_rdn[idx_a]);
+      sin_hlf_tht=sqrt(pow(sin(0.5*lat_dlt),2)+lat_bnd_cos[idx_c]*lat_bnd_cos[idx_a]*pow(sin(0.5*lon_dlt),2));
+      ngl_c=2.0*asin(sin_hlf_tht);
+      /* Ill-conditioned? */
+      if(((float)ngl_a == (float)ngl_b && (float)ngl_a == (float)(0.5*ngl_c)) || /* c is half a and b */
+	 ((float)ngl_b == (float)ngl_c && (float)ngl_b == (float)(0.5*ngl_a)) || /* a is half b and c */
+	 ((float)ngl_c == (float)ngl_a && (float)ngl_c == (float)(0.5*ngl_b))){  /* b is half c and a */
+	(void)fprintf(stdout,"%s: WARNING %s reports col_idx = %u triangle %d is ill-conditioned. Spherical excess and thus cell area are likely inaccurate. Ask Charlie to implement SAS formula...\n",nco_prg_nm_get(),fnc_nm,col_idx,tri_nbr);
+      } /* !ill */
+      /* Semi-perimeter */
+      prm_smi=0.5*(ngl_a+ngl_b+ngl_c);
+      /* L'Huillier's formula */
+      xcs_sph_qtr_tan=sqrt(tan(0.5*prm_smi)*tan(0.5*(prm_smi-ngl_a))*tan(0.5*(prm_smi-ngl_b))*tan(0.5*(prm_smi-ngl_c)));
+      xcs_sph=4.0*atan(xcs_sph_qtr_tan);
+      area[col_idx]+=xcs_sph;
+      /* Begin search for next B at current C */
+      bnd_idx=idx_c-idx_a;
+    } /* !tri_idx */
+    if(nco_dbg_lvl_get() >= nco_dbg_io) (void)fprintf(stdout,"%s: INFO %s reports col_idx = %u has %d triangles\n",nco_prg_nm_get(),fnc_nm,col_idx,tri_nbr);
+  } /* !col_idx */
+  if(lat_bnd_rdn) lat_bnd_rdn=(double *)nco_free(lat_bnd_rdn);
+  if(lon_bnd_rdn) lon_bnd_rdn=(double *)nco_free(lon_bnd_rdn);
+  if(lat_bnd_cos) lat_bnd_cos=(double *)nco_free(lat_bnd_cos);
+  if(lon_bnd_cos) lon_bnd_cos=(double *)nco_free(lon_bnd_cos);
+  if(lat_bnd_sin) lat_bnd_sin=(double *)nco_free(lat_bnd_sin);
+  if(lon_bnd_sin) lon_bnd_sin=(double *)nco_free(lon_bnd_sin);
+
+} /* !nco_sph_plg_area() */
+
+int /* O [enm] Return code */
+nco_rgr_tps /* [fnc] Regrid using Tempest library */
+(rgr_sct * const rgr) /* I/O [sct] Regridding structure */
+{
+  /* Purpose: Regrid fields using Tempest remapping "library" (more precisely, executables)
+
+     Test Tempest library: no way to activate yet
      export DATA_TEMPEST='/data/zender/rgr';ncks -O --rgr=Y ${DATA}/rgr/essgcm14_clm.nc ~/foo.nc */
 
   const char fnc_nm[]="nco_rgr_tps()";
@@ -2603,7 +3198,7 @@ nco_grd_2D_sng /* [fnc] Convert two-dimensional grid-type enum to string */
 {
   /* Purpose: Convert two-dimensional grid-type enum to string */
   switch(nco_grd_2D_typ){
-  case nco_grd_2D_unk: return "Unknown or unclassified 2D grid type (e.g., POP displaced-pole)";
+  case nco_grd_2D_unk: return "Unknown or unclassified 2D grid type (e.g., curvilinear, POP displaced-pole)";
   case nco_grd_2D_gss: return "Gaussian latitude grid. Used by spectral transform models, e.g., CCM 1-3, CAM 1-3, LSM, MATCH, UCICTM.";
   case nco_grd_2D_fv: return "Cap grid. Uniform/Equi-angle (except at poles) latitude grid with poles are considered at (and labeled as) centers of first and last gridcells (i.e., lat_ctr[0]=-90), and those polar gridcells span half the equi-angular latitude increment. AKA FV-scalar grid (in Lin-Rood representation). Used by CAM FV, GEOS-CHEM, UCICTM, UKMO.";
   case nco_grd_2D_eqa: return "Uniform/Equi-Angular latitude grid. Uniform/Equi-angle (everywhere) latitude grid. When global (not regional) in extent, poles are at edges of first and last gridcells (i.e., lat_ctr[0]=-89.xxx). When global forms valid FV-staggered AKA FV velocity grid (for Lin-Rood representation). Used by CIESIN/SEDAC, IGBP-DIS, TOMS AAI.";
@@ -2620,7 +3215,7 @@ nco_grd_lat_sng /* [fnc] Convert latitude grid-type enum to string */
 {
   /* Purpose: Convert latitude grid-type enum to string */
   switch(nco_grd_lat_typ){
-  case nco_grd_lat_unk: return "Unknown or unclassified latitude grid type (e.g., curvilinear)";
+  case nco_grd_lat_unk: return "Unknown or unclassified latitude grid type (e.g., curvilinear, POP3)";
   case nco_grd_lat_gss: return "Gaussian latitude grid used by global spectral models: CCM 1-3, CAM 1-3, LSM, MATCH, UCICTM";
   case nco_grd_lat_fv: return "Cap-latitude grid. Uniform/Equi-angle (except at poles) latitude grid with poles are considered at (and labeled as) centers of first and last gridcells (i.e., lat_ctr[0]=-90), and those polar gridcells span half the equi-angular latitude increment. AKA FV-scalar grid (in Lin-Rood representation). Used by: CAM FV, GEOS-CHEM, UCICTM, UKMO";
   case nco_grd_lat_eqa: return "Uniform/Equi-Angular latitude grid. Uniform/Equi-angle (everywhere) latitude grid. When global (not regional) in extent, poles are at edges of first and last gridcells (e.g., lat_ctr[0]=-89.xxx). When global can be latitude-component of a valid FV-staggered grid AKA FV velocity grid (for Lin-Rood representation). Used by: CIESIN/SEDAC, IGBP-DIS, TOMS AAI";
@@ -2817,24 +3412,33 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
      NCAR:
      /glade/p/cesm/cseg/mapping/grids
 
-     Generate normal RLL grids:
-     ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr grid=${DATA}/grids/180x360_SCRIP.20150820.nc --rgr lat_nbr=180 --rgr lon_nbr=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.20150820.nc --rgr lat_nbr=90 --rgr lon_nbr=180 --rgr lat_typ=eqa --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
+     Generate global RLL grids:
+     ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr grid=${DATA}/grids/180x360_SCRIP.20150901.nc --rgr lat_nbr=180 --rgr lon_nbr=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 lat_nbr=90 --rgr lon_nbr=180 --rgr lat_typ=eqa --rgr lon_typ=Grn_ctr ~/nco/data/in.nc ~/foo.nc
 
-     Generate maps for normal RLL grids:
-     ESMF_RegridWeightGen -s ${DATA}/grids/180x360_SCRIP.20150820.nc -d ${DATA}/grids/90x180_SCRIP.20150820.nc -w ${DATA}/maps/map_180x360_to_90x180.20150820.nc --method conserve
-     ESMF_RegridWeightGen -s ${DATA}/grids/90x180_SCRIP.20150820.nc -d ${DATA}/grids/180x360_SCRIP.20150820.nc -w ${DATA}/maps/map_90x180_to_180x360.20150820.nc --method conserve
+     Generate 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:
-     ncks -O -D 1 --rgr grd_ttl='FV-scalar grid 129x256' --rgr grid=${DATA}/grids/129x256_SCRIP.20150724.nc --rgr lat_nbr=129 --rgr lon_nbr=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.20150724.nc --rgr lat_nbr=257 --rgr lon_nbr=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.20150724.nc --rgr lat_nbr=801 --rgr lon_nbr=1600 --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 129x256' --rgr grid=${DATA}/grids/129x256_SCRIP.20150910.nc --rgr lat_nbr=129 --rgr lon_nbr=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 lat_nbr=257 --rgr lon_nbr=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 lat_nbr=801 --rgr lon_nbr=1600 --rgr lat_typ=cap --rgr lon_typ=Grn_ctr  ~/nco/data/in.nc ~/foo.nc
 
      Generate ACME maps:
-     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/129x256_SCRIP.20150724.nc -w ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150724.nc --method conserve
-     ESMF_RegridWeightGen -s ${DATA}/grids/ne30np4_pentagons.091226.nc -d ${DATA}/grids/257x512_SCRIP.20150724.nc -w ${DATA}/maps/map_ne30np4_to_fv257x512_bilin.20150724.nc --method bilinear
-     ESMF_RegridWeightGen -s ${DATA}/grids/ne120np4_pentagons.100310.nc -d ${DATA}/grids/257x512_SCRIP.20150724.nc -w ${DATA}/maps/map_ne120np4_to_fv257x512_aave.20150724.nc --method conserve
-     ESMF_RegridWeightGen -s ${DATA}/grids/ne120np4_pentagons.100310.nc -d ${DATA}/grids/801x1600_SCRIP.20150724.nc -w ${DATA}/maps/map_ne120np4_to_fv801x1600_bilin.20150724.nc --method bilinear */
+     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:
+     ncks -O -D 1 --rgr grd_ttl='Equiangular grid 180x360' --rgr grid=${DATA}/sld/rgr/grd_dst.nc --rgr lat_nbr=100 --rgr lon_nbr=100 --rgr snwe=30.0,70.0,-120.0,-90.0 ~/nco/data/in.nc ~/foo.nc
+
+     Generate 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 lat_nbr=180 --rgr lon_nbr=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 lat_nbr=10 --rgr lon_nbr=20 --rgr snwe=-5.0,5.0,-10.0,10.0 ~/nco/data/in.nc ~/foo.nc */
 
   const char fnc_nm[]="nco_grd_mk()"; /* [sng] Function name */
 
@@ -2843,14 +3447,15 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
 
   const int dmn_nbr_1D=1; /* [nbr] Rank of 1-D grid variables */
   const int dmn_nbr_2D=2; /* [nbr] Rank of 2-D grid variables */
-  const int dmn_nbr_grd_max=dmn_nbr_2D; /* [nbr] Maximum rank of grid variables */
+  const int dmn_nbr_3D=3; /* [nbr] Rank of 3-D grid variables */
+  const int dmn_nbr_grd_max=dmn_nbr_3D; /* [nbr] Maximum rank of grid variables */
   const int itr_nbr_max=20; // [nbr] Maximum number of iterations
  
   const nc_type crd_typ=NC_DOUBLE;
 
   char *fl_out_tmp=NULL_CEWI;
   char *fl_out;
-  char area_nm[]="grid_area"; /* 20150830: NB ESMF_RegridWeightGen --user_areas looks for variable named "grid_area" */
+  char grd_area_nm[]="grid_area"; /* 20150830: NB ESMF_RegridWeightGen --user_areas looks for variable named "grid_area" */
   char dmn_sz_nm[]="grid_dims";
   char grd_crn_lat_nm[]="grid_corner_lat";
   char grd_crn_lon_nm[]="grid_corner_lon";
@@ -2877,6 +3482,8 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   double *lon_ntf=NULL; /* [dgr] Longitude interfaces of rectangular grid */
 
   double area_ttl=0.0; /* [frc] Exact sum of area */
+  double lat_crv; /* [dgr] Latitudinal  curvilinearity */
+  double lon_crv; /* [dgr] Longitudinal curvilinearity */
   double lat_nrt; /* [dgr] Latitude of northern edge of grid */
   double lat_sth; /* [dgr] Latitude of southern edge of grid */
   double lat_wgt_ttl=0.0; /* [frc] Actual sum of quadrature weights */
@@ -2914,16 +3521,17 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   long dmn_cnt[dmn_nbr_grd_max];
 
   long bnd_nbr; /* [nbr] Number of bounds in gridcell */
+  long col_nbr; /* [nbr] Number of columns in grid */
+  long crn_idx; /* [idx] Counting index for corners */
   long grd_crn_nbr; /* [nbr] Number of corners in gridcell */
   long grd_rnk_nbr; /* [nbr] Number of dimensions in grid */
   long grd_sz_nbr; /* [nbr] Number of gridcells in grid */
-  long idx; /* [idx] Counting index for unrolled grids */
   long idx2; /* [idx] Counting index for unrolled grids */
+  long idx; /* [idx] Counting index for unrolled grids */
   long lat_idx2; /* [idx] Counting index for unrolled latitude */
-  long lon_idx2; /* [idx] Counting index for unrolled longitude */
-  long crn_idx; /* [idx] Counting index for corners */
   long lat_idx;
   long lat_nbr; /* [nbr] Number of latitudes in grid */
+  long lon_idx2; /* [idx] Counting index for unrolled longitude */
   long lon_idx;
   long lon_nbr; /* [nbr] Number of longitudes in grid */
   
@@ -2932,7 +3540,9 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   nco_bool RAM_CREATE=False; /* [flg] Create file in RAM */
   nco_bool RAM_OPEN=False; /* [flg] Open (netCDF3-only) file(s) in RAM */
   nco_bool WRT_TMP_FL=False; /* [flg] Write output to temporary file */
+  nco_bool flg_grd_1D=False;
   nco_bool flg_grd_2D=False;
+  nco_bool flg_grd_crv=False;
 
   nco_grd_2D_typ_enm grd_typ; /* [enm] Grid-type enum */
   nco_grd_lat_typ_enm lat_typ; /* [enm] Latitude grid-type enum */
@@ -2946,11 +3556,16 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   lon_typ=rgr->lon_typ; /* [enm] Longitude grid type */
   lat_nbr=rgr->lat_nbr; /* [nbr] Number of latitudes in grid */
   lon_nbr=rgr->lon_nbr; /* [nbr] Number of longitudes in grid */
+  lat_crv=rgr->lat_crv; /* [dgr] Latitude  curvilinearity */
+  lon_crv=rgr->lon_crv; /* [dgr] Longitude curvilinearity */
   lat_sth=rgr->lat_sth; /* [dgr] Latitude of southern edge of grid */
   lon_wst=rgr->lon_wst; /* [dgr] Longitude of western edge of grid */
   lat_nrt=rgr->lat_nrt; /* [dgr] Latitude of northern edge of grid */
   lon_est=rgr->lon_est; /* [dgr] Longitude of eastern edge of grid */
 
+  /* Use curvilinear coordinates (lat and lon are 2D arrays) if flg_crv already set or it lat_crv or lon_crv set */
+  if(lat_crv != 0.0 || lon_crv != 0.0 || rgr->flg_crv) flg_grd_crv=True;
+
   /* Assume 2D grid */
   flg_grd_2D=True;
   grd_rnk_nbr=dmn_nbr_2D;
@@ -2958,6 +3573,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   grd_crn_nbr=4;
   /* Assume rectangles */
   bnd_nbr=2;
+  col_nbr=lat_nbr*lon_nbr;
   grd_sz_nbr=lat_nbr*lon_nbr;
 
   /* Allocate space for output data */
@@ -2985,7 +3601,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   int lon_psn; /* [idx] Ordinal position of longitude size in rectangular grid */
   int lat_psn; /* [idx] Ordinal position of latitude  size in rectangular grid */
   if(grd_rnk_nbr == dmn_nbr_2D){
-    lon_psn=0;
+    lon_psn=0; /* SCRIP introduced [lon,lat] convention because more natural for Fortran */
     lat_psn=1;
   } /* !flg_grd_in_2D */
   dmn_sz_int[lon_psn]=lon_nbr;
@@ -3065,6 +3681,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   lon_est=lon_wst+lon_ncr*lon_nbr;
 
   /* lon_wst and lon_est have been set and will not change */
+  assert(lon_wst < lon_est);
   lon_ntf[0]=lon_wst;
   lon_ntf[lon_nbr]=lon_est;
 
@@ -3143,7 +3760,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
 
   /* Many grids have center latitude equally spaced between interfaces */
   for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
-      lat_ctr[lat_idx]=0.5*(lat_ntf[lat_idx]+lat_ntf[lat_idx+1]);
+    lat_ctr[lat_idx]=0.5*(lat_ntf[lat_idx]+lat_ntf[lat_idx+1]);
 
   /* Cap grids excepted---they place centers of first/last gridcells at poles */
   if(lat_typ == nco_grd_lat_fv){
@@ -3172,7 +3789,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
     (void)fprintf(stdout,"lat[%li] = %g, vertices = ",idx,lat_ctr[idx]);
     for(int bnd_idx=0;bnd_idx<bnd_nbr;bnd_idx++)
       (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lat_bnd[bnd_nbr*idx+bnd_idx],bnd_idx == bnd_nbr-1 ? "]\n" : ", ");
-  } /* end loop over lat */
+    } /* end loop over lat */
   } /* endif dbg */
 
   /* Use centers and boundaries to diagnose latitude weights */
@@ -3216,24 +3833,6 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
     lat_crn[idx+3]=lat_ntf[lat_idx+1];
   } /* !lat_idx */
   
-  for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
-    for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
-      area[lat_idx*lon_nbr+lon_idx]=dgr2rdn*(lon_bnd[2*lon_idx+1]-lon_bnd[2*lon_idx])*(sin(dgr2rdn*lat_bnd[2*lat_idx+1])-sin(dgr2rdn*lat_bnd[2*lat_idx]));
-
-  if(flg_grd_2D){
-    if(nco_dbg_lvl_get() >= nco_dbg_sbr){
-      (void)fprintf(stderr,"%s: INFO %s reports destination rectangular latitude grid:\n",nco_prg_nm_get(),fnc_nm);
-      lat_wgt_ttl=0.0;
-      area_ttl=0.0;
-      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
-	lat_wgt_ttl+=lat_wgt[lat_idx];
-      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
-	for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
-	  area_ttl+=area[lat_idx*lon_nbr+lon_idx];
-      (void)fprintf(stdout,"lat_wgt_ttl = %20.15f, frc_lat_wgt = %20.15f, area_ttl = %20.15f, frc_area = %20.15f\n",lat_wgt_ttl,lat_wgt_ttl/2.0,area_ttl,area_ttl/(4.0*M_PI));
-    } /* endif dbg */
-  } /* !flg_grd_2D */
-
   /* Stuff rectangular arrays into unrolled arrays */
   for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
     for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
@@ -3250,6 +3849,74 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
     } /* !lon */
   } /* !lat */
   
+  if(flg_grd_crv){
+    /* Impose curvilinearity by adding lon_crv offset to each row relative to previous row, and lat_crv offset to each column relative to previous column */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
+	idx=lat_idx*lon_nbr+lon_idx;
+	grd_ctr_lat[idx]+=lon_idx*lat_crv;
+	grd_ctr_lon[idx]+=lat_idx*lon_crv;
+	for(crn_idx=0;crn_idx<grd_crn_nbr;crn_idx++){
+	  idx2=grd_crn_nbr*idx+crn_idx;
+	  lat_idx2=lat_idx*grd_crn_nbr+crn_idx;
+	  lon_idx2=lon_idx*grd_crn_nbr+crn_idx;
+	  grd_crn_lat[idx2]=lat_crn[lat_idx2];
+	  grd_crn_lon[idx2]=lon_crn[lon_idx2];
+	  if(crn_idx == 0 || crn_idx == 1){
+	    grd_crn_lat[idx2]+=lat_idx*lat_crv; /* LL, LR */
+	    grd_crn_lon[idx2]+=lat_idx*lon_crv; /* LL, LR */
+	  }else if(crn_idx == 2 || crn_idx == 3){
+	    grd_crn_lat[idx2]+=(lat_idx+1)*lat_crv; /* UL, UR */
+	    grd_crn_lon[idx2]+=(lat_idx+1)*lon_crv; /* UL, UR */
+	  } /* !crn */
+	} /* !crn */
+      } /* !lon */
+    } /* !lat */
+  } /* !flg_grd_crv */
+
+  if(nco_dbg_lvl_get() >= nco_dbg_std){
+    long int idx_crn_ll;
+    long int idx_crn_lr;
+    long int idx_crn_ur;
+    long int idx_crn_ul;
+    long idx_dbg;
+    idx_dbg=rgr->idx_dbg;
+    idx_crn_ll=grd_crn_nbr*idx_dbg+0;
+    idx_crn_lr=grd_crn_nbr*idx_dbg+1;
+    idx_crn_ur=grd_crn_nbr*idx_dbg+2;
+    idx_crn_ul=grd_crn_nbr*idx_dbg+3;
+    (void)fprintf(stderr,"%s: INFO %s idx_dbg = %li, Center [lat,lon]=[%g,%g]; Corners LL [%g,%g] LR [%g,%g] UR [%g,%g] UL [%g,%g]\n",nco_prg_nm_get(),fnc_nm,idx_dbg,grd_ctr_lat[idx_dbg],grd_ctr_lon[idx_dbg],grd_crn_lat[idx_crn_ll],grd_crn_lon[idx_crn_ll],grd_crn_lat[idx_crn_lr],grd_crn_lon[idx_crn_lr],grd_crn_lat[idx_crn_ur],grd_crn_lon[idx_crn_ur],grd_crn_lat[idx_crn_ul],grd_crn_lon[idx_crn_ul]);
+  } /* !dbg */
+
+  if(flg_grd_crv){
+    /* Area of arbitrary curvilinear grids requires spherical trigonometry */
+    nco_sph_plg_area(grd_crn_lat,grd_crn_lon,grd_sz_nbr,grd_crn_nbr,area);
+  }else{
+    /* Area of rectangular spherical zones from elementary calculus results
+       20150906: Half-angle formulae for better conditioning improve area normalization for 801x1600 by 2.0e-15 
+       area[lat_idx*lon_nbr+lon_idx]=dgr2rdn*(lon_bnd[2*lon_idx+1]-lon_bnd[2*lon_idx])*2.0*(sin(0.5*dgr2rdn*lat_bnd[2*lat_idx+1])*cos(0.5*dgr2rdn*lat_bnd[2*lat_idx+1])-sin(0.5*dgr2rdn*lat_bnd[2*lat_idx])*cos(0.5*dgr2rdn*lat_bnd[2*lat_idx])); 
+       Gain not worth the extra complexity */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
+	area[lat_idx*lon_nbr+lon_idx]=dgr2rdn*(lon_bnd[2*lon_idx+1]-lon_bnd[2*lon_idx])*(sin(dgr2rdn*lat_bnd[2*lat_idx+1])-sin(dgr2rdn*lat_bnd[2*lat_idx]));
+  } /* !flg_grd_2D */
+
+  if(nco_dbg_lvl_get() >= nco_dbg_sbr){
+    lat_wgt_ttl=0.0;
+    area_ttl=0.0;
+    if(flg_grd_2D){
+      (void)fprintf(stderr,"%s: INFO %s reports destination rectangular latitude grid:\n",nco_prg_nm_get(),fnc_nm);
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+	lat_wgt_ttl+=lat_wgt[lat_idx];
+    } /* !flg_grd_2D */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
+	area_ttl+=area[lat_idx*lon_nbr+lon_idx];
+    (void)fprintf(stdout,"lat_wgt_ttl = %20.15f, frc_lat_wgt = %20.15f, area_ttl = %20.15f, frc_area = %20.15f\n",lat_wgt_ttl,lat_wgt_ttl/2.0,area_ttl,area_ttl/(4.0*M_PI));
+    assert(area_ttl > 0.0);
+    assert(area_ttl <= 4.0*M_PI);
+  } /* endif dbg */
+
   /* Open grid file */
   fl_out_tmp=nco_fl_out_open(fl_out,FORCE_APPEND,FORCE_OVERWRITE,fl_out_fmt,&bfr_sz_hnt,RAM_CREATE,RAM_OPEN,WRT_TMP_FL,&out_id);
 
@@ -3260,7 +3927,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   
   /* Define variables */
   (void)nco_def_var(out_id,dmn_sz_nm,(nc_type)NC_INT,dmn_nbr_1D,&dmn_id_grd_rnk,&dmn_sz_int_id);
-  (void)nco_def_var(out_id,area_nm,(nc_type)crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&area_id);
+  (void)nco_def_var(out_id,grd_area_nm,(nc_type)crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&area_id);
   (void)nco_def_var(out_id,msk_nm,(nc_type)NC_INT,dmn_nbr_1D,&dmn_id_grd_sz,&msk_id);
   (void)nco_def_var(out_id,grd_ctr_lat_nm,crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&grd_ctr_lat_id);
   (void)nco_def_var(out_id,grd_ctr_lon_nm,crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&grd_ctr_lon_id);
@@ -3317,6 +3984,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   if(att_val) att_val=(char *)nco_free(att_val);
   
   (void)nco_hst_att_cat(out_id,rgr->cmd_ln);
+  (void)nco_vrs_att_cat(out_id);
 
   att_nm=strdup("latitude_grid_type");
   att_val=strdup(nco_grd_lat_sng(lat_typ));
@@ -3347,7 +4015,7 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   att_nm=strdup("units");
   att_val=strdup("steradian");
   aed_mtd.att_nm=att_nm;
-  aed_mtd.var_nm=area_nm;
+  aed_mtd.var_nm=grd_area_nm;
   aed_mtd.id=area_id;
   aed_mtd.sz=strlen(att_val);
   aed_mtd.type=NC_CHAR;
@@ -3413,6 +4081,278 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   /* Close output file and move it from temporary to permanent location */
   (void)nco_fl_out_cls(fl_out,fl_out_tmp,out_id);
   
+  fl_out=rgr->fl_skl;
+  if(fl_out){
+    /* Write skeleton data file on requested grid
+       Skeleton file can then be populated with data for testing */
+    char *area_nm;
+    char *bnd_nm;
+    //    char *bnd_tm_nm;
+    char *col_nm_out;
+    char *lat_nm_out; /* [sng] Name of output dimension for latitude */
+    char *lat_wgt_nm;
+    char *lon_nm_out; /* [sng] Name of variable to recognize as longitude */
+    char *lat_bnd_nm; /* [sng] Name of latitude  boundary variable */
+    char *lon_bnd_nm; /* [sng] Name of longitude boundary variable */
+
+    //    int area_id; /* [id] Variable ID for area */
+    int dmn_id_bnd; /* [id] Dimension ID */
+    //int dmn_id_bnd_tm; /* [id] Dimension ID */
+    int dmn_id_col; /* [id] Dimension ID */
+    int dmn_id_lat; /* [id] Dimension ID */
+    int dmn_id_lon; /* [id] Dimension ID */
+    int lat_bnd_id; /* [id] Variable ID for lat_bnds/lat_vertices */
+    int lat_id; /* [id] Variable ID for latitude */
+    int lat_wgt_id; /* [id] Variable ID for latitude weight */
+    int lon_bnd_id; /* [id] Variable ID for lon_bnds/lon_vertices */
+    int lon_id; /* [id] Variable ID for longitude */
+    
+    /* Name output dimensions */
+    area_nm=rgr->area_nm;
+    bnd_nm=rgr->bnd_nm;
+    //bnd_tm_nm=rgr->bnd_tm_nm;
+    col_nm_out=rgr->col_nm_out;
+    lat_nm_out=rgr->lat_nm_out;
+    lon_nm_out=rgr->lon_nm_out;
+    lat_bnd_nm=rgr->lat_bnd_nm;
+    lat_wgt_nm=rgr->lat_wgt_nm;
+    lon_bnd_nm=rgr->lon_bnd_nm;
+    /* Use names discovered by fuzzing */
+    if(flg_grd_1D){
+      bnd_nm=rgr->vrt_nm;
+      lat_bnd_nm=rgr->lat_vrt_nm;
+      lon_bnd_nm=rgr->lon_vrt_nm;
+    } /* !flg_grd_1D */
+    if(flg_grd_2D){
+      bnd_nm=rgr->bnd_nm;
+      lat_bnd_nm=rgr->lat_bnd_nm;
+      lon_bnd_nm=rgr->lon_bnd_nm;
+    } /* !flg_grd_2D */
+    
+    /* Open grid file */
+    fl_out_tmp=nco_fl_out_open(fl_out,FORCE_APPEND,FORCE_OVERWRITE,fl_out_fmt,&bfr_sz_hnt,RAM_CREATE,RAM_OPEN,WRT_TMP_FL,&out_id);
+    
+    /* Define dimensions */
+    if(flg_grd_crv){
+      rcd=nco_def_dim(out_id,bnd_nm,grd_crn_nbr,&dmn_id_bnd);
+    }else{
+      rcd=nco_def_dim(out_id,bnd_nm,bnd_nbr,&dmn_id_bnd);
+    } /* !flg_grd_crv */
+    if(flg_grd_1D){
+      rcd=nco_def_dim(out_id,col_nm_out,col_nbr,&dmn_id_col);
+    } /* !flg_grd_1D */
+    if(flg_grd_2D){
+      rcd=nco_def_dim(out_id,lat_nm_out,lat_nbr,&dmn_id_lat);
+      rcd=nco_def_dim(out_id,lon_nm_out,lon_nbr,&dmn_id_lon);
+    } /* !flg_grd_2D */
+    
+  /* Define new coordinates and variables in regridded file */
+    if(flg_grd_1D){
+      (void)nco_def_var(out_id,lat_nm_out,crd_typ,dmn_nbr_1D,&dmn_id_col,&lat_id);
+      (void)nco_def_var(out_id,lon_nm_out,crd_typ,dmn_nbr_1D,&dmn_id_col,&lon_id);
+      dmn_ids[0]=dmn_id_col;
+      dmn_ids[1]=dmn_id_bnd;
+      (void)nco_def_var(out_id,lat_bnd_nm,crd_typ,dmn_nbr_2D,dmn_ids,&lat_bnd_id);
+      dmn_ids[0]=dmn_id_col;
+      dmn_ids[1]=dmn_id_bnd;
+      (void)nco_def_var(out_id,lon_bnd_nm,crd_typ,dmn_nbr_2D,dmn_ids,&lon_bnd_id);
+      (void)nco_def_var(out_id,area_nm,crd_typ,dmn_nbr_1D,&dmn_id_col,&area_id);
+    } /* !flg_grd_1D */
+    if(flg_grd_crv){
+      dmn_ids[0]=dmn_id_lat;
+      dmn_ids[1]=dmn_id_lon;
+      (void)nco_def_var(out_id,lat_nm_out,crd_typ,dmn_nbr_2D,dmn_ids,&lat_id);
+      (void)nco_def_var(out_id,lon_nm_out,crd_typ,dmn_nbr_2D,dmn_ids,&lon_id);
+      (void)nco_def_var(out_id,area_nm,crd_typ,dmn_nbr_2D,dmn_ids,&area_id);
+      dmn_ids[0]=dmn_id_lat;
+      dmn_ids[1]=dmn_id_lon;
+      dmn_ids[2]=dmn_id_bnd;
+      (void)nco_def_var(out_id,lat_bnd_nm,crd_typ,dmn_nbr_3D,dmn_ids,&lat_bnd_id);
+      (void)nco_def_var(out_id,lon_bnd_nm,crd_typ,dmn_nbr_3D,dmn_ids,&lon_bnd_id);
+    }else if(flg_grd_2D){
+      (void)nco_def_var(out_id,lat_nm_out,crd_typ,dmn_nbr_1D,&dmn_id_lat,&lat_id);
+      (void)nco_def_var(out_id,lon_nm_out,crd_typ,dmn_nbr_1D,&dmn_id_lon,&lon_id);
+      dmn_ids[0]=dmn_id_lat;
+      dmn_ids[1]=dmn_id_bnd;
+      (void)nco_def_var(out_id,lat_bnd_nm,crd_typ,dmn_nbr_2D,dmn_ids,&lat_bnd_id);
+      dmn_ids[0]=dmn_id_lon;
+      dmn_ids[1]=dmn_id_bnd;
+      (void)nco_def_var(out_id,lon_bnd_nm,crd_typ,dmn_nbr_2D,dmn_ids,&lon_bnd_id);
+      (void)nco_def_var(out_id,lat_wgt_nm,crd_typ,dmn_nbr_1D,&dmn_id_lat,&lat_wgt_id);
+      dmn_ids[0]=dmn_id_lat;
+      dmn_ids[1]=dmn_id_lon;
+      (void)nco_def_var(out_id,area_nm,crd_typ,dmn_nbr_2D,dmn_ids,&area_id);
+    } /* !flg_grd_2D */
+    
+    /* Define "units" attributes */
+    att_nm=strdup("title");
+    att_val=strdup(rgr->grd_ttl);
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=NULL;
+    aed_mtd.id=NC_GLOBAL;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("Conventions");
+    att_val=strdup("CF-1.6");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=NULL;
+    aed_mtd.id=NC_GLOBAL;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("created_by");
+    att_val=strdup(usr_cpp);
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=NULL;
+    aed_mtd.id=NC_GLOBAL;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    (void)nco_hst_att_cat(out_id,rgr->cmd_ln);
+    (void)nco_vrs_att_cat(out_id);
+    
+    att_nm=strdup("latitude_grid_type");
+    att_val=strdup(nco_grd_lat_sng(lat_typ));
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=NULL;
+    aed_mtd.id=NC_GLOBAL;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("longitude_grid_type");
+    att_val=strdup(nco_grd_lon_sng(lon_typ));
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=NULL;
+    aed_mtd.id=NC_GLOBAL;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("units");
+    att_val=strdup("steradian");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=area_nm;
+    aed_mtd.id=area_id;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    (void)nco_aed_prc(out_id,area_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    att_nm=strdup("units");
+    att_val=strdup("degrees");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.sz=strlen(att_val);
+    aed_mtd.type=NC_CHAR;
+    aed_mtd.val.cp=att_val;
+    aed_mtd.mode=aed_create;
+    /* Add same units attribute to four different variables */
+    aed_mtd.var_nm=lat_nm_out;
+    aed_mtd.id=lat_id;
+    (void)nco_aed_prc(out_id,lat_id,aed_mtd);
+    aed_mtd.var_nm=lon_nm_out;
+    aed_mtd.id=lon_id;
+    (void)nco_aed_prc(out_id,lon_id,aed_mtd);
+    aed_mtd.var_nm=lat_bnd_nm;
+    aed_mtd.id=lat_bnd_id;
+    (void)nco_aed_prc(out_id,lat_bnd_id,aed_mtd);
+    aed_mtd.var_nm=lon_bnd_nm;
+    aed_mtd.id=lon_bnd_id;
+    (void)nco_aed_prc(out_id,lon_bnd_id,aed_mtd);
+    if(att_nm) att_nm=(char *)nco_free(att_nm);
+    if(att_val) att_val=(char *)nco_free(att_val);
+    
+    /* Begin data mode */
+    (void)nco_enddef(out_id);
+    
+    /* Write new coordinates and variables to regridded file */
+    if(flg_grd_1D){
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=col_nbr;
+      (void)nco_put_vara(out_id,lat_id,dmn_srt,dmn_cnt,lat_ctr,crd_typ);
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=col_nbr;
+      (void)nco_put_vara(out_id,lon_id,dmn_srt,dmn_cnt,lon_ctr,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=col_nbr;
+      dmn_cnt[1]=bnd_nbr;
+      (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt,dmn_cnt,lat_bnd,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=col_nbr;
+      dmn_cnt[1]=bnd_nbr;
+      (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt,dmn_cnt,lon_bnd,crd_typ);
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=col_nbr;
+      (void)nco_put_vara(out_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+    } /* !flg_grd_1D */
+    if(flg_grd_crv){
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=lat_nbr;
+      dmn_cnt[1]=lon_nbr;
+      (void)nco_put_vara(out_id,lat_id,dmn_srt,dmn_cnt,grd_ctr_lat,crd_typ);
+      (void)nco_put_vara(out_id,lon_id,dmn_srt,dmn_cnt,grd_ctr_lon,crd_typ);
+      (void)nco_put_vara(out_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;dmn_srt[2]=0L;
+      dmn_cnt[0]=lat_nbr;
+      dmn_cnt[1]=lon_nbr;
+      dmn_cnt[2]=grd_crn_nbr;
+      (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt,dmn_cnt,grd_crn_lat,crd_typ);
+      (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt,dmn_cnt,grd_crn_lon,crd_typ);
+    }else if(flg_grd_2D){
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=lat_nbr;
+      (void)nco_put_vara(out_id,lat_id,dmn_srt,dmn_cnt,lat_ctr,crd_typ);
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=lon_nbr;
+      (void)nco_put_vara(out_id,lon_id,dmn_srt,dmn_cnt,lon_ctr,crd_typ);
+      dmn_srt[0]=0L;
+      dmn_cnt[0]=lat_nbr;
+      (void)nco_put_vara(out_id,lat_wgt_id,dmn_srt,dmn_cnt,lat_wgt,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=lat_nbr;
+      dmn_cnt[1]=bnd_nbr;
+      (void)nco_put_vara(out_id,lat_bnd_id,dmn_srt,dmn_cnt,lat_bnd,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=lon_nbr;
+      dmn_cnt[1]=bnd_nbr;
+      (void)nco_put_vara(out_id,lon_bnd_id,dmn_srt,dmn_cnt,lon_bnd,crd_typ);
+      dmn_srt[0]=dmn_srt[1]=0L;
+      dmn_cnt[0]=lat_nbr;
+      dmn_cnt[1]=lon_nbr;
+      (void)nco_put_vara(out_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+    } /* !flg_grd_2D */
+    
+    /* Close output file and move it from temporary to permanent location */
+    (void)nco_fl_out_cls(fl_out,fl_out_tmp,out_id);
+  } /* !fl_out */
+  
   /* Free memory associated with input file */
   if(dmn_sz_int) dmn_sz_int=(int *)nco_free(dmn_sz_int);
   if(msk) msk=(int *)nco_free(msk);
@@ -3436,3 +4376,1053 @@ nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   return rcd;
 } /* !nco_grd_mk() */
 
+int /* O [enm] Return code */
+nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from input data file */
+(rgr_sct * const rgr) /* I/O [sct] Regridding structure */
+{
+  /* Purpose: Use grid information and guesswork to create SCRIP-format grid file from input data file
+     
+     Test curvilinear grids:
+     ncks -O -D 1 --rgr nfr=y --rgr grid=${DATA}/sld/rgr/grd_airs.nc ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.nc ~/foo.nc
+     ncks -O -D 1 --rgr nfr=y --rgr grid=${DATA}/sld/rgr/grd_airs.nc ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc ~/foo.nc */
+
+  const char fnc_nm[]="nco_grd_nfr()"; /* [sng] Function name */
+
+  const double rdn2dgr=180.0/M_PI;
+  const double dgr2rdn=M_PI/180.0;
+
+  const int dmn_nbr_1D=1; /* [nbr] Rank of 1-D grid variables */
+  const int dmn_nbr_2D=2; /* [nbr] Rank of 2-D grid variables */
+  const int dmn_nbr_3D=3; /* [nbr] Rank of 3-D grid variables */
+  const int dmn_nbr_grd_max=dmn_nbr_3D; /* [nbr] Maximum rank of grid variables */
+  const int itr_nbr_max=20; // [nbr] Maximum number of iterations
+ 
+  const nc_type crd_typ=NC_DOUBLE;
+
+  char *area_nm_in=NULL;
+  char *fl_in;
+  char *fl_out;
+  char *fl_out_tmp=NULL_CEWI;
+  char *fl_pth_lcl=NULL;
+  char *msk_nm_in=NULL;
+  char dmn_nm[NC_MAX_NAME]; /* [sng] Dimension name */
+
+  char area_nm[]="grid_area"; /* 20150830: NB ESMF_RegridWeightGen --user_areas looks for variable named "grid_area" */
+  char dmn_sz_nm[]="grid_dims";
+  char grd_crn_lat_nm[]="grid_corner_lat";
+  char grd_crn_lon_nm[]="grid_corner_lon";
+  char grd_crn_nm[]="grid_corners";
+  char grd_ctr_lat_nm[]="grid_center_lat";
+  char grd_ctr_lon_nm[]="grid_center_lon";
+  char grd_rnk_nm[]="grid_rank";
+  char grd_sz_nm[]="grid_size";
+  char msk_nm[]="grid_imask";
+  
+  double *grd_ctr_lat; /* [dgr] Latitude  centers of grid */
+  double *grd_ctr_lon; /* [dgr] Longitude centers of grid */
+  double *grd_crn_lat; /* [dgr] Latitude  corners of grid */
+  double *grd_crn_lon; /* [dgr] Longitude corners of grid */
+  double *area; /* [sr] Area of grid */
+  double *lat_bnd=NULL_CEWI; /* [dgr] Latitude  boundaries of rectangular grid */
+  double *lat_crn=NULL; /* [dgr] Latitude  corners of rectangular grid */
+  double *lat_ctr=NULL_CEWI; /* [dgr] Latitude  centers of rectangular grid */
+  double *lat_ntf=NULL; /* [dgr] Latitude  interfaces of rectangular grid */
+  double *lat_wgt=NULL; /* [dgr] Latitude  weights of rectangular grid */
+  double *lon_bnd=NULL_CEWI; /* [dgr] Longitude boundaries of rectangular grid */
+  double *lon_crn=NULL; /* [dgr] Longitude corners of rectangular grid */
+  double *lon_ctr=NULL_CEWI; /* [dgr] Longitude centers of rectangular grid */
+  double *lon_ntf=NULL; /* [dgr] Longitude interfaces of rectangular grid */
+
+  double area_ttl=0.0; /* [frc] Exact sum of area */
+  double lat_nrt; /* [dgr] Latitude of northern edge of grid */
+  //double lat_sth; /* [dgr] Latitude of southern edge of grid */
+  double lat_wgt_ttl=0.0; /* [frc] Actual sum of quadrature weights */
+  double lat_wgt_gss; /* [frc] Latitude weight estimated from interface latitudes */
+  //  double lon_est; /* [dgr] Longitude of eastern edge of grid */
+  //  double lon_wst; /* [dgr] Longitude of western edge of grid */
+  //  double lon_ncr; /* [dgr] Longitude increment */
+  double lat_ncr; /* [dgr] Latitude increment */
+  double lon_spn; /* [dgr] Longitude span */
+  double lat_spn; /* [dgr] Latitude span */
+
+  int *msk=NULL; /* [flg] Mask of grid */
+  int *dmn_sz_int; /* [nbr] Array of dimension sizes of grid */
+
+  int dmn_ids[dmn_nbr_grd_max]; /* [id] Dimension IDs array for output variable */
+
+  int dmn_idx; /* [idx] Dimension index */
+  int fl_out_fmt=NC_FORMAT_CLASSIC; /* [enm] Output file format */
+  int in_id; /* I [id] Input netCDF file ID */
+  int md_open; /* [enm] Mode flag for nc_open() call */
+  int out_id; /* I [id] Output netCDF file ID */
+  int rcd=NC_NOERR;
+
+  int area_id=NC_MIN_INT; /* [id] Area variable ID */
+  int dmn_id_grd_crn; /* [id] Grid corners dimension ID */
+  int dmn_id_grd_rnk; /* [id] Grid rank dimension ID */
+  int dmn_id_grd_sz; /* [id] Grid size dimension ID */
+  int dmn_sz_int_id; /* [id] Grid dimension sizes ID */
+  int grd_crn_lat_id; /* [id] Grid corner latitudes  variable ID */
+  int grd_crn_lon_id; /* [id] Grid corner longitudes variable ID */
+  int grd_ctr_lat_id; /* [id] Grid center latitudes  variable ID */
+  int grd_ctr_lon_id; /* [id] Grid center longitudes variable ID */
+  int itr_cnt; /* Iteration counter */
+  int lat_rnk; /* [nbr] Rank of latitude coordinate */
+  int lon_rnk; /* [nbr] Rank of longitude coordinate */
+  int lat_ctr_id; /* [id] Latitude centers of rectangular grid variable ID */
+  int lon_ctr_id; /* [id] Longitude centers of rectangular grid variable ID */
+  int lat_bnd_id=NC_MIN_INT; /* [id] Latitude centers of rectangular grid variable ID */
+  int lon_bnd_id=NC_MIN_INT; /* [id] Longitude centers of rectangular grid variable ID */
+  int msk_id=NC_MIN_INT; /* [id] Mask variable ID */
+  int var_id; /* [id] Current variable ID */
+
+  long dmn_srt[dmn_nbr_grd_max];
+  long dmn_cnt[dmn_nbr_grd_max];
+
+  long bnd_idx;
+  long bnd_nbr; /* [nbr] Number of bounds in gridcell */
+  long dmn_sz; /* [nbr] Size of current dimension */
+  long grd_crn_nbr; /* [nbr] Number of corners in gridcell */
+  long grd_rnk_nbr; /* [nbr] Number of dimensions in grid */
+  long grd_sz_nbr; /* [nbr] Number of gridcells in grid */
+  long idx; /* [idx] Counting index for unrolled grids */
+  long idx2; /* [idx] Counting index for unrolled grids */
+  long lat_idx2; /* [idx] Counting index for unrolled latitude */
+  long lon_idx2; /* [idx] Counting index for unrolled longitude */
+  long crn_idx; /* [idx] Counting index for corners */
+  long lat_idx;
+  long lat_nbr; /* [nbr] Number of latitudes in grid */
+  long lon_idx;
+  long lon_nbr; /* [nbr] Number of longitudes in grid */
+  
+  nco_bool FL_RTR_RMT_LCN;
+  nco_bool FORCE_APPEND=False; /* Option A */
+  nco_bool FORCE_OVERWRITE=True; /* Option O */
+  nco_bool RAM_CREATE=False; /* [flg] Create file in RAM */
+  nco_bool RAM_OPEN=False; /* [flg] Open (netCDF3-only) file(s) in RAM */
+  nco_bool RM_RMT_FL_PST_PRC=True; /* Option R */
+  nco_bool WRT_TMP_FL=False; /* [flg] Write output to temporary file */
+  nco_bool flg_grd_2D=False;
+  nco_bool flg_grd_crv=False;
+
+  nco_grd_2D_typ_enm grd_typ; /* [enm] Grid-type enum */
+  nco_grd_lat_typ_enm lat_typ; /* [enm] Latitude grid-type enum */
+  nco_grd_lon_typ_enm lon_typ; /* [enm] Longitude grid-type enum */
+
+  size_t bfr_sz_hnt=NC_SIZEHINT_DEFAULT; /* [B] Buffer size hint */
+
+  /* Algorithm:
+     Read grid information from input data file (aka *_in)
+     Close input file
+     Once grid dimensions known, allocate output grid arrays (aka *_out)
+     Open output file (aka grid-file)
+     Use guesswork and standard algorithms to fill-in output arrays */
+
+  /* Duplicate (because nco_fl_mk_lcl() free()'s fl_in) */
+  fl_in=(char *)strdup(rgr->fl_in);
+  /* Make sure file is on local system and is readable or die trying */
+  fl_in=nco_fl_mk_lcl(fl_in,fl_pth_lcl,&FL_RTR_RMT_LCN);
+  /* Open file using appropriate buffer size hints and verbosity */
+  if(RAM_OPEN) md_open=NC_NOWRITE|NC_DISKLESS; else md_open=NC_NOWRITE;
+  rcd+=nco_fl_open(fl_in,md_open,&bfr_sz_hnt,&in_id);
+
+  /* Identify grid-related variables, usually latitude and longitude */
+  char *bnd_dmn_nm=NULL_CEWI; /* [sng] Name of dimension to recognize as bounds */
+  char *lat_dmn_nm=NULL_CEWI; /* [sng] Name of dimension to recognize as latitude */
+  char *lon_dmn_nm=NULL_CEWI; /* [sng] Name of dimension to recognize as longitude */
+  char *lat_nm_in=NULL_CEWI; /* [sng] Name of variable to recognize as latitude */
+  char *lon_nm_in=NULL_CEWI; /* [sng] Name of variable to recognize as longitude */
+  char *lat_bnd_nm=NULL_CEWI; /* [sng] Name of latitude  boundary variable */
+  char *lon_bnd_nm=NULL_CEWI; /* [sng] Name of longitude boundary variable */
+  int dmn_id_bnd=NC_MIN_INT; /* [id] Dimension ID */
+  int dmn_id_lat; /* [id] Dimension ID */
+  int dmn_id_lon; /* [id] Dimension ID */
+
+  /* Locate dimensions that must be present */
+  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,"Lat",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("Lat");
+
+  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");
+  else 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");
+
+  /* Try known curvilinear dimension names */
+  if(!lat_dmn_nm || !lon_dmn_nm){
+    if(!lat_dmn_nm){
+      if((rcd=nco_inq_dimid_flg(in_id,"south_north",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("south_north"); /* WRF */
+      else if((rcd=nco_inq_dimid_flg(in_id,"YDim:location",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("YDim:location"); /* AIRS L3 */
+      else if((rcd=nco_inq_dimid_flg(in_id,"GeoTrack",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("GeoTrack"); /* AIRS L2 DAP NC */
+      else if((rcd=nco_inq_dimid_flg(in_id,"GeoTrack :L2_Standard_atmospheric&surface_product",&dmn_id_lat)) == NC_NOERR) lat_dmn_nm=strdup("GeoTrack:L2_Standard_atmospheric&surface_product"); /* AIRS L2 HDF */
+      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 */
+    } /* !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,"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 */
+      else if((rcd=nco_inq_dimid_flg(in_id,"phony_dim_1",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("phony_dim_1"); /* OMI */
+      else if((rcd=nco_inq_dimid_flg(in_id,"x",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("phony_dim_1"); /* MAR */
+      else if((rcd=nco_inq_dimid_flg(in_id,"lon2d",&dmn_id_lon)) == NC_NOERR) lon_dmn_nm=strdup("phony_dim_1"); /* RACMO */
+    } /* !lon_dmn_nm */
+    if(lat_dmn_nm && lon_dmn_nm) flg_grd_crv=True;
+  } /* !lat_dmn_nm */
+
+  if(!lat_dmn_nm || !lon_dmn_nm){
+    (void)fprintf(stdout,"%s: ERROR %s unable to identify latitude and/or longitude dimension.\n",nco_prg_nm_get(),fnc_nm);
+    nco_exit(EXIT_FAILURE);
+  } /* !lat_dmn_nm */
+    
+  /* Locate dimensions that may be present */
+  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,"nbnd",&dmn_id_bnd)) == NC_NOERR) bnd_dmn_nm=strdup("nbnd"); /* CAM-FV, CAM-SE */
+  else if((rcd=nco_inq_dimid_flg(in_id,"tbnd",&dmn_id_bnd)) == NC_NOERR) bnd_dmn_nm=strdup("tbnd"); /* CAM3 */
+  
+  /* Locate fields that must be present in input file */
+  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,"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,"LAT",&lat_ctr_id)) == NC_NOERR) lat_nm_in=strdup("LAT"); /* MAR */
+
+  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,"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,"LON",&lon_ctr_id)) == NC_NOERR) lon_nm_in=strdup("LON"); /* MAR */
+
+  if(!lat_nm_in || !lon_nm_in){
+    (void)fprintf(stdout,"%s: ERROR %s unable to identify latitude and/or longitude variable.\n",nco_prg_nm_get(),fnc_nm);
+    nco_exit(EXIT_FAILURE);
+  } /* !lat_nm_in */
+    
+  /* Use dimension IDs to get dimension sizes and grid size*/
+  rcd+=nco_inq_dimlen(in_id,dmn_id_lat,&lat_nbr);
+  rcd+=nco_inq_dimlen(in_id,dmn_id_lon,&lon_nbr);
+  if(dmn_id_bnd != NC_MIN_INT) rcd+=nco_inq_dimlen(in_id,dmn_id_bnd,&grd_crn_nbr);
+  if(dmn_id_bnd != NC_MIN_INT) rcd+=nco_inq_dimlen(in_id,dmn_id_bnd,&bnd_nbr);
+    
+  /* Rank of coordinates determines whether grid is curvilinear */
+  rcd+=nco_inq_varndims(in_id,lat_ctr_id,&lat_rnk);
+  rcd+=nco_inq_varndims(in_id,lon_ctr_id,&lon_rnk);
+  if(lat_rnk == dmn_nbr_2D || lon_rnk == dmn_nbr_2D) flg_grd_crv=True;
+  if(lat_rnk > dmn_nbr_2D || lon_rnk > dmn_nbr_2D){
+    (void)fprintf(stdout,"%s: ERROR %s reports an identified grid variable (%s and/or %s) has rank %d---grid variables current must have rank 1 or 2. HINT: If grid variables do not vary in time, then temporally average them (with, e.g., ncwa -a time in.nc out.nc) prior to inferring grid\n",nco_prg_nm_get(),fnc_nm,lat_nm_in,lon_nm_in,lat_rnk);
+    nco_exit(EXIT_FAILURE);
+  } /* !3D */
+  if(lat_rnk*lon_rnk != 1 && lat_rnk*lon_rnk != 4) assert(False);
+  
+  if(flg_grd_crv){
+    /* Assume curvilinear grid (e.g., WRF) */
+    flg_grd_2D=False;
+    grd_rnk_nbr=dmn_nbr_2D;
+    grd_typ=nco_grd_2D_unk;
+    lat_typ=nco_grd_lat_unk;
+    lon_typ=nco_grd_lon_unk;
+    /* Assume curvilinear grids that do not specify otherwise use quadrilaterals */
+    if(dmn_id_bnd == NC_MIN_INT) grd_crn_nbr=4;
+    /* Assume quadrilaterals are, well, quadrilaterals (e.g., rhomboids) not necessarily rectangles
+       Non-quadrilateral curvilinear grids are untested */
+    if(grd_crn_nbr == 4) bnd_nbr=4; else assert(False);
+  }else{
+    /* Assume 2D grid of uninitialized type */
+    flg_grd_2D=True;
+    grd_rnk_nbr=dmn_nbr_2D;
+    grd_typ=nco_grd_2D_nil;
+    lat_typ=nco_grd_lat_nil;
+    lon_typ=nco_grd_lon_nil;
+    /* Assume rectangular grids that do not specify otherwise use quadrilaterals */
+    if(dmn_id_bnd == NC_MIN_INT) grd_crn_nbr=4;
+    /* Convention is to archive only two bounds for rectangular grids (since sides are identical)
+       Non-quadrilateral rectangular grids are untested */
+    if(grd_crn_nbr == 4) bnd_nbr=2; else assert(False);
+    } /* !flg_grd_2D */
+    
+  /* Allocate space for output data */
+  grd_sz_nbr=lat_nbr*lon_nbr;
+  dmn_sz_int=(int *)nco_malloc(grd_rnk_nbr*nco_typ_lng((nc_type)NC_INT));
+  area=(double *)nco_malloc(grd_sz_nbr*nco_typ_lng(crd_typ));
+  msk=(int *)nco_malloc(grd_sz_nbr*nco_typ_lng((nc_type)NC_INT));
+  
+  if(flg_grd_crv){
+    lat_bnd=(double *)nco_malloc(lat_nbr*bnd_nbr*nco_typ_lng(crd_typ));
+    lat_crn=(double *)nco_malloc(grd_sz_nbr*grd_crn_nbr*nco_typ_lng(crd_typ));
+    lat_ctr=(double *)nco_malloc(grd_sz_nbr*nco_typ_lng(crd_typ));
+    lat_ntf=(double *)nco_malloc((lat_nbr+1L)*nco_typ_lng(crd_typ));
+    lat_wgt=(double *)nco_malloc(lat_nbr*nco_typ_lng(crd_typ));
+    lon_bnd=(double *)nco_malloc(lon_nbr*bnd_nbr*nco_typ_lng(crd_typ));
+    lon_crn=(double *)nco_malloc(grd_sz_nbr*grd_crn_nbr*nco_typ_lng(crd_typ));
+    lon_ctr=(double *)nco_malloc(grd_sz_nbr*nco_typ_lng(crd_typ));
+    lon_ntf=(double *)nco_malloc((lon_nbr+1L)*nco_typ_lng(crd_typ));
+  }else{ /* !flg_grd_crv */
+    lat_bnd=(double *)nco_malloc(lat_nbr*bnd_nbr*nco_typ_lng(crd_typ));
+    lat_crn=(double *)nco_malloc(lat_nbr*grd_crn_nbr*nco_typ_lng(crd_typ));
+    lat_ctr=(double *)nco_malloc(lat_nbr*nco_typ_lng(crd_typ));
+    lat_ntf=(double *)nco_malloc((lat_nbr+1L)*nco_typ_lng(crd_typ));
+    lat_wgt=(double *)nco_malloc(lat_nbr*nco_typ_lng(crd_typ));
+    lon_bnd=(double *)nco_malloc(lon_nbr*bnd_nbr*nco_typ_lng(crd_typ));
+    lon_crn=(double *)nco_malloc(lon_nbr*grd_crn_nbr*nco_typ_lng(crd_typ));
+    lon_ctr=(double *)nco_malloc(lon_nbr*nco_typ_lng(crd_typ));
+    lon_ntf=(double *)nco_malloc((lon_nbr+1L)*nco_typ_lng(crd_typ));
+  } /* !flg_grd_crv */
+  
+  grd_ctr_lat=(double *)nco_malloc(grd_sz_nbr*nco_typ_lng(crd_typ));
+  grd_ctr_lon=(double *)nco_malloc(grd_sz_nbr*nco_typ_lng(crd_typ));
+  grd_crn_lat=(double *)nco_malloc(grd_crn_nbr*grd_sz_nbr*nco_typ_lng(crd_typ));
+  grd_crn_lon=(double *)nco_malloc(grd_crn_nbr*grd_sz_nbr*nco_typ_lng(crd_typ));
+  
+  /* Locate fields that may be present in input file */
+  if((rcd=nco_inq_varid_flg(in_id,"lat_bnds",&lat_bnd_id)) == NC_NOERR) lat_bnd_nm=strdup("lat_bnds");
+  else if((rcd=nco_inq_varid_flg(in_id,"lat_ntf",&lat_bnd_id)) == NC_NOERR) lat_bnd_nm=strdup("lat_ntf");
+  if((rcd=nco_inq_varid_flg(in_id,"lon_bnds",&lon_bnd_id)) == NC_NOERR) lon_bnd_nm=strdup("lon_bnds");
+  else if((rcd=nco_inq_varid_flg(in_id,"lon_ntf",&lon_bnd_id)) == NC_NOERR) lon_bnd_nm=strdup("lon_ntf");
+
+  if((rcd=nco_inq_varid_flg(in_id,"area",&area_id)) == NC_NOERR) area_nm_in=strdup("area");
+  else if((rcd=nco_inq_varid_flg(in_id,"Area",&area_id)) == NC_NOERR) area_nm_in=strdup("Area");
+  else if((rcd=nco_inq_varid_flg(in_id,"grid_area",&area_id)) == NC_NOERR) area_nm_in=strdup("grid_area");
+  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");
+
+  if(flg_grd_crv){
+    /* Obtain fields that must be present in input file */
+    dmn_srt[0]=dmn_srt[1]=0L;
+    dmn_cnt[0]=lat_nbr;
+    dmn_cnt[1]=lon_nbr;
+    rcd=nco_get_vara(in_id,lat_ctr_id,dmn_srt,dmn_cnt,lat_ctr,crd_typ);
+    rcd=nco_get_vara(in_id,lon_ctr_id,dmn_srt,dmn_cnt,lon_ctr,crd_typ);
+
+    /* 20150923: fxm also input corners, area, mask, if present in curvilinear file */
+    if(area_id != NC_MIN_INT) rcd=nco_get_vara(in_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+    
+  } /* !flg_grd_crv */
+
+  if(flg_grd_2D){
+    int lon_psn_in; /* [idx] Ordinal position of longitude size in rectangular grid */
+    int lat_psn_in; /* [idx] Ordinal position of latitude  size in rectangular grid */
+
+    /* Obtain fields that must be present in input file */
+    dmn_srt[0]=0L;
+    dmn_cnt[0]=lat_nbr;
+    rcd=nco_get_vara(in_id,lat_ctr_id,dmn_srt,dmn_cnt,lat_ctr,crd_typ);
+    dmn_srt[0]=0L;
+    dmn_cnt[0]=lon_nbr;
+    rcd=nco_get_vara(in_id,lon_ctr_id,dmn_srt,dmn_cnt,lon_ctr,crd_typ);
+
+    /* Obtain fields that may be present in input file */
+    if(area_id != NC_MIN_INT){
+      var_id=area_id;
+      rcd=nco_inq_vardimid(in_id,var_id,dmn_ids);
+      /* fxm: optimize discovery of lat/lon ordering */
+      for(dmn_idx=0;dmn_idx<grd_rnk_nbr;dmn_idx++){
+	rcd=nco_inq_dimname(in_id,dmn_ids[dmn_idx],dmn_nm);
+	rcd+=nco_inq_dimlen(in_id,dmn_ids[dmn_idx],&dmn_sz);
+	if(!strcmp(dmn_nm,lat_dmn_nm)){
+	  assert(dmn_sz == lat_nbr);
+	  assert(dmn_idx == 0);
+	  lat_psn_in=dmn_idx;
+	} /* !lat */
+	if(!strcmp(dmn_nm,lon_dmn_nm)){
+	  assert(dmn_sz == lon_nbr);
+	  assert(dmn_idx == 0);
+	  lon_psn_in=dmn_idx;
+	} /* !lon */
+      } /* !dmn_idx */
+      dmn_srt[lat_psn_in]=0L;
+      dmn_cnt[lat_psn_in]=lat_nbr;
+      dmn_srt[lon_psn_in]=0L;
+      dmn_cnt[lon_psn_in]=lon_nbr;
+      rcd=nco_get_vara(in_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+    } /* !area */
+
+    if(msk_id != NC_MIN_INT){
+      var_id=msk_id;
+      rcd=nco_inq_vardimid(in_id,var_id,dmn_ids);
+      dmn_srt[lat_psn_in]=0L;
+      dmn_cnt[lat_psn_in]=lat_nbr;
+      dmn_srt[lon_psn_in]=0L;
+      dmn_cnt[lon_psn_in]=lon_nbr;
+      rcd=nco_get_vara(in_id,msk_id,dmn_srt,dmn_cnt,msk,NC_INT);
+    } /* !msk */
+
+  } /* !flg_grd_2D */
+    
+  /* Close input netCDF file */
+  nco_close(in_id);
+
+  /* Remove local copy of file */
+  if(FL_RTR_RMT_LCN && RM_RMT_FL_PST_PRC) (void)nco_fl_rm(fl_in);
+
+  /* Above this line, fl_in and in_id refer to input file to be regridded
+     Below this line, fl_out and out_id refer to grid-file to be output */
+  fl_out=rgr->fl_grd;
+
+  /* Define output variable values */
+  int lon_psn; /* [idx] Ordinal position of longitude size in rectangular grid */
+  int lat_psn; /* [idx] Ordinal position of latitude  size in rectangular grid */
+  if(grd_rnk_nbr == dmn_nbr_2D){
+    lon_psn=0; /* SCRIP introduced [lon,lat] convention because more natural for Fortran */
+    lat_psn=1;
+  } /* !flg_grd_in_2D */
+  dmn_sz_int[lon_psn]=lon_nbr;
+  dmn_sz_int[lat_psn]=lat_nbr;
+
+  if(flg_grd_crv){
+    /* Interfaces (ntf) and boundaries (bnd) for curvilinear grids are ill-defined since sides need not follow latitudes nor meridians 
+       Simplest representation that contains equivalent information to interfaces/boundaries is grid corners array
+       Diagnose grid corners from midpoints
+       Most curvilinear data (e.g., WRF) is dimensioned lat x lon unlike SCRIP which uses lon x lat 
+       Hence we keep lat_ctr, lon_ctr, lat_crn, lon_crn with same order (likely lat x lon) as data file from which we infer grid
+       Always use input order to write skeleton file
+       Change that order, if necessary, to write SCRIP grid file
+       In the interior of a curvilinear grid, nine points contribute to the four corners of a quadrilater surrounding each center point
+       These are the three points above the point, the three points at the same latitude, and the three points beneath the point
+       In other words, a nine-point stencil is required to define the four corners inferred from about each gridcell center
+       It is cleanest to use this stencil only once for all cells, including those on the edges, not the interior
+       For this to work we must define an enlarged grid where we pre-copy the values that to the desired extrapolation at the edges
+       Inspired by array-based solutions to integration of PDEs on meshes in Juri Toomre's class */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
+	idx=lat_idx*lon_nbr+lon_idx;
+	grd_ctr_lat[idx]=lat_ctr[idx];
+	grd_ctr_lon[idx]=lon_ctr[idx];
+      } /* !lon */
+    } /* !lat */
+    double *lat_ctr_fk; /* [dgr] Latitude  grid with extrapolated boundaries necessary for 9-point template to find four grid corners for each real center */
+    double *lon_ctr_fk; /* [dgr] Longitude grid with extrapolated boundaries necessary for 9-point template to find four grid corners for each real center */
+    lat_ctr_fk=(double *)nco_malloc((lat_nbr+2)*(lon_nbr+2)*sizeof(double));
+    lon_ctr_fk=(double *)nco_malloc((lat_nbr+2)*(lon_nbr+2)*sizeof(double));
+    long int idx_rl; /* [idx] Index into real unrolled array */
+    long int idx_fk; /* [idx] Index into fake unrolled array */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){ /* lat idx on real grid */
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){ /* lon idx on real grid */
+	idx_rl=lat_idx*lon_nbr+lon_idx;
+	idx_fk=(lat_idx+1)*(lon_nbr+2)+lon_idx+1;
+	/* Copy real grid to interior of fake grid */
+	lat_ctr_fk[idx_fk]=lat_ctr[idx_rl];
+	lon_ctr_fk[idx_fk]=lon_ctr[idx_rl];
+      } /* !lon */
+    } /* !lat */
+    /* 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 */
+    /* Top row */
+    lat_idx=lat_nbr+1; /* 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 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 */
+    /* Left side */
+    lon_idx=0; /* lon idx of extrapolated point on fake grid */
+    for(lat_idx=1;lat_idx<lat_nbr+1;lat_idx++){ /* lat idx of extrapolated point on fake grid */
+      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]);
+    } /* !lat */
+    /* Right side */
+    lon_idx=lon_nbr+1; /* lon idx of extrapolated point on fake grid */
+    for(lat_idx=1;lat_idx<lat_nbr+1;lat_idx++){ /* lat idx of extrapolated point on fake grid */
+      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]);
+    } /* !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]);
+    /* 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]);
+    /* 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]);
+    /* 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]);
+
+    if(nco_dbg_lvl_get() >= nco_dbg_std){
+      long idx_dbg;
+      idx_dbg=rgr->idx_dbg;
+      (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 */
+
+    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;
+    long int idx_fk_crn_ll_ctr_lr;
+    long int idx_fk_crn_ll_ctr_ur;
+    long int idx_fk_crn_ll_ctr_ul;
+    long int idx_fk_crn_lr_ctr_ll;
+    long int idx_fk_crn_lr_ctr_lr;
+    long int idx_fk_crn_lr_ctr_ur;
+    long int idx_fk_crn_lr_ctr_ul;
+    long int idx_fk_crn_ur_ctr_ll;
+    long int idx_fk_crn_ur_ctr_lr;
+    long int idx_fk_crn_ur_ctr_ur;
+    long int idx_fk_crn_ur_ctr_ul;
+    long int idx_fk_crn_ul_ctr_ll;
+    long int idx_fk_crn_ul_ctr_lr;
+    long int idx_fk_crn_ul_ctr_ur;
+    long int idx_fk_crn_ul_ctr_ul;
+    long int idx_crn_ll;
+    long int idx_crn_lr;
+    long int idx_crn_ur;
+    long int idx_crn_ul;
+    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
+	   Read variables idx_crn_ll_ctr_ul as "index of upper left gridcell center that contributes to lower-left gridcell corner"
+	   Algorithms execute in counter-clockwise (CCW) direction: lower-left, lower-right, upper-right, upper-left
+	   lat_idx and lon_idx are true indices and are used to write into grd_crn_lat/lon arrays
+	   lat_idx_fk and lon_idx_fk are indices into fake arrays with extrapolated boundaries and are used to read data from fake arrays */
+	lon_idx_fk=lon_idx+1;
+	lat_idx_fk=lat_idx+1;
+	
+	idx_rl=lat_idx*lon_nbr+lon_idx;
+	idx_fk=lat_idx_fk*(lon_nbr+2)+lon_idx_fk;
+
+	/* Determine index into fake array (valid everywhere it is applied) 
+	   Comments after each equation are formula for real index (valid only at grid interiors) */
+	idx_fk_crn_ll_ctr_ll=idx_fk-(lon_nbr+2)-1; // (lat_idx-1)*lon_nbr+lon_idx-1
+	idx_fk_crn_ll_ctr_lr=idx_fk-(lon_nbr+2); // (lat_idx-1)*lon_nbr+lon_idx
+	idx_fk_crn_ll_ctr_ur=idx_fk; // lat_idx*lon_nbr+lon_idx
+	idx_fk_crn_ll_ctr_ul=idx_fk-1; // lat_idx*lon_nbr+lon_idx-1;
+
+	idx_fk_crn_lr_ctr_ll=idx_fk-(lon_nbr+2); // (lat_idx-1)*lon_nbr+lon_idx
+	idx_fk_crn_lr_ctr_lr=idx_fk-(lon_nbr+2)+1; // (lat_idx-1)*lon_nbr+lon_idx+1
+	idx_fk_crn_lr_ctr_ur=idx_fk+1; // lat_idx*lon_nbr+lon_idx+1
+	idx_fk_crn_lr_ctr_ul=idx_fk; // lat_idx*lon_nbr+lon_idx;
+
+	idx_fk_crn_ur_ctr_ll=idx_fk; // lat_idx*lon_nbr+lon_idx
+	idx_fk_crn_ur_ctr_lr=idx_fk+1; // lat_idx*lon_nbr+lon_idx+1
+	idx_fk_crn_ur_ctr_ur=idx_fk+(lon_nbr+2)+1; // (lat_idx+1)*lon_nbr+lon_idx+1
+	idx_fk_crn_ur_ctr_ul=idx_fk+(lon_nbr+2); // (lat_idx+1)*lon_nbr+lon_idx;
+	
+	idx_fk_crn_ul_ctr_ll=idx_fk-1; // lat_idx*lon_nbr+lon_idx-1
+	idx_fk_crn_ul_ctr_lr=idx_fk; // lat_idx*lon_nbr+lon_idx
+	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;
+	
+	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]);
+	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]);
+	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]);
+	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 */
+    } /* !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);
+
+    /* Copy inferred corners into empty output array */
+    if(lat_bnd_id == NC_MIN_INT && lon_bnd_id == NC_MIN_INT){
+      for(idx=0;idx<grd_sz_nbr*grd_crn_nbr;idx++){
+	grd_crn_lat[idx]=lat_crn[idx];
+	grd_crn_lon[idx]=lon_crn[idx];
+      } /* !idx */
+    } /* end else */
+      
+    if(nco_dbg_lvl_get() >= nco_dbg_std){
+      long idx_dbg;
+      idx_dbg=rgr->idx_dbg;
+      idx_crn_ll=grd_crn_nbr*idx_dbg+0;
+      idx_crn_lr=grd_crn_nbr*idx_dbg+1;
+      idx_crn_ur=grd_crn_nbr*idx_dbg+2;
+      idx_crn_ul=grd_crn_nbr*idx_dbg+3;
+      (void)fprintf(stderr,"%s: INFO %s idx_dbg = %li, Center [lat,lon]=[%g,%g]; Corners LL [%g,%g] LR [%g,%g] UR [%g,%g] UL [%g,%g]\n",nco_prg_nm_get(),fnc_nm,idx_dbg,lat_ctr[idx_dbg],lon_ctr[idx_dbg],lat_crn[idx_crn_ll],lon_crn[idx_crn_ll],lat_crn[idx_crn_lr],lon_crn[idx_crn_lr],lat_crn[idx_crn_ur],lon_crn[idx_crn_ur],lat_crn[idx_crn_ul],lon_crn[idx_crn_ul]);
+    } /* !dbg */
+
+    /* Find span of curvilinear grid */
+    double lat_max; /* [dgr] Maximum latitude */
+    double lat_min; /* [dgr] Minimum latitude */
+    double lon_max; /* [dgr] Maximum longitude */
+    double lon_min; /* [dgr] Minimum longitude */
+    lon_max=lon_crn[0];
+    lat_max=lat_crn[0];
+    lon_min=lon_crn[0];
+    lat_min=lat_crn[0];
+    for(idx=1;idx<grd_sz_nbr*grd_crn_nbr;idx++){
+      lat_max=(lat_crn[idx] > lat_max) ? lat_crn[idx] : lat_max;
+      lon_max=(lon_crn[idx] > lon_max) ? lon_crn[idx] : lon_max;
+      lat_min=(lat_crn[idx] < lat_min) ? lat_crn[idx] : lat_min;
+      lon_min=(lon_crn[idx] < lon_min) ? lon_crn[idx] : lon_min;
+    } /* !idx */
+    lat_spn=lat_max-lat_min;
+    lon_spn=lon_max-lon_min;
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s reports curvilinear grid is %li x %li spanning %g x %g degrees: [%g <= lat <= %g], [%g <= lon <= %g]\n",nco_prg_nm_get(),fnc_nm,lat_nbr,lon_nbr,lat_spn,lon_spn,lat_min,lat_max,lon_min,lon_max);
+  } /* !flg_grd_crv */
+
+  if(flg_grd_2D){
+    /* Interfaces (ntf) assume rectangular grids */
+    lat_ntf[0]=lat_ctr[0]-0.5*(lat_ctr[1]-lat_ctr[0]);
+    for(lat_idx=0;lat_idx<lat_nbr-1;lat_idx++)
+      lat_ntf[lat_idx+1]=0.5*(lat_ctr[lat_idx]+lat_ctr[lat_idx+1]);
+    lat_ntf[lat_nbr]=lat_ctr[lat_nbr-1]+0.5*(lat_ctr[lat_nbr-1]-lat_ctr[lat_nbr-2]);
+    lat_spn=lat_ntf[lat_nbr]-lat_ntf[0];
+    
+    lon_ntf[0]=lon_ctr[0]-0.5*(lon_ctr[1]-lon_ctr[0]);
+    for(lon_idx=0;lon_idx<lon_nbr-1;lon_idx++)
+      lon_ntf[lon_idx+1]=0.5*(lon_ctr[lon_idx]+lon_ctr[lon_idx+1]);
+    lon_ntf[lon_nbr]=lon_ctr[lon_nbr-1]+0.5*(lon_ctr[lon_nbr-1]-lon_ctr[lon_nbr-2]);
+    lon_spn=lon_ntf[lon_nbr]-lon_ntf[0];
+    
+    /* fxm: do not overwrite bounds (bnd), if any, from input file */
+    for(idx=0;idx<lon_nbr;idx++){
+      lon_bnd[2*idx]=lon_ntf[idx];
+      lon_bnd[2*idx+1]=lon_ntf[idx+1];
+    } /* end loop over longitude */
+    for(idx=0;idx<lat_nbr;idx++){
+      lat_bnd[2*idx]=lat_ntf[idx];
+      lat_bnd[2*idx+1]=lat_ntf[idx+1];
+    } /* end loop over latitude */
+  } /* !flg_grd_2D */
+  
+  if(flg_grd_2D){
+    /* Diagnose type of two-dimensional input grid by testing second latitude center against formulae */
+    nco_grd_xtn_enm nco_grd_xtn=nco_grd_xtn_glb; /* [enm] Extent of grid */
+    const double lat_ctr_tst_eqa=lat_ntf[0]+lat_spn*1.5/lat_nbr;
+    const double lat_ctr_tst_fv=lat_ntf[0]+lat_spn/(lat_nbr-1);
+    double lat_ctr_tst_gss;
+    /* In diagnosing grids, agreement with input to single-precision is "good enough for government work"
+       Hence some comparisons cast from double to float before comparison
+       20150526: T42 grid from SCRIP and related maps are only accurate to ~eight digits
+       20150611: map_ne120np4_to_fv801x1600_bilin.150418.nc has yc_b[1600]=-89.775000006 not expected exact value lat_ctr[1]=-89.775000000000006 */
+    if((float)lat_ctr[1] == (float)lat_ctr_tst_eqa) lat_typ=nco_grd_lat_eqa;
+    if((float)lat_ctr[1] == (float)lat_ctr_tst_fv) lat_typ=nco_grd_lat_fv;
+    double *lat_sin=NULL_CEWI; // [frc] Sine of Gaussian latitudes double precision
+    double *wgt_Gss=NULL; // [frc] Gaussian weights double precision
+    if(lat_typ == nco_grd_lat_nil){
+      /* Check for Gaussian grid */
+      lat_sin=(double *)nco_malloc(lat_nbr*sizeof(double));
+      wgt_Gss=(double *)nco_malloc(lat_nbr*sizeof(double));
+      (void)nco_lat_wgt_gss(lat_nbr,lat_sin,wgt_Gss);
+      lat_ctr_tst_gss=rdn2dgr*asin(lat_sin[1]);
+      /* Gaussian weights on output grid will be double-precision accurate
+	 Grid itself is kept as user-specified so area diagnosed by ESMF_RegridWeightGen may be slightly inconsistent with weights */
+      if(nco_dbg_lvl_get() >= nco_dbg_sbr) (void)fprintf(stderr,"%s: INFO %s reports lat_ctr[1] = %g, lat_ctr_tst_gss = %g\n",nco_prg_nm_get(),fnc_nm,lat_ctr[1],lat_ctr_tst_gss);
+      if((float)lat_ctr[1] == (float)lat_ctr_tst_gss) lat_typ=nco_grd_lat_gss;
+    } /* !Gaussian */
+    if(lat_typ == nco_grd_lat_nil){
+      /* If still of unknown type, this 2D grid may be weird
+	 This occurs, e.g., with POP3 destination grid
+	 Change gridtype from nil (which means not-yet-set) to unknown (which means none of the others matched) */
+      lat_typ=nco_grd_lat_unk;
+    } /* !nil */
+    
+    /* Currently grd_lat_typ and grd_2D_typ are equivalent, though that may be relaxed in future */
+    if(lat_typ == nco_grd_lat_unk) grd_typ=nco_grd_2D_unk;
+    else if(lat_typ == nco_grd_lat_gss) grd_typ=nco_grd_2D_gss;
+    else if(lat_typ == nco_grd_lat_fv) grd_typ=nco_grd_2D_fv;
+    else if(lat_typ == nco_grd_lat_eqa) grd_typ=nco_grd_2D_eqa;
+    else assert(False);
+
+    /* Diagnose latitude interfaces as necessary */
+    //    lat_sth=lat_ntf[0];
+    lat_nrt=lat_ntf[lat_nbr];
+    lat_spn=lat_ntf[lat_nbr]-lat_ntf[0];
+    switch(lat_typ){
+    case nco_grd_lat_fv:
+      lat_ncr=lat_spn/(lat_nbr-1);
+      lat_ntf[1]=lat_ntf[0]+0.5*lat_ncr;
+      for(lat_idx=2;lat_idx<lat_nbr;lat_idx++)
+	lat_ntf[lat_idx]=lat_ntf[1]+(lat_idx-1)*lat_ncr;
+      break;
+    case nco_grd_lat_eqa:
+      lat_ncr=lat_spn/lat_nbr;
+      for(lat_idx=1;lat_idx<lat_nbr;lat_idx++)
+	lat_ntf[lat_idx]=lat_ntf[0]+lat_idx*lat_ncr;
+      break;
+    case nco_grd_lat_gss:
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+	lat_ctr[lat_idx]=rdn2dgr*asin(lat_sin[lat_idx]);
+      /* First guess for lat_ntf is midway between Gaussian abscissae */
+      for(lat_idx=1;lat_idx<lat_nbr;lat_idx++)
+	lat_ntf[lat_idx]=0.5*(lat_ctr[lat_idx-1]+lat_ctr[lat_idx]);
+      /* Iterate guess until area between interfaces matches Gaussian weight */
+      for(lat_idx=1;lat_idx<lat_nbr;lat_idx++){
+	double fofx_at_x0; /* [frc] Function to iterate evaluated at current guess */
+	double dfdx_at_x0; /* [frc] Derivation of equation evaluated at current guess */
+	const double eps_rlt_cnv=1.0e-15; // Convergence criterion (1.0e-16 pushes double precision to the brink)
+	itr_cnt=0;
+	lat_wgt_gss=sin(dgr2rdn*lat_ntf[lat_idx])-sin(dgr2rdn*lat_ntf[lat_idx-1]);
+	fofx_at_x0=wgt_Gss[lat_idx-1]-lat_wgt_gss;
+	while(fabs(fofx_at_x0) > eps_rlt_cnv){
+	  /* Newton-Raphson iteration:
+	     Let x=lat_ntf[lat_idx], y0=lat_ntf[lat_idx-1], gw = Gaussian weight (exact solution)
+	     f(x)=sin(dgr2rdn*x)-sin(dgr2rdn*y0)-gw=0 
+	     dfdx(x)=dgr2rdn*(dgr2rdn*x)
+	     x_better=x0-f(x0)/f'(x0) */
+	  dfdx_at_x0=dgr2rdn*cos(dgr2rdn*lat_ntf[lat_idx]);
+	  lat_ntf[lat_idx]+=fofx_at_x0/dfdx_at_x0; /* NB: not sure why this is minus not plus but it works :) */
+	  lat_wgt_gss=sin(dgr2rdn*lat_ntf[lat_idx])-sin(dgr2rdn*lat_ntf[lat_idx-1]);
+	  fofx_at_x0=wgt_Gss[lat_idx-1]-lat_wgt_gss;
+	  if(++itr_cnt > itr_nbr_max){
+	    (void)fprintf(stdout,"%s: ERROR %s reports no convergence in %d iterations for lat_idx = %ld\n",nco_prg_nm_get(),fnc_nm,itr_nbr_max,lat_idx);
+	    nco_exit(EXIT_FAILURE);
+	  } /* endif */
+	} /* !while */
+      } /* !lat */
+      if(lat_sin) lat_sin=(double *)nco_free(lat_sin);
+      break;
+    case nco_grd_lat_unk:
+      /* No generic formula exists so use interfaces already read or diagnosed as midpoints between centers */
+      break;
+    default:
+      nco_dfl_case_generic_err(); break;
+    } /* !lat_typ */
+    /* Ensure rounding errors do not produce unphysical grid */
+    lat_ntf[lat_nbr]=lat_nrt;
+    
+    /* Use centers and boundaries to diagnose latitude weights */
+    switch(lat_typ){
+    case nco_grd_lat_eqa:
+    case nco_grd_lat_fv:
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++) lat_wgt[lat_idx]=sin(dgr2rdn*lat_ntf[lat_idx+1])-sin(dgr2rdn*lat_ntf[lat_idx]);
+      break;
+    case nco_grd_lat_gss:
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++) lat_wgt[lat_idx]=wgt_Gss[lat_idx];
+      break;
+    case nco_grd_lat_unk:
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++) lat_wgt[lat_idx]=sin(dgr2rdn*lat_ntf[lat_idx+1])-sin(dgr2rdn*lat_ntf[lat_idx]);
+      if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: WARNING %s reports unknown input latitude grid-type. Guessing that weights for grid of rectangles is OK.\n",nco_prg_nm_get(),fnc_nm);
+      break;
+    default:
+      nco_dfl_case_generic_err(); break;
+    } /* !lat_typ */
+    
+    /* Diagnose type of longitude grid by testing second longitude center against formulae */
+    lon_spn=lon_ntf[lon_nbr]-lon_ntf[0];
+    lat_spn=lat_ntf[lat_nbr]-lat_ntf[0];
+    if(lon_spn != 360.0 || lat_spn != 180.0) nco_grd_xtn=nco_grd_xtn_rgn;
+    if(lon_typ == nco_grd_lon_nil){
+      if(     (float)lon_ctr[0] ==   0.0 && (float)lon_ctr[1] == (float)(lon_ctr[0]+lon_spn/lon_nbr)) lon_typ=nco_grd_lon_Grn_ctr;
+      else if((float)lon_ctr[0] == 180.0 && (float)lon_ctr[1] == (float)(lon_ctr[0]+lon_spn/lon_nbr)) lon_typ=nco_grd_lon_180_ctr;
+      else if((float)lon_ntf[0] ==   0.0 && (float)lon_ntf[1] == (float)(lon_ntf[0]+lon_spn/lon_nbr)) lon_typ=nco_grd_lon_Grn_wst;
+      else if((float)lon_ntf[0] == 180.0 && (float)lon_ntf[1] == (float)(lon_ntf[0]+lon_spn/lon_nbr)) lon_typ=nco_grd_lon_180_wst;
+      else if((float)lon_ctr[1] == (float)(lon_ctr[0]+lon_spn/lon_nbr)) lon_typ=nco_grd_lon_bb;
+      else lon_typ=nco_grd_lon_unk;
+    } /* !lon_typ */
+
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed input 2D grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_2D_sng(grd_typ));
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed input latitude grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_lat_sng(lat_typ));
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed input longitude grid-type: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_lon_sng(lon_typ));
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stderr,"%s: INFO %s diagnosed input grid-extent: %s\n",nco_prg_nm_get(),fnc_nm,nco_grd_xtn_sng(nco_grd_xtn));
+
+  } /* !flg_grd_2D */
+
+  if(flg_grd_2D){
+    if(nco_dbg_lvl_get() >= nco_dbg_crr){
+      for(idx=0;idx<lat_nbr;idx++){
+	(void)fprintf(stdout,"lat[%li] = %g, vertices = ",idx,lat_ctr[idx]);
+	for(bnd_idx=0;bnd_idx<bnd_nbr;bnd_idx++)
+	  (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lat_bnd[bnd_nbr*idx+bnd_idx],bnd_idx == bnd_nbr-1 ? "]\n" : ", ");
+      } /* end loop over lat */
+      for(idx=0;idx<lon_nbr;idx++){
+	(void)fprintf(stdout,"lon[%li] = %g, vertices = ",idx,lon_ctr[idx]);
+	for(bnd_idx=0;bnd_idx<bnd_nbr;bnd_idx++)
+	  (void)fprintf(stdout,"%s%g%s",bnd_idx == 0 ? "[" : "",lon_bnd[bnd_nbr*idx+bnd_idx],bnd_idx == bnd_nbr-1 ? "]\n" : ", ");
+      } /* end loop over lon */
+    } /* endif dbg */
+    
+    /* Fuzzy test of latitude weight normalization */
+    const double eps_rlt_max=1.0e-14; /* [frc] Round-off error tolerance */
+    double lat_wgt_ttl_xpc; /* [frc] Expected sum of latitude weights */
+    lat_wgt_ttl=0.0;
+    for(idx=0;idx<lat_nbr;idx++) lat_wgt_ttl+=lat_wgt[idx];
+    lat_wgt_ttl_xpc=sin(dgr2rdn*lat_bnd[2*(lat_nbr-1)+1])-sin(dgr2rdn*lat_bnd[0]);
+    if(grd_typ != nco_grd_2D_unk && 1.0-lat_wgt_ttl/lat_wgt_ttl_xpc > eps_rlt_max){
+      (void)fprintf(stdout,"%s: ERROR %s reports grid normalization does not meet precision tolerance eps_rlt_max = %20.15f\nlat_wgt_ttl = %20.15f, lat_wgt_ttl_xpc = %20.15f, lat_wgt_frc = %20.15f, eps_rlt = %20.15f\n",nco_prg_nm_get(),fnc_nm,eps_rlt_max,lat_wgt_ttl,lat_wgt_ttl_xpc,lat_wgt_ttl/lat_wgt_ttl_xpc,1.0-lat_wgt_ttl/lat_wgt_ttl_xpc);
+      nco_exit(EXIT_FAILURE);
+    } /* !imprecise */
+  } /* !flg_grd_2D */
+
+  if(flg_grd_2D){
+    assert(grd_crn_nbr == 4);
+    for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
+      idx=grd_crn_nbr*lon_idx;
+      lon_crn[idx]=lon_ntf[lon_idx]; /* LL */
+      lon_crn[idx+1]=lon_ntf[lon_idx+1]; /* LR */
+      lon_crn[idx+2]=lon_ntf[lon_idx+1]; /* UR */
+      lon_crn[idx+3]=lon_ntf[lon_idx]; /* UL */
+    } /* !lon_idx */
+    
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
+      idx=grd_crn_nbr*lat_idx;
+      lat_crn[idx]=lat_ntf[lat_idx]; /* LL */
+      lat_crn[idx+1]=lat_ntf[lat_idx]; /* LR */
+      lat_crn[idx+2]=lat_ntf[lat_idx+1]; /* UR */
+      lat_crn[idx+3]=lat_ntf[lat_idx+1]; /* UL */
+    } /* !lat_idx */
+  } /* !flg_grd_2D */
+
+  /* Default mask if necessary */
+  if(msk_id == NC_MIN_INT)
+    for(idx=0;idx<grd_sz_nbr;idx++) msk[idx]=1;
+
+  /* Diagnose area if necessary */
+  if(area_id == NC_MIN_INT){
+    /* Not absolutely necessary to diagnose area because ERWG will diagnose and output area itself */
+    if(flg_grd_crv){
+      /* Area of arbitrary curvilinear grids requires spherical trigonometry */
+      nco_sph_plg_area(grd_crn_lat,grd_crn_lon,grd_sz_nbr,grd_crn_nbr,area);
+    }else if(flg_grd_2D){
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+	for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
+	  area[lat_idx*lon_nbr+lon_idx]=dgr2rdn*(lon_bnd[2*lon_idx+1]-lon_bnd[2*lon_idx])*(sin(dgr2rdn*lat_bnd[2*lat_idx+1])-sin(dgr2rdn*lat_bnd[2*lat_idx]));
+    } /* !flg_grd_2D */
+  } /* !area_id */
+
+  if(nco_dbg_lvl_get() >= nco_dbg_sbr){
+    lat_wgt_ttl=0.0;
+    area_ttl=0.0;
+    if(flg_grd_2D){
+      (void)fprintf(stderr,"%s: INFO %s reports destination rectangular latitude grid:\n",nco_prg_nm_get(),fnc_nm);
+      for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+	lat_wgt_ttl+=lat_wgt[lat_idx];
+    } /* !flg_grd_2D */
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++)
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++)
+	area_ttl+=area[lat_idx*lon_nbr+lon_idx];
+    (void)fprintf(stdout,"lat_wgt_ttl = %20.15f, frc_lat_wgt = %20.15f, area_ttl = %20.15f, frc_area = %20.15f\n",lat_wgt_ttl,lat_wgt_ttl/2.0,area_ttl,area_ttl/(4.0*M_PI));
+    assert(area_ttl > 0.0);
+    assert(area_ttl <= 4.0*M_PI);
+  } /* endif dbg */
+
+  /* Stuff rectangular arrays into unrolled arrays */
+  if(flg_grd_2D){
+    for(lat_idx=0;lat_idx<lat_nbr;lat_idx++){
+      for(lon_idx=0;lon_idx<lon_nbr;lon_idx++){
+	idx=lat_idx*lon_nbr+lon_idx;
+	grd_ctr_lat[idx]=lat_ctr[lat_idx];
+	grd_ctr_lon[idx]=lon_ctr[lon_idx];
+	for(crn_idx=0;crn_idx<grd_crn_nbr;crn_idx++){
+	  idx2=grd_crn_nbr*idx+crn_idx;
+	  lat_idx2=lat_idx*grd_crn_nbr+crn_idx;
+	  lon_idx2=lon_idx*grd_crn_nbr+crn_idx;
+	  grd_crn_lat[idx2]=lat_crn[lat_idx2];
+	  grd_crn_lon[idx2]=lon_crn[lon_idx2];
+	} /* !crn */
+      } /* !lon */
+    } /* !lat */
+  } /* !flg_grd_2D */
+  
+  /* Open grid file */
+  fl_out_tmp=nco_fl_out_open(fl_out,FORCE_APPEND,FORCE_OVERWRITE,fl_out_fmt,&bfr_sz_hnt,RAM_CREATE,RAM_OPEN,WRT_TMP_FL,&out_id);
+
+  /* Define dimensions */
+  rcd=nco_def_dim(out_id,grd_crn_nm,grd_crn_nbr,&dmn_id_grd_crn);
+  rcd=nco_def_dim(out_id,grd_sz_nm,grd_sz_nbr,&dmn_id_grd_sz);
+  rcd=nco_def_dim(out_id,grd_rnk_nm,grd_rnk_nbr,&dmn_id_grd_rnk);
+  
+  /* Define variables */
+  (void)nco_def_var(out_id,dmn_sz_nm,(nc_type)NC_INT,dmn_nbr_1D,&dmn_id_grd_rnk,&dmn_sz_int_id);
+  (void)nco_def_var(out_id,area_nm,crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&area_id);
+  (void)nco_def_var(out_id,msk_nm,(nc_type)NC_INT,dmn_nbr_1D,&dmn_id_grd_sz,&msk_id);
+  (void)nco_def_var(out_id,grd_ctr_lat_nm,crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&grd_ctr_lat_id);
+  (void)nco_def_var(out_id,grd_ctr_lon_nm,crd_typ,dmn_nbr_1D,&dmn_id_grd_sz,&grd_ctr_lon_id);
+  dmn_ids[0]=dmn_id_grd_sz;
+  dmn_ids[1]=dmn_id_grd_crn;
+  (void)nco_def_var(out_id,grd_crn_lat_nm,crd_typ,dmn_nbr_2D,dmn_ids,&grd_crn_lat_id);
+  (void)nco_def_var(out_id,grd_crn_lon_nm,crd_typ,dmn_nbr_2D,dmn_ids,&grd_crn_lon_id);
+  
+  /* Define "units" attributes */
+  aed_sct aed_mtd;
+  char *att_nm;
+  char *att_val;
+  
+  att_nm=strdup("title");
+  if(strstr(rgr->grd_ttl,"None given")){
+    const char att_fmt[]="Grid inferred by NCO from input file %s";
+    att_val=(char *)nco_malloc((strlen(att_fmt)+strlen(rgr->fl_in)+1L)*sizeof(char));
+    sprintf(att_val,att_fmt,rgr->fl_in);
+  }else{
+    att_val=strdup(rgr->grd_ttl);
+  } /* !grd_ttl */
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  att_nm=strdup("Conventions");
+  att_val=strdup("SCRIP");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  const char usr_cpp[]=TKN2SNG(USER); /* [sng] Hostname from C pre-processor */
+  att_nm=strdup("created_by");
+  att_val=strdup(usr_cpp);
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  (void)nco_hst_att_cat(out_id,rgr->cmd_ln);
+  (void)nco_vrs_att_cat(out_id);
+
+  att_nm=strdup("latitude_grid_type");
+  att_val=strdup(nco_grd_lat_sng(lat_typ));
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  att_nm=strdup("longitude_grid_type");
+  att_val=strdup(nco_grd_lon_sng(lon_typ));
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=NULL;
+  aed_mtd.id=NC_GLOBAL;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,NC_GLOBAL,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  att_nm=strdup("units");
+  att_val=strdup("steradian");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.var_nm=area_nm;
+  aed_mtd.id=area_id;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  (void)nco_aed_prc(out_id,area_id,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+
+  att_nm=strdup("units");
+  att_val=strdup("degrees");
+  aed_mtd.att_nm=att_nm;
+  aed_mtd.sz=strlen(att_val);
+  aed_mtd.type=NC_CHAR;
+  aed_mtd.val.cp=att_val;
+  aed_mtd.mode=aed_create;
+  /* Add same units attribute to four different variables */
+  aed_mtd.var_nm=grd_ctr_lat_nm;
+  aed_mtd.id=grd_ctr_lat_id;
+  (void)nco_aed_prc(out_id,grd_ctr_lat_id,aed_mtd);
+  aed_mtd.var_nm=grd_ctr_lon_nm;
+  aed_mtd.id=grd_ctr_lon_id;
+  (void)nco_aed_prc(out_id,grd_ctr_lon_id,aed_mtd);
+  aed_mtd.var_nm=grd_crn_lat_nm;
+  aed_mtd.id=grd_crn_lat_id;
+  (void)nco_aed_prc(out_id,grd_crn_lat_id,aed_mtd);
+  aed_mtd.var_nm=grd_crn_lon_nm;
+  aed_mtd.id=grd_crn_lon_id;
+  (void)nco_aed_prc(out_id,grd_crn_lon_id,aed_mtd);
+  if(att_nm) att_nm=(char *)nco_free(att_nm);
+  if(att_val) att_val=(char *)nco_free(att_val);
+  
+  /* Begin data mode */
+  (void)nco_enddef(out_id);
+  
+  /* Write variables */
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_rnk_nbr;
+  rcd=nco_put_vara(out_id,dmn_sz_int_id,dmn_srt,dmn_cnt,dmn_sz_int,(nc_type)NC_INT);
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_nbr;
+  rcd=nco_put_vara(out_id,area_id,dmn_srt,dmn_cnt,area,crd_typ);
+  if(msk_id != NC_MIN_INT){
+    dmn_srt[0]=0L;
+    dmn_cnt[0]=grd_sz_nbr;
+    rcd=nco_put_vara(out_id,msk_id,dmn_srt,dmn_cnt,msk,(nc_type)NC_INT);
+  } /* !msk */
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_nbr;
+  rcd=nco_put_vara(out_id,grd_ctr_lat_id,dmn_srt,dmn_cnt,grd_ctr_lat,crd_typ);
+  dmn_srt[0]=0L;
+  dmn_cnt[0]=grd_sz_nbr;
+  rcd=nco_put_vara(out_id,grd_ctr_lon_id,dmn_srt,dmn_cnt,grd_ctr_lon,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_nbr;
+  dmn_cnt[1]=grd_crn_nbr;
+  rcd=nco_put_vara(out_id,grd_crn_lat_id,dmn_srt,dmn_cnt,grd_crn_lat,crd_typ);
+  dmn_srt[0]=dmn_srt[1]=0L;
+  dmn_cnt[0]=grd_sz_nbr;
+  dmn_cnt[1]=grd_crn_nbr;
+  rcd=nco_put_vara(out_id,grd_crn_lon_id,dmn_srt,dmn_cnt,grd_crn_lon,crd_typ);
+  
+  /* Close output file and move it from temporary to permanent location */
+  (void)nco_fl_out_cls(fl_out,fl_out_tmp,out_id);
+  
+  /* Free memory associated with input file */
+  if(dmn_sz_int) dmn_sz_int=(int *)nco_free(dmn_sz_int);
+  if(msk) msk=(int *)nco_free(msk);
+  if(area) area=(double *)nco_free(area);
+  if(grd_ctr_lat) grd_ctr_lat=(double *)nco_free(grd_ctr_lat);
+  if(grd_ctr_lon) grd_ctr_lon=(double *)nco_free(grd_ctr_lon);
+  if(grd_crn_lat) grd_crn_lat=(double *)nco_free(grd_crn_lat);
+  if(grd_crn_lon) grd_crn_lon=(double *)nco_free(grd_crn_lon);
+  if(lat_bnd) lat_bnd=(double *)nco_free(lat_bnd);
+  if(lat_crn) lat_crn=(double *)nco_free(lat_crn);
+  if(lat_ctr) lat_ctr=(double *)nco_free(lat_ctr);
+  if(lat_ntf) lat_ntf=(double *)nco_free(lat_ntf);
+  if(lat_wgt) lat_wgt=(double *)nco_free(lat_wgt);
+  if(lon_bnd) lon_bnd=(double *)nco_free(lon_bnd);
+  if(lon_crn) lon_crn=(double *)nco_free(lon_crn);
+  if(lon_ctr) lon_ctr=(double *)nco_free(lon_ctr);
+  if(lon_ntf) lon_ntf=(double *)nco_free(lon_ntf);
+
+  /* Free strings */
+  if(lat_dmn_nm) lat_dmn_nm=(char *)nco_free(lat_dmn_nm);
+  if(lon_dmn_nm) lon_dmn_nm=(char *)nco_free(lon_dmn_nm);
+  if(bnd_dmn_nm) bnd_dmn_nm=(char *)nco_free(bnd_dmn_nm);
+  if(lat_nm_in) lat_nm_in=(char *)nco_free(lat_nm_in);
+  if(lon_nm_in) lon_nm_in=(char *)nco_free(lon_nm_in);
+  if(lat_bnd_nm) lat_bnd_nm=(char *)nco_free(lat_bnd_nm);
+  if(lon_bnd_nm) lon_bnd_nm=(char *)nco_free(lon_bnd_nm);
+  if(area_nm_in) area_nm_in=(char *)nco_free(area_nm_in);
+  if(msk_nm_in) msk_nm_in=(char *)nco_free(msk_nm_in);
+  
+  return rcd;
+
+} /* !nco_grd_nfr() */
diff --git a/src/nco/nco_rgr.h b/src/nco/nco_rgr.h
index d6ec1c3..2fb61d4 100644
--- a/src/nco/nco_rgr.h
+++ b/src/nco/nco_rgr.h
@@ -119,6 +119,18 @@ extern "C" {
   nco_grd_mk /* [fnc] Create SCRIP-format grid file */
   (rgr_sct * const rgr); /* I/O [sct] Regridding structure */
 
+  int /* O [enm] Return code */
+  nco_grd_nfr /* [fnc] Infer SCRIP-format grid file from data file */
+  (rgr_sct * const rgr); /* I/O [sct] Regridding structure */
+
+  void
+  nco_sph_plg_area /* [fnc] Compute area of spherical polygon */
+  (const double * const lat_bnd, /* [dgr] Latitude  boundaries of rectangular grid */
+   const double * const lon_bnd, /* [dgr] Longitude boundaries of rectangular grid */
+   const long grd_sz_nbr, /* [nbr] Number of gridcells in grid */
+   const int bnd_nbr, /* [nbr] Number of bounds in gridcell */
+   double * const area_out); /* [sr] Gridcell area */
+
   void
   nco_lat_wgt_gss /* [fnc] Compute and return sine of Gaussian latitudes and their weights */
   (const int lat_nbr, /* I [nbr] Latitude number */
@@ -147,7 +159,9 @@ extern "C" {
    char * const rgr_grd_dst, /* I [sng] File containing destination grid */
    char * const rgr_map, /* I [sng] File containing mapping weights from source to destination grid */
    char * const rgr_var, /* I [sng] Variable for special regridding treatment */
-   const double wgt_vld_thr); /* I [frc] Weight threshold for valid destination value */
+   const double wgt_vld_thr, /* I [frc] Weight threshold for valid destination value */
+   char **xtn_var, /* I [sng] Extensive variables */
+   const int xtn_nbr); /* I [nbr] Number of extensive variables */
     
   rgr_sct * /* O [sct] Pointer to free'd regridding structure */
   nco_rgr_free /* [fnc] Deallocate regridding structure */
diff --git a/src/nco/ncpdq.c b/src/nco/ncpdq.c
index bb40cc1..126824a 100644
--- a/src/nco/ncpdq.c
+++ b/src/nco/ncpdq.c
@@ -609,14 +609,11 @@ main(int argc,char **argv)
 
     for(int idx_dmn=0;idx_dmn<NC_MAX_DIMS;idx_dmn++) dmn_rvr_rdr[idx_dmn]=-1; 
 
-    /* Loop table */
     for(unsigned int idx_tbl=0;idx_tbl<trv_tbl->nbr;idx_tbl++){
       trv_sct var_trv=trv_tbl->lst[idx_tbl];
 
-      /* Is variable to extract */
       if(var_trv.nco_typ == nco_obj_typ_var && var_trv.flg_xtr){
 
-        /* Loop variable dimensions */
         for(int idx_dmn=0;idx_dmn<var_trv.nbr_dmn;idx_dmn++){
 
           /* Loop input -a names */
@@ -633,10 +630,10 @@ main(int argc,char **argv)
             } /* !flg_is_rvr */  
             idx_dmn_rdr_nbr_trv++;
 
-          } /* Loop input -a names */
-        } /* Loop variable dimensions */
-      } /* Is variable to extract */
-    } /* Loop table */
+          } /* !idx_rdr */
+        } /* !idx_dmn */
+      } /* !flg_xtr */
+    } /* !idx_tbl */
 
     /* Strip all '-' */
     for(idx_rdr=0;idx_rdr<dmn_rdr_nbr_in;idx_rdr++){
@@ -645,9 +642,9 @@ main(int argc,char **argv)
         optarg_lcl=dmn_rdr_lst_in[idx_rdr];
         dmn_rdr_lst_in[idx_rdr]=(char *)strdup(optarg_lcl+1L);
         optarg_lcl=(char *)nco_free(optarg_lcl);
-      } /* endif */
-    } /* Strip all '-' */
-  } /* Create reversed dimension list */
+      } /* !'-' */
+    } /* !idx_rdr */
+  } /* !dmn_rdr_nbr_in */
 
   /* Get number of variables, dimensions, and global attributes in file, file format */
   (void)trv_tbl_inq((int *)NULL,(int *)NULL,(int *)NULL,&nbr_dmn_fl,(int *)NULL,(int *)NULL,(int *)NULL,(int *)NULL,&nbr_var_fl,trv_tbl);
@@ -983,6 +980,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<aux_nbr;idx++) aux_arg[idx]=(char *)nco_free(aux_arg[idx]);
diff --git a/src/nco/ncra.c b/src/nco/ncra.c
index fd6c248..07460c5 100644
--- a/src/nco/ncra.c
+++ b/src/nco/ncra.c
@@ -955,7 +955,7 @@ main(int argc,char **argv)
           (void)nco_inq_dimlen(grp_out_id,rec_dmn_out_id,&idx_rec_out[idx_rec]);
         } /* !REC_APN */
 
-        if(nco_dbg_lvl_get() == nco_dbg_old) (void)fprintf(fp_stdout,"%s: DEBUG record [%d] #%d<%s>(%ld)\n",nco_prg_nm_get(),idx_rec,lmt_rec[idx_rec]->id,lmt_rec[idx_rec]->nm_fll,lmt_rec[idx_rec]->rec_dmn_sz);                    
+        if(nco_dbg_lvl_get() == nco_dbg_old) (void)fprintf(fp_stdout,"%s: DEBUG record %d id %d name %s rec_dmn_sz %ld\n",nco_prg_nm_get(),idx_rec,lmt_rec[idx_rec]->id,lmt_rec[idx_rec]->nm_fll,lmt_rec[idx_rec]->rec_dmn_sz);                    
         /* Two distinct ways to specify MRO are --mro and -d dmn,a,b,c,d,[m,M] */
         if(FLG_MRO) lmt_rec[idx_rec]->flg_mro=True;
         if(lmt_rec[idx_rec]->flg_mro) FLG_MRO=True;
@@ -1539,9 +1539,10 @@ main(int argc,char **argv)
     if(wgt_arr) wgt_arr=(double *)nco_free(wgt_arr);
     if(wgt_nm) wgt_nm=(char *)nco_free(wgt_nm);
     /* Free lists of strings */
-    if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
+    if(fl_lst_in && !fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     if(wgt_nbr > 0) wgt_lst_in=nco_sng_lst_free(wgt_lst_in,wgt_nbr);
     /* Free limits */
diff --git a/src/nco/ncrename.c b/src/nco/ncrename.c
index 3b92a0e..9198036 100644
--- a/src/nco/ncrename.c
+++ b/src/nco/ncrename.c
@@ -667,6 +667,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     (void)trv_tbl_free(trv_tbl);
   } /* !flg_cln */
 
diff --git a/src/nco/ncwa.c b/src/nco/ncwa.c
index abcd284..7cb9ad3 100644
--- a/src/nco/ncwa.c
+++ b/src/nco/ncwa.c
@@ -1222,6 +1222,7 @@ main(int argc,char **argv)
     if(fl_lst_in && fl_lst_abb == NULL) fl_lst_in=nco_sng_lst_free(fl_lst_in,fl_nbr); 
     if(fl_lst_in && fl_lst_abb) fl_lst_in=nco_sng_lst_free(fl_lst_in,1);
     if(fl_lst_abb) fl_lst_abb=nco_sng_lst_free(fl_lst_abb,abb_arg_nbr);
+    if(gaa_nbr > 0) gaa_arg=nco_sng_lst_free(gaa_arg,gaa_nbr);
     if(var_lst_in_nbr > 0) var_lst_in=nco_sng_lst_free(var_lst_in,var_lst_in_nbr);
     /* Free limits */
     for(idx=0;idx<aux_nbr;idx++) aux_arg[idx]=(char *)nco_free(aux_arg[idx]);
diff --git a/src/nco_c++/Makefile.am b/src/nco_c++/Makefile.am
index 5114768..c3f6008 100644
--- a/src/nco_c++/Makefile.am
+++ b/src/nco_c++/Makefile.am
@@ -5,6 +5,7 @@ test_data = in.nc
 all: ${test_data}
 
 in.nc:
+	cd ../../data;make;cd -
 	ln -f -s ../../data/in.nc in.nc
 
 lib_LTLIBRARIES = libnco_c++.la
diff --git a/src/nco_c++/Makefile.in b/src/nco_c++/Makefile.in
index 1fb2f1f..0b34a3a 100644
--- a/src/nco_c++/Makefile.in
+++ b/src/nco_c++/Makefile.in
@@ -1130,6 +1130,7 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
 all: ${test_data}
 
 in.nc:
+	cd ../../data;make;cd -
 	ln -f -s ../../data/in.nc in.nc
 
 test: check

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