[nco] 01/06: Imported Upstream version 4.6.4

Bas Couwenberg sebastic at debian.org
Wed Feb 8 07:02:15 UTC 2017


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

sebastic pushed a commit to branch master
in repository nco.

commit 657718e23fbf85a6c97c3f3a63a14e82b0878b37
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Feb 8 07:24:54 2017 +0100

    Imported Upstream version 4.6.4
---
 bld/Makefile                      |    2 +-
 bld/nco.spec                      |   11 +-
 bld/nco_dst.pl                    |   30 +-
 bm/NCO_bm.pm                      |    2 +-
 bm/NCO_rgr.pm                     |   26 +-
 configure                         |   21 +-
 configure.ac                      |    5 +-
 configure.eg                      |   13 +-
 data/Makefile.am                  |   10 +-
 data/Makefile.in                  |    9 +-
 data/bsc_tst.nco                  |   90 +-
 data/hdn.cdl                      |    8 +-
 data/in.cdl                       |   50 +-
 data/nccf                         |    5 +
 data/ncclimo                      | 1077 +++++++++++++++++++----
 data/ncremap                      |  156 ++--
 data/split.cdl                    |  789 +++++++++++++++++
 debian/changelog                  |    6 +
 doc/ANNOUNCE                      |  151 ++--
 doc/ChangeLog                     |  189 ++++
 doc/TODO                          |   49 +-
 doc/VERSION                       |    2 +-
 doc/debian.txt                    |  162 ++--
 doc/index.shtml                   |   62 +-
 doc/nco.texi                      |  872 +++++++++++++------
 man/ncap.1                        |    2 +-
 man/ncap2.1                       |    2 +-
 man/ncatted.1                     |    2 +-
 man/ncbo.1                        |    4 +-
 man/ncclimo.1                     |    6 +-
 man/ncecat.1                      |    4 +-
 man/nces.1                        |    4 +-
 man/ncflint.1                     |    4 +-
 man/ncks.1                        |    5 +-
 man/nco.1                         |    2 +-
 man/ncpdq.1                       |    4 +-
 man/ncra.1                        |    4 +-
 man/ncrcat.1                      |    4 +-
 man/ncremap.1                     |    2 +-
 man/ncrename.1                    |    2 +-
 man/ncwa.1                        |    4 +-
 src/nco++/ExitException.hpp       |   34 +
 src/nco++/Invoke.cc               |   33 +-
 src/nco++/Makefile.am             |    1 +
 src/nco++/Makefile.in             |   12 +-
 src/nco++/Makefile.old            |    3 +-
 src/nco++/fmc_all_cls.cc          |   87 +-
 src/nco++/fmc_all_cls.hh          |    2 +-
 src/nco++/fmc_cls.hh              |    2 +-
 src/nco++/fmc_gsl_cls.cc          |    2 +-
 src/nco++/fmc_gsl_cls.hh          |    2 +-
 src/nco++/libnco++.hh             |    3 +-
 src/nco++/ncap2.cc                |   21 +-
 src/nco++/ncap2_att.cc            |  783 +++++++++++++++++
 src/nco++/ncap2_att.hh            |  203 +++++
 src/nco++/ncap2_utl.cc            |  961 ++-------------------
 src/nco++/ncap2_utl.hh            |  299 +++----
 src/nco++/ncoEnumTokenTypes.hpp   |  161 ++--
 src/nco++/ncoGrammer.g            |   31 +-
 src/nco++/ncoLexer.cpp            |  183 ++--
 src/nco++/ncoLexer.hpp            |   11 +-
 src/nco++/ncoParser.cpp           |  511 +++++------
 src/nco++/ncoParser.hpp           |   15 +-
 src/nco++/ncoParserTokenTypes.hpp |  161 ++--
 src/nco++/ncoTree.cpp             | 1721 +++++++++++++++++++------------------
 src/nco++/ncoTree.hpp             |   17 +-
 src/nco++/nco_gsl.c               |    2 +-
 src/nco++/nco_gsl.h               |    2 +-
 src/nco++/prs_cls.cc              |    2 +-
 src/nco++/prs_cls.hh              |    2 +-
 src/nco++/sdo_utl.cc              |    2 +-
 src/nco++/sdo_utl.hh              |    2 +-
 src/nco/libnco.h                  |    2 +-
 src/nco/mpncbo.c                  |    2 +-
 src/nco/mpncecat.c                |    2 +-
 src/nco/mpncflint.c               |    2 +-
 src/nco/mpncpdq.c                 |    2 +-
 src/nco/mpncra.c                  |    2 +-
 src/nco/mpncwa.c                  |    2 +-
 src/nco/ncap.c                    |    3 +-
 src/nco/ncap.h                    |    2 +-
 src/nco/ncap_utl.c                |    2 +-
 src/nco/ncap_yacc.y               |    2 +-
 src/nco/ncatted.c                 |    6 +-
 src/nco/ncbo.c                    |   20 +-
 src/nco/ncecat.c                  |   20 +-
 src/nco/ncflint.c                 |   18 +-
 src/nco/ncks.c                    |   48 +-
 src/nco/nco.h                     |   15 +-
 src/nco/nco_att_utl.c             |    2 +-
 src/nco/nco_att_utl.h             |    2 +-
 src/nco/nco_aux.c                 |    2 +-
 src/nco/nco_aux.h                 |    2 +-
 src/nco/nco_bnr.c                 |    2 +-
 src/nco/nco_bnr.h                 |    2 +-
 src/nco/nco_cln_utl.c             |  420 +++++----
 src/nco/nco_cln_utl.h             |  253 +++---
 src/nco/nco_cnf_dmn.c             |    2 +-
 src/nco/nco_cnf_dmn.h             |    2 +-
 src/nco/nco_cnf_typ.c             |    2 +-
 src/nco/nco_cnf_typ.h             |    2 +-
 src/nco/nco_cnk.c                 |   20 +-
 src/nco/nco_cnk.h                 |    2 +-
 src/nco/nco_cnv_arm.c             |    2 +-
 src/nco/nco_cnv_arm.h             |    2 +-
 src/nco/nco_cnv_csm.c             |    2 +-
 src/nco/nco_cnv_csm.h             |    2 +-
 src/nco/nco_ctl.c                 |   29 +-
 src/nco/nco_ctl.h                 |    2 +-
 src/nco/nco_dbg.c                 |    2 +-
 src/nco/nco_dbg.h                 |    2 +-
 src/nco/nco_dmn_utl.c             |    2 +-
 src/nco/nco_dmn_utl.h             |    2 +-
 src/nco/nco_fl_utl.c              |    4 +-
 src/nco/nco_fl_utl.h              |    2 +-
 src/nco/nco_grp_trv.c             |    2 +-
 src/nco/nco_grp_trv.h             |    2 +-
 src/nco/nco_grp_utl.c             |   99 ++-
 src/nco/nco_grp_utl.h             |    4 +-
 src/nco/nco_lmt.c                 |   82 +-
 src/nco/nco_lmt.h                 |    2 +-
 src/nco/nco_lst_utl.c             |    2 +-
 src/nco/nco_lst_utl.h             |    2 +-
 src/nco/nco_md5.c                 |    2 +-
 src/nco/nco_md5.h                 |    2 +-
 src/nco/nco_mmr.c                 |    2 +-
 src/nco/nco_mmr.h                 |    2 +-
 src/nco/nco_mpi.h                 |    2 +-
 src/nco/nco_msa.c                 |    8 +-
 src/nco/nco_msa.h                 |    2 +-
 src/nco/nco_mss_val.c             |    2 +-
 src/nco/nco_mss_val.h             |    2 +-
 src/nco/nco_mta.c                 |    8 +-
 src/nco/nco_mta.h                 |    2 +-
 src/nco/nco_netcdf.c              |    2 +-
 src/nco/nco_netcdf.h              |    2 +-
 src/nco/nco_omp.c                 |    2 +-
 src/nco/nco_omp.h                 |    2 +-
 src/nco/nco_pck.c                 |    2 +-
 src/nco/nco_pck.h                 |    2 +-
 src/nco/nco_ppc.c                 |    2 +-
 src/nco/nco_ppc.h                 |    2 +-
 src/nco/nco_prn.c                 |   58 +-
 src/nco/nco_prn.h                 |   13 +-
 src/nco/nco_rec_var.c             |    2 +-
 src/nco/nco_rec_var.h             |    2 +-
 src/nco/nco_rgr.c                 |   84 +-
 src/nco/nco_rgr.h                 |    2 +-
 src/nco/nco_rth_flt.c             |    2 +-
 src/nco/nco_rth_flt.h             |    2 +-
 src/nco/nco_rth_utl.c             |    2 +-
 src/nco/nco_rth_utl.h             |    2 +-
 src/nco/nco_scl_utl.c             |    2 +-
 src/nco/nco_scl_utl.h             |    2 +-
 src/nco/nco_scm.c                 |    4 +-
 src/nco/nco_scm.h                 |    2 +-
 src/nco/nco_sld.c                 |    3 +-
 src/nco/nco_sld.h                 |    2 +-
 src/nco/nco_sng_utl.c             |    2 +-
 src/nco/nco_sng_utl.h             |    6 +-
 src/nco/nco_srm.c                 |    2 +-
 src/nco/nco_srm.h                 |    2 +-
 src/nco/nco_typ.h                 |    2 +-
 src/nco/nco_var_avg.c             |    2 +-
 src/nco/nco_var_avg.h             |    2 +-
 src/nco/nco_var_lst.c             |    2 +-
 src/nco/nco_var_lst.h             |    2 +-
 src/nco/nco_var_rth.c             |    2 +-
 src/nco/nco_var_rth.h             |    2 +-
 src/nco/nco_var_scv.c             |    2 +-
 src/nco/nco_var_scv.h             |    2 +-
 src/nco/nco_var_utl.c             |    2 +-
 src/nco/nco_var_utl.h             |    2 +-
 src/nco/ncpdq.c                   |   18 +-
 src/nco/ncra.c                    |   23 +-
 src/nco/ncrename.c                |    4 +-
 src/nco/ncwa.c                    |   19 +-
 src/nco_c++/Makefile.old          |    2 +-
 src/nco_c++/libnco_c++.hh         |    2 +-
 src/nco_c++/nco_att.cc            |    2 +-
 src/nco_c++/nco_att.hh            |    2 +-
 src/nco_c++/nco_dmn.cc            |    2 +-
 src/nco_c++/nco_dmn.hh            |    2 +-
 src/nco_c++/nco_fl.cc             |    2 +-
 src/nco_c++/nco_fl.hh             |    2 +-
 src/nco_c++/nco_hgh.cc            |    2 +-
 src/nco_c++/nco_hgh.hh            |    2 +-
 src/nco_c++/nco_utl.cc            |    2 +-
 src/nco_c++/nco_utl.hh            |    2 +-
 src/nco_c++/nco_var.cc            |    2 +-
 src/nco_c++/nco_var.hh            |    2 +-
 191 files changed, 6643 insertions(+), 3953 deletions(-)

diff --git a/bld/Makefile b/bld/Makefile
index 8789994..1f58e47 100644
--- a/bld/Makefile
+++ b/bld/Makefile
@@ -3,7 +3,7 @@
 # Purpose: GNU Makefile for NCO module nco
 # Requires GNU Make---AT&T Make chokes on GNU syntax
 
-# Copyright (C) 1994--2016 Charlie Zender
+# Copyright (C) 1994--2017 Charlie Zender
 # License: GNU General Public License (GPL) Version 3
 # See http://www.gnu.org/copyleft/gpl.html for full license text
 
diff --git a/bld/nco.spec b/bld/nco.spec
index 585e5f8..68e5b23 100644
--- a/bld/nco.spec
+++ b/bld/nco.spec
@@ -2,17 +2,17 @@
 # http://cvs.fedoraproject.org/viewvc/devel/nco/nco.spec?view=co
 
 Name:           nco
-Version:        4.6.3
+Version:        4.6.4
 Release:        1%{?dist}
 Summary:        Programs that manipulate netCDF files
 Group:          Applications/Engineering
 License:        GPL3
 URL:            http://nco.sf.net/
 
-# Obtain NCO version 4.6.3-1 tar.gz from Sourceforge using CVS:
+# Obtain NCO version 4.6.4-1 tar.gz from Sourceforge using CVS:
 # cvs -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco login
-# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.6.3-1 -d nco-%{version} nco
-# tar czf nco-%{version}.tar.gz --exclude='nco-4.6.3/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
+# cvs -z3 -d:pserver:anonymous at nco.cvs.sf.net:/cvsroot/nco co -r nco-4.6.4-1 -d nco-%{version} nco
+# tar czf nco-%{version}.tar.gz --exclude='nco-4.6.4/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude='ncap_yacc.[ch]' ./nco-%{version}
 Source0:        nco-%{version}.tar.gz
 #Patch0:		nco_install_C_headers.patch
 #Patch1:         nco_find_udunits-dat.patch
@@ -108,6 +108,9 @@ fi
 # %{_libdir}/libnco++.so
 
 %changelog
+* Tue Feb 07 2017 Charlie Zender <zender at uci.edu> - 4.6.4-1
+- new upstream 4.6.4
+
 * Fri Dec 23 2016 Charlie Zender <zender at uci.edu> - 4.6.3-1
 - new upstream 4.6.3
 
diff --git a/bld/nco_dst.pl b/bld/nco_dst.pl
index b8e1c77..8aa6549 100755
--- a/bld/nco_dst.pl
+++ b/bld/nco_dst.pl
@@ -5,20 +5,20 @@
 
 # Usage:
 # Export tagged, public versions
-# /usr/bin/scp ${DATA}/nco-4.6.3.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
-
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.6.3 # Build, do not release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.6.3 # Build, release on SF
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.6.3 # Install, do not build
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.6.3 # Build and install
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.6.3
-# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.6.3
+# /usr/bin/scp ${DATA}/nco-4.6.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.6.4 # Build, do not release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --sf nco-4.6.4 # Build, release on SF
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --nst_all nco-4.6.4 # Install, do not build
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln --nst_all nco-4.6.4 # Build and install
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_cnt nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --acd_prs nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cgd_cnt nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --cray_prs nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --bbl_cnt nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --blk_cnt nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --dat_cnt nco-4.6.4
+# ${HOME}/nco/bld/nco_dst.pl --dbg=2 --cln --ute_prs nco-4.6.4
 
 # Export daily snapshot
 # ${HOME}/nco/bld/nco_dst.pl --dbg=2 
@@ -256,7 +256,7 @@ if($bld){
 # Set up FTP server
     chdir $dst_pth_pfx or die "$prg_nm: ERROR unable to chdir to $dst_pth_pfx: $!\n"; # $! is system error string
     cmd_prc("$cp_cmd $doc_fl ./$dst_vrs/doc"); # Copy derived documentation to source directory
-    cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-4.6.3/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
+    cmd_prc("$tar_cmd cvzf $dst_fl --exclude='nco-4.6.4/debian*' --exclude='.cvsignore' --exclude=ncap_lex.c --exclude=ncap_yacc.[ch] ./$dst_vrs"); # Create gzipped tarfile
     cmd_prc("$rsh_cmd $www_mch $rm_cmd $www_drc/src/$dst_fl"); # Remove any distribution with same name
     if($dly_snp){cmd_prc("$rsh_cmd $www_mch $rm_cmd -r $www_drc/src/nco-????????.tar.gz");} # Remove previous daily snapshots from WWW server
     cmd_prc("$rcp_cmd $dst_fl $www_mch:$www_drc/src"); # Copy local tarfile to WWW server
diff --git a/bm/NCO_bm.pm b/bm/NCO_bm.pm
index cc501a6..80c798f 100644
--- a/bm/NCO_bm.pm
+++ b/bm/NCO_bm.pm
@@ -136,7 +136,7 @@ appending history to file.
 This script is part of the netCDF Operators package:
 http://nco.sf.net
 
-Copyright 1995--2016 Charlie Zender
+Copyright 1995--2017 Charlie Zender
 
 USAGE
 exit(0);
diff --git a/bm/NCO_rgr.pm b/bm/NCO_rgr.pm
index 4db5e4a..e33cffd 100644
--- a/bm/NCO_rgr.pm
+++ b/bm/NCO_rgr.pm
@@ -452,6 +452,8 @@ if($USER eq 'zender'){
 
 
 
+
+
     
     if($dodap eq "FALSE"){
 ####################
@@ -2102,6 +2104,8 @@ if($USER eq 'zender'){
     $#tst_cmd=0; # Reset array 			
     
 #ncks #49
+# ncks -O --mk_rec_dmn lat -v three_dmn_var ~/nco/data/in.nc ~/foo.nc
+# ncks -C -m -v lat ~/foo.nc | egrep -o -w 'Record coordinate is lat'
     $dsc_sng="Check --mk_rec_dmn (netCDF3 file)";
     $tst_cmd[0]="ncks -O $fl_fmt $nco_D_flg --mk_rec_dmn lat -v three_dmn_var $in_pth_arg in.nc %tmp_fl_00%";
     $tst_cmd[1]="ncks -C -m -v lat %tmp_fl_00% | egrep -o -w 'Record coordinate is lat'";
@@ -2865,7 +2869,7 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
 	
 #ncks #113 wrapped limit with an additional limit (with --msa) pvn20160211 -- bug found that happens in nco 4.2.0 also
 # ncks -O -C --msa -g g19 -v time -d time,9,0 -d time,1,2 ~/nco/data/in_grp_3.nc ~/foo.nc
-    $dsc_sng="(Groups) Test wrapped limit with additonal limit and msa user order (expect failure TODO)";
+    $dsc_sng="(Groups) Test wrapped limit with additonal limit and msa user order (expect failure TODO nco1134)";
     $tst_cmd[0]="ncks -O $nco_D_flg -C --msa -g g19 -v time -d time,9,0 -d time,1,2 $in_pth_arg in_grp_3.nc %tmp_fl_00";
     $tst_cmd[1]="ncks -H %tmp_fl_00 | grep '=3'";
     $tst_cmd[2]="time[3]=3"; 
@@ -2939,6 +2943,26 @@ if($RUN_NETCDF4_TESTS_VERSION_GE_431){
     NCO_bm::tst_run(\@tst_cmd);
     $#tst_cmd=0; # Reset array
 	
+# ncks #120 
+    $dsc_sng="Test UDUNITS with dates as limits - fails without UDUNITS";
+    $tst_cmd[0]="ncks -O $nco_D_flg -d time,'1979-01-01 0:0:0','1981-01-01 0:0:0' -v time,time_bnds $in_pth_arg split.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncap2 -O -v -C -s 'time_ttl=time.total();print(time_ttl);' %tmp_fl_00% %tmp_fl_01%";
+    $tst_cmd[2]="time_ttl = 9106";
+    $tst_cmd[3]="SS_OK";   
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
+# ncks #121 
+# ncks -O -v zg -d lon,,,2 ~/nco/data/in_4c.nc ~/foo.nc
+# ncap2 -O -v -C -s 'zgs=zg.sort();zg_ttl_dff=(zg(0,:,::)-zgs(0,:,:)).total();print(zg_ttl_dff);' ~/foo.nc ~/foo1.nc
+    $dsc_sng="Test behavior when NC4_SRD_WORKAROUND would be used";
+    $tst_cmd[0]="ncks -O $nco_D_flg -v zg -d lon,,,2 $in_pth_arg in_4c.nc %tmp_fl_00%";
+    $tst_cmd[1]="ncap2 -O -v -C -s 'zgs=zg.sort();zg_ttl_dff=(zg(0,:,::)-zgs(0,:,:)).total();print(zg_ttl_dff);' %tmp_fl_00% %tmp_fl_01%";
+    $tst_cmd[2]="zg_ttl_dff = 0";
+    $tst_cmd[3]="SS_OK";   
+    NCO_bm::tst_run(\@tst_cmd);
+    $#tst_cmd=0; # Reset array
+
 #####################
 #### ncpdq tests #### -OK !
 #####################
diff --git a/configure b/configure
index 908da8b..0ba5802 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.6.3.
+# Generated by GNU Autoconf 2.69 for NCO netCDF Operators 4.6.4.
 #
 # Report bugs to <nco-bugs at lists.sourceforge.net>.
 #
@@ -592,8 +592,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='NCO netCDF Operators'
 PACKAGE_TARNAME='nco'
-PACKAGE_VERSION='4.6.3'
-PACKAGE_STRING='NCO netCDF Operators 4.6.3'
+PACKAGE_VERSION='4.6.4'
+PACKAGE_STRING='NCO netCDF Operators 4.6.4'
 PACKAGE_BUGREPORT='nco-bugs at lists.sourceforge.net'
 PACKAGE_URL=''
 
@@ -1394,7 +1394,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures NCO netCDF Operators 4.6.3 to adapt to many kinds of systems.
+\`configure' configures NCO netCDF Operators 4.6.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1465,7 +1465,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of NCO netCDF Operators 4.6.3:";;
+     short | recursive ) echo "Configuration of NCO netCDF Operators 4.6.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1633,7 +1633,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-NCO netCDF Operators configure 4.6.3
+NCO netCDF Operators configure 4.6.4
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2499,7 +2499,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by NCO netCDF Operators $as_me 4.6.3, which was
+It was created by NCO netCDF Operators $as_me 4.6.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3750,7 +3750,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='nco'
- VERSION='4.6.3'
+ VERSION='4.6.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20018,6 +20018,7 @@ if test "x$ac_cv_file__usr_include_udunits2_udunits2_h" = xyes; then :
   CPPFLAGS="$CPPFLAGS -I/usr/include/udunits2"
 fi
 
+	# 20170113 FC25 has /usr/include/udunits2/udunits2.h
 	# Ubuntu
 	# /usr/lib/x86_64-linux-gnu/libudunits2.a
 	# /usr/lib/i386-linux-gnu/libudunits2.a
@@ -21494,7 +21495,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by NCO netCDF Operators $as_me 4.6.3, which was
+This file was extended by NCO netCDF Operators $as_me 4.6.4, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21560,7 +21561,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-NCO netCDF Operators config.status 4.6.3
+NCO netCDF Operators config.status 4.6.4
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index d7a5f1e..47a747d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 # Purpose: Template autoconf uses to generate NCO configure script
 # Newer convention names this file configure.ac, rather than configure.in
 
-# Copyright (C) 2003--2016 Charlie Zender
+# Copyright (C) 2003--2017 Charlie Zender
 # License: GNU General Public License (GPL) Version 3
 # See http://www.gnu.org/copyleft/gpl.html for full license text
 
@@ -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.6.3],[nco-bugs at lists.sourceforge.net],[nco])
+AC_INIT([NCO netCDF Operators],[4.6.4],[nco-bugs at lists.sourceforge.net],[nco])
 
 # Print GNU copyright in configure script
 AC_COPYRIGHT
@@ -735,6 +735,7 @@ if test "${enable_udunits2}" != 'no'; then
 	# 20160418 FC23 has /usr/include/udunits2/udunits2.h
 	# Add this path to CPPFLAGS if it exists, otherwise do nothing
 	AC_CHECK_FILE([/usr/include/udunits2/udunits2.h], [CPPFLAGS="$CPPFLAGS -I/usr/include/udunits2"], [])
+	# 20170113 FC25 has /usr/include/udunits2/udunits2.h
 	# Ubuntu
 	# /usr/lib/x86_64-linux-gnu/libudunits2.a
 	# /usr/lib/i386-linux-gnu/libudunits2.a
diff --git a/configure.eg b/configure.eg
index 42295b8..42e1007 100644
--- a/configure.eg
+++ b/configure.eg
@@ -284,7 +284,7 @@ module load netcdf/4.4.0
 module load udunits
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
-ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib CC='gcc' CXX='g++' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
+ANTLR_ROOT=${HOME} ANTLR_LIB=${HOME}/lib CC='gcc' CXX='g++' UDUNITS2_PATH='/sw/udunits-2.1.24' ./configure --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
 /bin/cp -f config.log nco.config.log.${GNU_TRP}.foo
 /bin/cp -f libtool nco.libtool.${GNU_TRP}.foo
 make clean;make > nco.make.${GNU_TRP}.foo 2>&1
@@ -401,6 +401,7 @@ scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU
 module add intel;module add gsl;module add netcdf/4.3.0;
 export PATH=${PATH}:/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/bin # needed for ncgen
 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib # needed to run NCO
+git reset --hard origin/master
 cd ~/nco/bld;make NETCDF_ROOT='/glade/apps/opt/netcdf/4.3.0/intel/default' UDUNITS_INC='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/include' UDUNITS_LIB='/glade/apps/opt/udunits/2.1.24/intel/12.1.4/lib' OPTS=D allinone;cd -
 
 # gcc/g++ 20160107 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on rhea:
@@ -414,7 +415,9 @@ module add gsl hdf5
 export LD_LIBRARY_PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/lib:/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib':${LD_LIBRARY_PATH}
 export NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' 
 export PATH='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4/bin':${PATH}
+cd ~/nco;git reset --hard origin/master
 cd ~/nco/bld;make ANTLR_ROOT=${HOME} NETCDF_ROOT='/sw/redhat6/netcdf/4.3.3.1/rhel6.6_gcc4.8.2--with-dap+hdf4' SZ=Y SZ_LIB='/sw/redhat6/szip/2.1/rhel6.6_gnu4.8.2/lib' UDUNITS_INC='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/include' UDUNITS_LIB='/sw/redhat6/udunits/2.1.24/rhel6.4_intel13.1.3/lib' OPTS=D OMP=Y allinone;cd -
+/bin/cp ~/ncclimo.4.6.2 ~/bin_rhea
 
 # gcc/g++ 20160420 Zender uses this to develop/install/update netCDF4-enabled NCO in personal directories on titan:
 export LINUX_CC='gcc -std=c99 -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE'
@@ -630,7 +633,7 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 sudo make install >> nco.make.${GNU_TRP}.foo 2>&1
 scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:/var/www/html/nco/rgr
 
-# gcc/g++ Zender uses this to debug NCO with pre-built (i.e., yum/dnf install'd or aptitude install'd) netCDF (frazil, glace)
+# gcc/g++ Zender uses this to debug NCO with pre-built (i.e., yum/dnf install'd or aptitude install'd) netCDF in /usr (frazil, glace)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
@@ -641,7 +644,7 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 make install >> nco.make.${GNU_TRP}.foo 2>&1
 scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:/var/www/html/nco/rgr
 
-# gcc/g++ Zender uses this to debug NCO with custom-install netCDF (and ESMF) binaries in /usr/local (givre, roulee)
+# gcc/g++ Zender uses this to debug NCO with custom-install netCDF (and ESMF) binaries in /usr/local (givre, roulee, grele)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 CC='gcc' CXX='g++' NETCDF_INC='/usr/local/include' NETCDF_LIB='/usr/local/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
@@ -652,7 +655,7 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 make install >> nco.make.${GNU_TRP}.foo 2>&1
 scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:/var/www/html/nco/rgr
 
-# gcc/g++ Zender uses this to debug NCO with pre-built netCDF binaries in /usr (this works on MACOSX with MacPorts, e.g., aerosol, skyglow)
+# gcc/g++ Zender uses this to debug NCO with pre-built netCDF binaries in /usr (frazil, skyglow)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' NETCDF_INC='/usr/include' NETCDF_LIB='/usr/lib' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
@@ -663,7 +666,7 @@ make check >> nco.make.${GNU_TRP}.foo 2>&1
 make install >> nco.make.${GNU_TRP}.foo 2>&1
 scp nco.configure.${GNU_TRP}.foo nco.config.log.${GNU_TRP}.foo nco.libtool.${GNU_TRP}.foo nco.make.${GNU_TRP}.foo dust.ess.uci.edu:/var/www/html/nco/rgr
 
-# gcc/g++ Zender uses this to debug NCO with pre-built netCDF (and ESMF) binaries in /opt/local (this works on MACOSX with MacPorts, e.g., aerosol)
+# gcc/g++ Zender uses this to debug NCO with pre-built netCDF (and ESMF) binaries in /opt/local (this works on MACOSX with MacPorts, e.g., aerosol, firn)
 export GNU_TRP=`~/nco/autobld/config.guess`
 cd ~/nco;/bin/rm -f *.${GNU_TRP}.foo;make distclean
 CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' ESMF_INC='/opt/local/include' ESMF_LIB='/opt/local/lib/gcc49' ./configure --enable-debug-custom --prefix=${HOME} --bindir=${MY_BIN_DIR} --datadir=${HOME}/nco/data --libdir=${MY_LIB_DIR} --mandir=${HOME}/nco/man > nco.configure.${GNU_TRP}.foo 2>&1
diff --git a/data/Makefile.am b/data/Makefile.am
index f76e036..bfbb671 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,7 +2,7 @@
 
 test_data = big.nc in.nc in_rec_zero.nc
 
-test_data_netCDF4 = in_4c.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc obs.nc mdl_1.nc mdl_2.nc mdl_3.nc hdn.nc mrd.nc
+test_data_netCDF4 = in_4c.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc obs.nc mdl_1.nc mdl_2.nc mdl_3.nc hdn.nc mrd.nc split.nc
 
 # netCDF build rules
 %.nc : %.cdl
@@ -70,13 +70,17 @@ mdl_2.nc : mdl_2.cdl
 mdl_3.nc : mdl_3.cdl
 	- at PATH_TO_NCGEN@ -k netCDF-4 -o $@ $< 
 
+split.nc : split.cdl
+	- at PATH_TO_NCGEN@ -k netCDF-4 -o $@ $< 
+
+
 all: ${test_data} ${test_data_netCDF4}
 
 # Autoconf/automake instructions for scripts:
 # https://www.gnu.org/software/automake/manual/html_node/Scripts.html
 dist_bin_SCRIPTS = ncclimo ncremap
 
-EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_grp_2.cdl in_grp_3.cdl in_grp_4.cdl in_grp_5.cdl in_grp_6.cdl in_grp_7.cdl in_grp_8.cdl in_1.cdl in_2.cdl cmip5.cdl obs.cdl mdl_1.cdl buggy.cdl in_rec_zero.cdl ncap.in ncap.in2 ncap2.in tst.nco
+EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_grp_2.cdl in_grp_3.cdl in_grp_4.cdl in_grp_5.cdl in_grp_6.cdl in_grp_7.cdl in_grp_8.cdl in_1.cdl in_2.cdl cmip5.cdl obs.cdl mdl_1.cdl split.cdl buggy.cdl in_rec_zero.cdl ncap.in ncap.in2 ncap2.in tst.nco
 
 # Automake manual section 14:
 # If configure built it, 'distclean' should delete it
@@ -84,7 +88,7 @@ EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_g
 DISTCLEANFILES = foo*
 
 # Build procedure produces these files:
-CLEANFILES = 85.nc 86.nc 87.nc 88.nc 89.nc big.nc foo.nc h0001.nc h0002.nc h0003.nc in.nc in_1.nc in_2.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc hdn.nc mrd.nc dsm.nc lrg_bm1.nc lrg_bm.nc obs.nc mdl.nc mdl2.nc mdl_1.nc mdl_2.nc mdl_3.nc buggy.nc in_rec_zero.nc ../src/nco_c++/in.nc
+CLEANFILES = 85.nc 86.nc 87.nc 88.nc 89.nc big.nc foo.nc h0001.nc h0002.nc h0003.nc in.nc in_1.nc in_2.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc hdn.nc mrd.nc dsm.nc split.nc lrg_bm1.nc lrg_bm.nc obs.nc mdl.nc mdl2.nc mdl_1.nc mdl_2.nc mdl_3.nc buggy.nc in_rec_zero.nc ../src/nco_c++/in.nc
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/data/Makefile.in b/data/Makefile.in
index 133f5f2..bf259fb 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -305,12 +305,12 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 test_data = big.nc in.nc in_rec_zero.nc
-test_data_netCDF4 = in_4c.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc obs.nc mdl_1.nc mdl_2.nc mdl_3.nc hdn.nc mrd.nc
+test_data_netCDF4 = in_4c.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc obs.nc mdl_1.nc mdl_2.nc mdl_3.nc hdn.nc mrd.nc split.nc
 
 # Autoconf/automake instructions for scripts:
 # https://www.gnu.org/software/automake/manual/html_node/Scripts.html
 dist_bin_SCRIPTS = ncclimo ncremap
-EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_grp_2.cdl in_grp_3.cdl in_grp_4.cdl in_grp_5.cdl in_grp_6.cdl in_grp_7.cdl in_grp_8.cdl in_1.cdl in_2.cdl cmip5.cdl obs.cdl mdl_1.cdl buggy.cdl in_rec_zero.cdl ncap.in ncap.in2 ncap2.in tst.nco
+EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_grp_2.cdl in_grp_3.cdl in_grp_4.cdl in_grp_5.cdl in_grp_6.cdl in_grp_7.cdl in_grp_8.cdl in_1.cdl in_2.cdl cmip5.cdl obs.cdl mdl_1.cdl split.cdl buggy.cdl in_rec_zero.cdl ncap.in ncap.in2 ncap2.in tst.nco
 
 # Automake manual section 14:
 # If configure built it, 'distclean' should delete it
@@ -318,7 +318,7 @@ EXTRA_DIST = big.cdl dsm.cdl hdn.cdl mrd.cdl in.cdl in_grp.cdl in_grp_1.cdl in_g
 DISTCLEANFILES = foo*
 
 # Build procedure produces these files:
-CLEANFILES = 85.nc 86.nc 87.nc 88.nc 89.nc big.nc foo.nc h0001.nc h0002.nc h0003.nc in.nc in_1.nc in_2.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc hdn.nc mrd.nc dsm.nc lrg_bm1.nc lrg_bm.nc obs.nc mdl.nc mdl2.nc mdl_1.nc mdl_2.nc mdl_3.nc buggy.nc in_rec_zero.nc ../src/nco_c++/in.nc
+CLEANFILES = 85.nc 86.nc 87.nc 88.nc 89.nc big.nc foo.nc h0001.nc h0002.nc h0003.nc in.nc in_1.nc in_2.nc in_grp.nc in_grp_1.nc in_grp_2.nc in_grp_3.nc in_grp_4.nc in_grp_5.nc in_grp_6.nc in_grp_7.nc in_grp_8.nc cmip5.nc hdn.nc mrd.nc dsm.nc split.nc lrg_bm1.nc lrg_bm.nc obs.nc mdl.nc mdl2.nc mdl_1.nc mdl_2.nc mdl_3.nc buggy.nc in_rec_zero.nc ../src/nco_c++/in.nc
 MAINTAINERCLEANFILES = Makefile.in
 all: all-am
 
@@ -620,6 +620,9 @@ mdl_2.nc : mdl_2.cdl
 mdl_3.nc : mdl_3.cdl
 	- at PATH_TO_NCGEN@ -k netCDF-4 -o $@ $< 
 
+split.nc : split.cdl
+	- at PATH_TO_NCGEN@ -k netCDF-4 -o $@ $< 
+
 all: ${test_data} ${test_data_netCDF4}
 
 test: check
diff --git a/data/bsc_tst.nco b/data/bsc_tst.nco
index a910c33..2c47adc 100644
--- a/data/bsc_tst.nco
+++ b/data/bsc_tst.nco
@@ -296,8 +296,59 @@ nbr_err_ttl=0;
      nbr_err++;	
   }
 
+ // check var 'op' var conformance  
+ b13[lat,lon]={1,2,3,4,5,6,7,8};
+ b14[lon,lat]={1,5,2,6,3,7,4,8};
+
+ b15=b13*b14; 
+ if( (b15-b13*b13).total() !=0 || b15(0,1) != 4  )
+  {
+     print("ERROR: b15 b) var_var_op(*) conformance\n");
+     nbr_err++;	
+  }
+  
+ b16=b14+b13; 
+ if( (b16-2*b14).total() !=0 || b16(0,1) != 10 )
+  {
+     print("ERROR: b16 b) var_var_op(+) conformance\n");
+     nbr_err++;	
+  }
+
+ // from terraref hyperspectral script 
+ defdim("x",1);
+ defdim("y",1);
+ defdim("z",1);
+ defdim("wavelength",4);
+
+ rf[wavelength]=3.0f;
+ in[wavelength,x,y]=10.0f;
+
+ dark[wavelength]=1.0f;
+ white[wavelength]=2.0f;
+
+ out=rf*(in-white)/(white-dark);
+
+ if( out.total() != 4*24.0f ) 
+  {
+     print("ERROR: out) var conformance with degenerate  dims\n");
+     nbr_err++;	
+  }
+
+ // check output with degenerate dim vars
+ b20[x,y,z]=1.0;
+ b21[y,z]=2.0;
+ // q=1;
+ // xxx=2; 
+ b22=b21*b20; 
+ 
+ if( b22.total() !=2.0f || b22.ndims() !=3 )
+  {
+     print("ERROR: b22) var conformance with all degenerate dims\n");
+     nbr_err++;	
+  }
  
 
+
   print("RESULTS block b: Num errors="); print(nbr_err,"%d");
   nbr_err_ttl+=nbr_err;
   nbr_err=0;
@@ -605,9 +656,46 @@ nbr_err_ttl=0;
 
 }
 
-// Cumulative distribution functions
+// check min_coords function -- This function take a var /att of value(s) 
+// and for each one returns the index into the coordinate var that is the most close
+// if value is not within coord range then -1 is returned.
+// coord must be monotonic. coord & value(s) converted to double for operation    
 {
 
+  MyCoord[time]={ 1.0,1.5,2.0,3.0,4.0,5.0,7.2,7.6,7.8,8.0 };
+
+  g1=min_coords(MyCoord,1.24);
+  if(g1 != 0)
+  {
+      print("ERROR: g1 finding nearset coordinate index");
+      nbr_err++;	
+  }
+   
+   
+  g2=min_coords(MyCoord,7.90001);
+  if(g2 != 9)
+  {
+      print("ERROR: g2 finding nearset coordinate index");
+      nbr_err++;	
+  }
+   
+  g3[lon]={1.1,2.1, 8.0, 1.0};
+  
+  Ig3=min_coords(MyCoord, g3);
+  
+  // expected values 
+  Ig3E[lon]={0,2,9,0};
+		  
+  if( (Ig3-Ig3E).total() !=0 )
+  {
+      print("ERROR: g3 find nearset coordinate indicies");
+      nbr_err++;	
+  }
+
+   
+
+
+
   print("RESULTS block g: Num errors="); print(nbr_err,"%d");
   nbr_err_ttl+=nbr_err;
   nbr_err=0;
diff --git a/data/hdn.cdl b/data/hdn.cdl
index bbd9825..4a48693 100644
--- a/data/hdn.cdl
+++ b/data/hdn.cdl
@@ -66,12 +66,12 @@ netcdf hdn {
   var_cmp_9:_DeflateLevel = 9;
 
     int var_cnk_1(lat);
-  var_chk:purpose="Variable with chunking. Original _ChunkSizes = 1";
-  var_chk:_ChunkSizes=1;
+  var_cnk_1:purpose="Variable with chunking. Original _ChunkSizes = 1";
+  var_cnk_1:_ChunkSizes=1;
 
     int var_cnk_2(lat);
-  var_chk:purpose="Variable with chunking. Original _ChunkSizes = 2";
-  var_chk:_ChunkSizes=2;
+  var_cnk_2:purpose="Variable with chunking. Original _ChunkSizes = 2";
+  var_cnk_2:_ChunkSizes=2;
 
     int var_shf(lat);
   var_shf:purpose="Variable with shuffling. Original _Shuffle = 1";
diff --git a/data/in.cdl b/data/in.cdl
index 9e409e9..28f73d9 100644
--- a/data/in.cdl
+++ b/data/in.cdl
@@ -258,6 +258,12 @@ variables:
 
 	int od(time);
 
+	double areacella(lat,lon);
+        areacella:standard_name = "area";
+        areacella:long_name = "area";
+	areacella:units = "meter2";
+	areacella:purpose = "Variable to hold cell areas of 2D fields. Intended to be pointed to by cell_measures attribute of 2D fields. Would have named it plain-old area but too many regression tests already depend on 1D float area below. areacella is name used by ESGF-distributed versions of some CESM simulations anyway, e.g., baseURL: http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile: gridspec_atmos_fx_CCSM4_amip_r0i0p0.nc areacella: areacella_fx_CCSM4_amip_r0i0p0.nc";
+
 	float area(lat);
 	area:long_name = "area";
 	area:units = "meter2";
@@ -912,6 +918,13 @@ variables:
 	ORO:long_name = "Orography, an enumerated yet continuous type: ocean=0.0, land=1.0, sea ice=2.0";
 	ORO:units = "fraction";
 
+	float orog(lat,lon);
+	orog:long_name = "Orography, an enumerated yet continuous type: ocean=0.0, land=1.0, sea ice=2.0";
+	orog:units = "fraction";
+        orog:original_name = "ORO" ;
+        orog:cell_measures = "area: areacella" ;
+        orog:purpose = "Replicate processing of files produced by CESM and distributed on ESGF" ;
+
 	float weight(lat);
 	weight:long_name = "Gaussian weight";
 	weight:units = "fraction";
@@ -1149,16 +1162,21 @@ variables:
 	two_dmn_rec_var:long_name = "two dimensional record variable";
 	two_dmn_rec_var:units = "watt meter-2";
 
-	float three_dmn_rec_var(time,lat,lon);
-	three_dmn_rec_var:long_name = "three dimensional record variable";
-	three_dmn_rec_var:units = "watt meter-2";
-	three_dmn_rec_var:coordinates = "time lat lon";
-
 	double three_dmn_var_dbl(time,lat,lon);
 	three_dmn_var_dbl:long_name = "three dimensional record variable of type double";
 	three_dmn_var_dbl:units = "watt meter-2";
 	three_dmn_var_dbl:_FillValue = -99.;
 
+	float zg(time,lev,lon);
+	zg:long_name = "three dimensional record variable to demonstrate hyperslab bug";
+	zg:units = "watt meter-2";
+	zg:_FillValue = -99.;
+
+	float three_dmn_rec_var(time,lat,lon);
+	three_dmn_rec_var:long_name = "three dimensional record variable";
+	three_dmn_rec_var:units = "watt meter-2";
+	three_dmn_rec_var:_FillValue = -99.;
+
 	int three_dmn_var_int(time,lat,lon);
 	three_dmn_var_int:long_name = "three dimensional record variable of type int";
 	three_dmn_var_int:units = "watt meter-2";
@@ -1257,6 +1275,7 @@ data:
 	area=10.,10.;
 	area2=20.,5.;
 	area_asm=1.,2.;
+	areacella=1.,1.,2.,2.,3.,3.,4.,4.;
 	bnd_var=1,2,3,4,5,6;
 	byt_arr=0,1,2,3,4,5,6,7;
 	byt_2D=0,1,2,3,4,5,6,7;
@@ -1383,6 +1402,7 @@ data:
 	var_mss_3=0.,1.,2.,_;
 	var_msk=0.,1.,0.,0.,1.,1.,0.,2.;
 	ORO=0.,1.,0.,0.,1.,1.,0.,2.;
+	orog=0.,1.,0.,0.,1.,1.,0.,2.;
 	mask=0.,1.,0.,0.,1.,1.,0.,2.;
 //	mask=0.,0.,0.,0.,0.,0.,0.,0.;
 //	mask=1.,1.,1.,1.,1.,1.,1.,1.;
@@ -1713,6 +1733,26 @@ data:
 				-99,58,59,60,61,62,63,64,
 				65,66,67,68,69,70,71,72,
 				-99,74,75,76,77,78,79,-99;
+	three_dmn_rec_var=    	 1, 2, 3, 4, 5, 6, 7, 8,
+				 9,10,11,12,13,14,15,16,
+				17,18,19,20,21,22,23,24,
+				-99,-99,-99,-99,-99,-99,-99,-99,
+				33,34,35,36,37,38,39,40,
+				41,42,43,44,45,46,47,48,
+				49,50,51,52,53,54,55,56,
+				-99,58,59,60,61,62,63,64,
+				65,66,67,68,69,70,71,72,
+				-99,74,75,76,77,78,79,-99;
+	zg=              	 1, 2, 3, 4, 5, 6, 7, 8,9,10,11,12,
+				13,14,15,16,17,18,19,20,21,22,23,24,
+	                        25,26,27,28,29,30,31,32,33,34,35,36,
+				37,38,39,40,41,42,43,44,45,46,47,48,
+				49,50,51,52,53,54,55,56,57,58,59,60,
+                                61,62,63,64,65,66,67,68,69,70,71,72,
+				73,74,75,76,77,78,79,80,81,82,83,84,
+                                85,86,87,88,89,90,91,92,93,94,95,96,
+                                97,98,99,100,101,102,103,104,105,106,107,108,
+                                109,110,111,112,113,114,115,116,117,118,119,120;
 	three_dmn_var_int= 	 1, 2, 3, 4, 5, 6, 7, 8,
 				 9,10,11,12,13,14,15,16,
 				-99,-99,-99,-99,-99,-99,-99,-99,
diff --git a/data/nccf b/data/nccf
index 859f2f2..0f759c3 100755
--- a/data/nccf
+++ b/data/nccf
@@ -8,6 +8,11 @@
 # Re-incarnated with getopt as nccf in NCO 4.5.1, July 2015
 # Requirements: NCO 4.3.x+, UNIX shell utilities awk, grep, sed
 # Optional: Decker CFchecker https://bitbucket.org/mde_/cfchecker
+# Currently handles three checkers:
+# NERC http://puma.nerc.ac.uk/cgi-bin/cf-checker.pl
+# Decker checker cf
+# IOOS checker (unsupported): https://data.ioos.us/compliance
+# JPL MCC checker (unsupported, based on IOOS): http://podaac-uat.jpl.nasa.gov/mcc
 
 # Usage:
 # nccf -c cf_chk -f fl_in -i drc_in -o drc_out -n nco_opt -v cf_vrs
diff --git a/data/ncclimo b/data/ncclimo
index 4d129db..eed91dd 100755
--- a/data/ncclimo
+++ b/data/ncclimo
@@ -3,7 +3,7 @@
 # Purpose: Climatology script tailored to CESM'ish monthly input and ACME output guidelines
 # Produces and optionally regrids climatological monthly means, seasonal means, annual mean
 
-# Copyright (C) 2015-2016 Charlie Zender
+# Copyright (C) 2015--2017 Charlie Zender
 # This file is part of NCO, the netCDF Operators. NCO is free software.
 # You may redistribute and/or modify NCO under the terms of the 
 # GNU General Public License (GPL) Version 3.
@@ -36,7 +36,7 @@
 # HowTo: https://acme-climate.atlassian.net/wiki/display/ATM/Generating+and+Regridding+Climatologies+%28climo+files%29+with+NCO+and+ncclimo
 # ACME Climatology Requirements: https://acme-climate.atlassian.net/wiki/display/ATM/Climo+Files+-+v0.3+AMIP+runs
 
-# Direct install:
+# Insta-install:
 # scp ~/nco/data/ncclimo aims4.llnl.gov:bin
 # scp ~/nco/data/ncclimo blues.lcrc.anl.gov:bin
 # scp ~/nco/data/ncclimo cooley.alcf.anl.gov:bin
@@ -76,8 +76,8 @@ fi # HOSTNAME
 if [ -z "${DATA}" ]; then
     case "${HOSTNAME}" in 
 	constance* | node* ) DATA='/scratch' ; ;; # PNNL
-	blues* | blogin* | b590 ) DATA="/lcrc/project/ACME/${USER}" ; ;; # ALCF blues compute nodes named bNNN, 16|64 cores|GB/node 
-	cooley* | cc* | mira* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN, 384 GB/node 
+	blues* | blogin* | b[0123456789][0123456789][0123456789] ) DATA="/lcrc/project/ACME/${USER}" ; ;; # ALCF blues compute nodes named bNNN, 16|64 cores|GB/node 
+	cooley* | cc[0123456789][0123456789][0123456789] | mira* ) DATA="/projects/HiRes_EarthSys/${USER}" ; ;; # ALCF cooley compute nodes named ccNNN, 384 GB/node 
 	cori* | edison* ) DATA="${SCRATCH}" ; ;; # NERSC cori/edison compute nodes all named nidNNNNN, edison 24|64 cores|GB/node; cori 32|128 cores|GB/node (cori login nodes 512 GB)
 	pileus* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF CADES
 	rhea* | titan* ) DATA="/lustre/atlas/world-shared/cli115/${USER}" ; ;; # OLCF rhea compute nodes named rheaNNN, 128 GB/node
@@ -90,7 +90,8 @@ case "${HOSTNAME}" in
     aims* )
 	export PATH='/export/zender1/bin'\:${PATH}
         export LD_LIBRARY_PATH='/export/zender1/lib'\:${LD_LIBRARY_PATH} ; ;;
-    blues* | blogin* | b590 )
+    blues* | blogin* | b[0123456789][0123456789][0123456789] )
+	soft add @openmpi-gcc
 	export PATH='/home/zender/bin'\:${PATH}
 	export LD_LIBRARY_PATH='/home/zender/lib'\:${LD_LIBRARY_PATH} ; ;;
     cooley* )
@@ -104,7 +105,7 @@ case "${HOSTNAME}" in
 	export PATH='/home/zender/bin_mira'\:${PATH}
 	export LD_LIBRARY_PATH='/soft/libraries/netcdf/current/library:/home/zender/lib_mira'\:${LD_LIBRARY_PATH} ; ;;
     cori* )
-	# 20160407: Split cori from edison binary locations to allow for different system libraries
+	# 20160407: Separate cori from edison binary locations to allow for different system libraries
 	# 20160420: module load gsl, udunits required for non-interactive batch submissions by Wuyin Lin
 	# Not necessary for interactive, nor for CSZ non-interactive, batch submisssions
 	# Must be due to home environment differences between CSZ and other users
@@ -196,6 +197,21 @@ esac # !HOSTNAME
 # Old MPAS filename conventions (until ~201609)::
 # ncclimo -v temperature -c hist -s 2 -e 3 -m ocn -i /lustre/atlas1/cli112/proj-shared/golaz/ACME_simulations/20160121.A_B2000ATMMOD.ne30_oEC.titan.a00/run -r ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -o ${DATA}/mpas/clm > ~/ncclimo.out 2>&1 &
 # ncclimo -v iceAreaCell -c hist -s 2 -e 3 -m ice -i /lustre/atlas1/cli112/proj-shared/golaz/ACME_simulations/20160121.A_B2000ATMMOD.ne30_oEC.titan.a00/run -r ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -o ${DATA}/mpas/clm > ~/ncclimo.out 2>&1 &
+# Split pipe:
+# cd ${DATA}/ne30/raw;ls *1979-??*.nc *198[01]-??*.nc | ncclimo --dbg=1 -s 1979 -e 1981 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm
+# Split redirection:
+# cd ${DATA}/ne30/raw;ls *1979-??*.nc *198[01]-??*.nc > ~/foo;ncclimo --dbg=1 -s 1979 -e 1981 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm < ~/foo
+# Split stdin switch:
+# cd ${DATA}/ne30/raw;ls *1979-??*.nc *198[01]-??*.nc | ncclimo --dbg=1 --stdin -s 1979 -e 1981 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm
+# Split positional arguments:
+# ncclimo --dbg=1 -s 1979 -e 1979 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-??.nc
+# Split directory:
+# ncclimo --dbg=1 --ypf=50 -s 1979 -e 1983 --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_in=${DATA}/ne30/raw --drc_out=${DATA}/ne30/clm
+# Split production:
+# cd /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run;ls *cam.h0.000[1-9]* | ncclimo --dbg=1 --yr_srt=1 --yr_end=9 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
+# cd /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run;ls *cam.h0.0[012]??* | ncclimo --dbg=1 --yr_srt=1 --yr_end=250 --var=FSNT,AODVIS,T --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
+# Daily pipe:
+# cd ${DATA}/ne30/raw;ls *h1*.nc | ncclimo --dbg=1 --job_nbr=8 --caseid='famipc5_ne30_v0.3_00007' --clm_md='dly' -s 2001 -e 2002 --var=PRECT,TREFHT --drc_out=${DATA}/ne30/clm > ~/ncclimo.out 2>&1 &
 
 # Best performance on resolutions finer than ne30 (~1x1 degree) requires a job scheduler/batch processor
 # Cobalt (cooley), SLURM (cori,edison), Maui (a PBS-variant) (blues), Torque (a PBS-variant) (hopper), and PBS (rhea) schedulers allow both interactive and non-interactive (i.e., script) batch jobs
@@ -211,6 +227,8 @@ esac # !HOSTNAME
 # https://www.nersc.gov/users/computational-systems/cori/running-jobs/for-edison-users/torque-moab-vs-slurm-comparisons
 # https://www.nersc.gov/users/computational-systems/cori/running-jobs/queues-and-policies/
 # https://www.nersc.gov/users/computational-systems/edison/running-jobs/queues-and-policies/
+# https://slurm.schedmd.com/sbatch.html # sbatch man page
+# https://slurm.schedmd.com/salloc.html # salloc man page
 # OLCF PBS: 
 # https://www.olcf.ornl.gov/support/system-user-guides/rhea-user-guide/#903
 # Requesting interactive nodes, Submitting non-interactive batch jobs, Monitoring queues, Deleting jobs:
@@ -231,14 +249,16 @@ esac # !HOSTNAME
 # 3. Cobalt uses ${COBALT_NODEFILE} and (NA) whereas PBS uses ${PBS_NODEFILE} and ${PBS_NUM_PPN}, respectively, and SLURM uses ${SLURM_NODELIST} and ${SLURM_CPUS_ON_NODE}, respectively
 # 4. SLURM automatically combines stdout and stderr, yet does not understand tilde (~ = home directory) expansion in error/output filenames
 # Differences 1 & 2 impose slightly different invocations; difference 3 requires abstracting environment variables; difference 4 requires omitting ~'s
+#   Blues a):  echo "ncclimo -a scd -d 1 -p mpi -c famipc5_ne30_v0.3_00003 -s 1980 -e 1983 -i ${DATA}/ne30/raw -o ${DATA}/ne30/clm -r ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc" > ~/ncclimo.pbs;chmod a+x ~/ncclimo.pbs
 #   Cooley a): /bin/rm -f ~/ncclimo.err  ~/ncclimo.out
 #              echo '#!/bin/bash' > ~/ncclimo.cobalt
 #              echo "ncclimo -d 1 -p mpi -c b1850c5_m2a -s 55 -e 58 -i /home/taylorm/scratch1.qtang/b1850c5_m2a/run -o ${DATA}/ne120/clm" >> ~/ncclimo.cobalt;chmod a+x ~/ncclimo.cobalt
 #   Cori,Edison a): echo '#!/bin/bash' > ~/ncclimo.slurm
 #                   echo "ncclimo -a scd -d 1 -p mpi -c famipc5_ne30_v0.3_00003 -s 1980 -e 1983 -i ${DATA}/ne30/raw -o ${DATA}/ne30/clm -r ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc" >> ~/ncclimo.slurm;chmod a+x ~/ncclimo.slurm
 #   Rhea a):   echo "ncclimo -a scd -d 1 -p mpi -c famipc5_ne120_v0.3_00003 -s 1980 -e 1983 -i /lustre/atlas1/cli115/world-shared/mbranst/famipc5_ne120_v0.3_00003-wget-test -o ${DATA}/ne120/clm -r ${DATA}/maps/map_ne120np4_to_fv257x512_aave.20150901.nc"  > ~/ncclimo.pbs;chmod a+x ~/ncclimo.pbs
+#   Blues b):  qsub -A ACME -q acme -l nodes=1 -l walltime=00:30:00 -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 #   Cooley b): qsub -A HiRes_EarthSys --nodecount=12 --time=00:30:00 --jobname ncclimo --error ~/ncclimo.err --output ~/ncclimo.out --notify zender at uci.edu ~/ncclimo.cobalt
-#   Cori,Edison b): sbatch -A acme --nodes=12 --time=00:30:00 --partition=regular --job-name=ncclimo --mail-type=END --output=ncclimo.out ~/ncclimo.slurm
+#   Cori,Edison b): sbatch -A acme --nodes=12 --time=00:30:00 --partition=regular --job-name=ncclimo --mail-type=END --output=${HOME}/ncclimo.out ~/ncclimo.slurm
 #   Hopper b): qsub -A acme -V -l mppwidth=288 -l walltime=00:30:00 -q regular -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 #   Rhea b):   qsub -A CLI115 -V -l nodes=12 -l walltime=00:30:00 -N ncclimo -j oe -m e -o ~/ncclimo.out ~/ncclimo.pbs
 
@@ -307,7 +327,7 @@ esac # !HOSTNAME
 # Set NCO version and directory
 nco_exe=`which ncks`
 if [ -z "${nco_exe}" ]; then
-    echo "ERROR: Unable to find NCO, nco_exe = ${nco_exe}"
+    echo "${spt_nm}: ERROR Unable to find NCO, nco_exe = ${nco_exe}"
     exit 1
 fi # !nco_exe
 # Use StackOverflow method to find NCO directory
@@ -337,18 +357,21 @@ fi # !TERM
     
 # Defaults for command-line options and some derived variables
 # Modify these defaults to save typing later
-ann_sfx='01-01-00000' # [sng] Annual file suffix (e.g., '01-01-00000')
+ann_sfx='01-01-00000' # [sng] Annual file suffix (MPAS, e.g., uses '01-01-00000')
+bch_pbs='No' # [sng] PBS batch (non-interactive) job
+bch_slr='No' # [sng] SLURM batch (non-interactive) job
 bnr_flg='No' # [sng] Binary method
 caseid='' # [sng] Case ID
 caseid_xmp='famipc5_ne30_v0.3_00003' # [sng] Case ID for examples
 cf_flg='Yes' # [sng] Produce CF climatology attribute?
+clm_flg='Yes' # [sng] Generate climatology
 clm_md='mth' # [sng] Climatology mode ('ann', 'dly', or 'mth')
 dbg_lvl=0 # [nbr] Debugging level
 dec_md='scd' # [sng] December mode ('scd' or 'sdd' as per above)
 drc_in='' # [sng] Input file directory
 drc_in_xmp="${DATA}/ne30/raw" # [sng] Input file directory for examples
 drc_in_mps="${DATA}/mpas/raw" # [sng] Input file directory for MPAS examples
-drc_out='' # [sng] Output file directory
+drc_out="${drc_pwd}" # [sng] Output file directory
 drc_out_xmp="${DATA}/ne30/clm" # [sng] Output file directory for examples
 drc_out_mps="${DATA}/mpas/clm" # [sng] Output file directory for MPAS examples
 drc_prv='' # [sng] Directory containing previous climatology to extend with current data
@@ -357,10 +380,17 @@ drc_rgr_prv='' # [sng] Regridded file directory for previous climatology
 drc_rgr_xmp="${DATA}/ne30/rgr" # [sng] Regrid file directory for examples
 drc_rgr_xtn='' # [sng] Regridded file directory for for extended climatology
 drc_xtn='' # [sng] Directory containing extended climatology
+dpy=365 # [nbr] Days-per-year
+fl_nbr=0 # [nbr] Number of files to split
 fml_nm='' # [sng] Family name (i.e., nickname, e.g., 'amip', 'control', 'experiment')
 gaa_sng_std="--gaa climo_script=${spt_nm} --gaa climo_command=\"'${cmd_ln}'\" --gaa climo_hostname=${HOSTNAME} --gaa climo_version=${nco_vrs}" # [sng] Global attributes to add
 hdr_pad='10000' # [B] Pad at end of header section
 hst_nm='h0' # [sng] History volume (e.g., 'h0', 'h1', 'h')
+inp_aut='No' # [sng] Input file list automatically generated
+inp_glb='No' # [sng] Input file list from globbing directory 
+inp_psn='No' # [sng] Input file list from positional arguments
+inp_std='No' # [sng] Input file list from stdin
+job_nbr=2 # [nbr] Job simultaneity for parallelism
 lnk_flg='Yes' # [sng] Link ACME-climo to AMWG-climo filenames
 mdl_nm='cam' # [sng] Model name (e.g., 'cam', 'cam2', 'cice', 'cism', 'clm', 'clm2', 'ice', 'mpascice', 'mpaso', 'ocn')
 mdl_typ='cesm' # [sng] Model type ('cesm', 'mpas') (for filenames and regridding)
@@ -372,21 +402,22 @@ par_opt='' # [sng] Parallel options to shell
 par_typ='bck' # [sng] Parallelism type
 rgr_map='' # [sng] Regridding map
 #rgr_map="${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc"
-#rgr_map="${DATA}/maps/map_ne30np4_to_fv257x512_bilin.20150901.nc"
-#rgr_map="${DATA}/maps/map_ne120np4_to_fv257x512_aave.20150901.nc"
-#rgr_map="${DATA}/maps/map_ne120np4_to_fv801x1600_bilin.20150901.nc"
 rgr_opt='' # [sng] Regridding options (e.g., '--rgr col_nm=lndgrid', '--rgr col_nm=nCells')
+sbs_flg='No' # [sng] Split (subset) climatologies
 thr_nbr=2 # [nbr] Thread number for regridder
+tpd_out=1 # [nbr] Timesteps-per-day in ouput
 #var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
 var_lst='' # [sng] Variables to process (empty means all)
 xtn_flg='No' # [sng] Produce extended climatology
+ypf_max=50 # [yr] Years-per-output-file
 yr_end='1983' # [yr] End year
 yr_srt='1980' # [yr] Start year
 
 function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_nm{} syntax
     # Print usage
-    printf "${fnt_rvr}Basic usage:\n${fnt_nrm} ${fnt_bld}${spt_nm} -c caseid -s yr_srt -e yr_end -i drc_in -o drc_out -r rgr_map${fnt_nrm}\n"
-    printf "${fnt_nrm} ${fnt_bld}${spt_nm} --case=caseid --start_year=yr_srt --end_year=yr_end --input=drc_in --output=drc_out --map=rgr_map${fnt_nrm}\n\n"
+    printf "${fnt_rvr}Basic usage:\n${fnt_nrm}${fnt_bld}${spt_nm} -c caseid -s yr_srt -e yr_end -i drc_in -o drc_out -r rgr_map${fnt_nrm} # Generate & regrid climatology\n"
+    printf "${fnt_bld}${spt_nm} -v var_lst -s yr_srt -e yr_end -o drc_out -r rgr_map in1.nc in2.nc ... inN.nc${fnt_nrm} # Split, reshape, & regrid timeseries\n"
+    printf "${fnt_bld}${spt_nm} --case=caseid --start=yr_srt --end=yr_end --input=drc_in --output=drc_out --map=rgr_map${fnt_nrm} # Long options\n\n"
     echo "Command-line options [long-option synonyms in ${fnt_tlc}italics${fnt_nrm}]:"
     echo "${fnt_rvr}-a${fnt_nrm} ${fnt_bld}dec_md${fnt_nrm}   December mode (default ${fnt_bld}${dec_md}${fnt_nrm}) [${fnt_tlc}dec_md, december_mode, dec_mode${fnt_nrm}]"
     echo "${fnt_rvr}-C${fnt_nrm} ${fnt_bld}clm_md${fnt_nrm}   Climatology mode (default ${fnt_bld}${clm_md}${fnt_nrm}) [${fnt_tlc}clm_md, climatology_mode, climo_mode${fnt_nrm}]"
@@ -397,6 +428,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-f${fnt_nrm} ${fnt_bld}fml_nm${fnt_nrm}   Family name (nickname) (empty means none) (default ${fnt_bld}${fml_nm}${fnt_nrm}) [${fnt_tlc}fml_nm, family_name${fnt_nrm}]"
     echo "${fnt_rvr}-h${fnt_nrm} ${fnt_bld}hst_nm${fnt_nrm}   History volume name (default ${fnt_bld}${hst_nm}${fnt_nrm}) [${fnt_tlc}hst_nm, history_name, history${fnt_nrm}]"
     echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}drc_in${fnt_nrm}   Input directory (default ${fnt_bld}${drc_in}${fnt_nrm}) [${fnt_tlc}drc_in, in_drc, dir_in, in_dir, input${fnt_nrm}]"
+    echo "${fnt_rvr}-j${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm}  Job simultaneity for parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm}) [${fnt_tlc}job_nbr, job_number, jobs${fnt_nrm}]"
     echo "${fnt_rvr}-l${fnt_nrm} ${fnt_bld}lnk_flg${fnt_nrm}  Link ACME-climo to AMWG-climo filenames (default ${fnt_bld}${lnk_flg}${fnt_nrm}) [${fnt_tlc}lnk_flg, link_flag, no_amwg_links${fnt_nrm}]"
     echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}mdl_nm${fnt_nrm}   Model name (default ${fnt_bld}${mdl_nm}${fnt_nrm}) [${fnt_tlc}mdl_nm, model_name, model${fnt_nrm}]"
     echo "${fnt_rvr}-n${fnt_nrm} ${fnt_bld}nco_opt${fnt_nrm}  NCO options (empty means none) (default ${fnt_bld}${nco_opt}${fnt_nrm}) [${fnt_tlc}nco_opt, nco, nco_options${fnt_nrm}]"
@@ -405,20 +437,23 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-p${fnt_nrm} ${fnt_bld}par_typ${fnt_nrm}  Parallelism type (default ${fnt_bld}${par_typ}${fnt_nrm}) [${fnt_tlc}par_typ, par_md, parallel_type, parallel_mode, parallel${fnt_nrm}]"
     echo "${fnt_rvr}-r${fnt_nrm} ${fnt_bld}rgr_map${fnt_nrm}  Regrid map (empty means none) (default ${fnt_bld}${rgr_map}${fnt_nrm}) [${fnt_tlc}rgr_map, regrid_map$, map, map_file, map_fl{fnt_nrm}]"
     echo "${fnt_rvr}-R${fnt_nrm} ${fnt_bld}rgr_opt${fnt_nrm}  Regrid options (empty means none) (default ${fnt_bld}${rgr_opt}${fnt_nrm}) [${fnt_tlc}rgr_opt, regrid_options${fnt_nrm}]"
-    echo "${fnt_rvr}-t${fnt_nrm} ${fnt_bld}thr_nbr${fnt_nrm}  Thread number for regridder (default ${fnt_bld}${thr_nbr}${fnt_nrm}) [${fnt_tlc}thr_nbr, thread_number, thread, threads${fnt_nrm}]"
     echo "${fnt_rvr}-S${fnt_nrm} ${fnt_bld}yr_srt${fnt_nrm}   Start year previous climo (empty means none) (default ${fnt_bld}${yr_srt_prv}${fnt_nrm}) [${fnt_tlc}yr_srt_prv, prv_yr_srt, previous_start${fnt_nrm}]"
     echo "${fnt_rvr}-s${fnt_nrm} ${fnt_bld}yr_srt${fnt_nrm}   Start year (default ${fnt_bld}${yr_srt}${fnt_nrm}) [${fnt_tlc}yr_srt, start_yr, year_start, start_year, start${fnt_nrm}]"
-    echo "${fnt_rvr}-v${fnt_nrm} ${fnt_bld}var_lst${fnt_nrm}  Variable list (empty means all) (default ${fnt_bld}${var_lst}${fnt_nrm}) [${fnt_tlc}var_lst, variable_list, variable, variables${fnt_nrm}]"
+    echo "${fnt_rvr}  ${fnt_nrm} ${fnt_bld}stdin${fnt_nrm}    Stdin used for input (default ${fnt_bld}${inp_std}${fnt_nrm}) [${fnt_tlc}stdin, std_flg, inp_std, redirect, standard_input${fnt_nrm}]"
+    echo "${fnt_rvr}-t${fnt_nrm} ${fnt_bld}thr_nbr${fnt_nrm}  Thread number for regridder (default ${fnt_bld}${thr_nbr}${fnt_nrm}) [${fnt_tlc}thr_nbr, thread_number, thread, threads${fnt_nrm}]"
+    echo "${fnt_rvr}  ${fnt_nrm} ${fnt_bld}tpd_out${fnt_nrm}  Timesteps-per-day in output (default ${fnt_bld}${tpd_out}${fnt_nrm}) [${fnt_tlc}tpd_out, tpd, timesteps_per_day${fnt_nrm}]"
+    echo "${fnt_rvr}-v${fnt_nrm} ${fnt_bld}var_lst${fnt_nrm}  Variable list (empty means all) (default ${fnt_bld}${var_lst}${fnt_nrm}) [${fnt_tlc}var_lst, variable_list, var, vars, variable, variables${fnt_nrm}]"
     echo "${fnt_rvr}-X${fnt_nrm} ${fnt_bld}drc_xtn${fnt_nrm}  Extended climo directory (default ${fnt_bld}${drc_xtn}${fnt_nrm}) [${fnt_tlc}drc_xtn, xtn_drc, extended_dir, extended_climo, extended${fnt_nrm}]"
     echo "${fnt_rvr}-x${fnt_nrm} ${fnt_bld}drc_prv${fnt_nrm}  Previous climo directory (default ${fnt_bld}${drc_prv}${fnt_nrm}) [${fnt_tlc}drc_prv, prv_drc, previous_dir, previous_climo, previous${fnt_nrm}]"
     echo "${fnt_rvr}-Y${fnt_nrm} ${fnt_bld}rgr_xtn${fnt_nrm}  Regridded extended climo directory (default ${fnt_bld}${drc_rgr_xtn}${fnt_nrm}) [${fnt_tlc}drc_rgr_xtn, drc_xtn_rgr, regridded_extended, extended_regridded${fnt_nrm}]"
     echo "${fnt_rvr}-y${fnt_nrm} ${fnt_bld}rgr_prv${fnt_nrm}  Regridded previous climo directory (default ${fnt_bld}${drc_rgr_prv}${fnt_nrm}) [${fnt_tlc}drc_rgr_prv, drc_prv_rgr, regridded_previous, prefvious_regridded${fnt_nrm}]"
+    echo "${fnt_rvr}  ${fnt_nrm} ${fnt_bld}ypf_max${fnt_nrm}  Years-per-output-file maximum (empty means none) (default ${fnt_bld}${ypf_max}${fnt_nrm}) [${fnt_tlc}ypf_max, ypf, years, years_per_file${fnt_nrm}]"
     printf "\n"
-    printf "${fnt_rvr}Examples:${fnt_nrm}\n${fnt_bld}${spt_nm} -c ${caseid_xmp} -s ${yr_srt} -e ${yr_end} -i ${drc_in_xmp} -o ${drc_out_xmp} ${fnt_nrm}\n"
-    printf "${fnt_bld}${spt_nm} -c ${caseid_xmp} -s ${yr_srt} -e ${yr_end} -i ${drc_in_xmp} -o ${drc_out_xmp} -r ~zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc ${fnt_nrm}\n"
+    printf "${fnt_rvr}Examples:${fnt_nrm}\n${fnt_bld}${spt_nm} -c ${caseid_xmp} -s ${yr_srt} -e ${yr_end} -i ${drc_in_xmp} -o ${drc_out_xmp} -r ~zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc ${fnt_nrm}\n"
     printf "${fnt_bld}${spt_nm} -c control -m clm2 -s ${yr_srt} -e ${yr_end} -i ${drc_in_xmp} -o ${drc_out_xmp} -r ~zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc ${fnt_nrm}\n"
     printf "${fnt_bld}${spt_nm} -m mpascice  -s ${yr_srt} -e ${yr_end} -i ${drc_in_mps} -o ${drc_out_mps} -r ~zender/data/maps/map_oEC60to30_to_t62_bilin.20160301.nc ${fnt_nrm}\n"
-    printf "${fnt_bld}${spt_nm} -m mpaso -p mpi -s 1 -e 5 -i ${drc_in_mps} -o ${drc_out_mps} -r ~zender/data/maps/map_oEC60to30_to_t62_bilin.20160301.nc ${fnt_nrm}\n\n"
+    printf "${fnt_bld}${spt_nm} -m mpaso -p mpi -s 1 -e 5 -i ${drc_in_mps} -o ${drc_out_mps} -r ~zender/data/maps/map_oEC60to30_to_t62_bilin.20160301.nc ${fnt_nrm}\n"
+    printf "${fnt_bld}cd output;ls *cam*19??-??*.nc | ${spt_nm} -v FSNT,TREFHT -s 1900 -e 1999 -o ${drc_out_xmp} -r ~zender/data/maps/map_ne30np4_to_fv129x256_aave.20150901.nc ${fnt_nrm}\n\n"
     printf "${fnt_rvr}Interactive batch queues:${fnt_nrm}\n"
     printf "blues : qsub -I -A ACME -q acme -l nodes=1 -l walltime=00:30:00 -N ncclimo\n"
     printf "cooley: qsub -I -A HiRes_EarthSys --nodecount=1 --time=00:30:00 --jobname=ncclimo\n"
@@ -476,17 +511,18 @@ fi # !arg_nbr
 # Parse command-line options:
 # http://stackoverflow.com/questions/402377/using-getopts-in-bash-shell-script-to-get-long-and-short-command-line-options (see method by Adam Katz)
 # http://tuxtweaks.com/2014/05/bash-getopts
-while getopts :a:C:c:d:E:e:f:h:i:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
+while getopts :a:C:c:d:E:e:f:h:i:j:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
     case ${OPT} in
 	a) dec_md="${OPTARG}" ;; # December mode
-	C) clm_md="${OPTARG}" ;; # Climatology mode
+	C) clm_md_usr="${OPTARG}" ;; # Climatology mode
 	c) caseid="${OPTARG}" ;; # CASEID
 	d) dbg_lvl="${OPTARG}" ;; # Debugging level
 	E) yr_end_prv="${OPTARG}" ;; # End year previous
 	e) yr_end="${OPTARG}" ;; # End year
-	f) fml_nm="${OPTARG}" ;; # Family name
+	f) fml_nm_usr="${OPTARG}" ;; # Family name
 	h) hst_nm="${OPTARG}" ;; # History tape name
 	i) drc_in="${OPTARG}" ;; # Input directory
+	j) job_usr="${OPTARG}" ;; # Job simultaneity
 	l) lnk_flg="${OPTARG}" ;; # Link ACME to AMWG name
 	m) mdl_nm="${OPTARG}" ;; # Model name
 	n) nco_opt="${OPTARG}" ;; # NCO options
@@ -503,6 +539,7 @@ while getopts :a:C:c:d:E:e:f:h:i:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
 	x) drc_prv="${OPTARG}" ;; # Previous climo directory
 	Y) drc_rgr_xtn="${OPTARG}" ;; # Regridded extended climo directory
 	y) drc_rgr_prv="${OPTARG}" ;; # Regridded previous climo directory
+	z) ypf_max_usr="${OPTARG}" ;; # Years-per-output-file maximum
 	-) LONG_OPTARG="${OPTARG#*=}"
 	   case ${OPTARG} in
 	       # Hereafter ${OPTARG} is long argument key, and ${LONG_OPTARG}, if any, is long argument value
@@ -510,14 +547,15 @@ while getopts :a:C:c:d:E:e:f:h:i:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
 	       # Long options with argument, no short option counterpart
 	       # Long options with short counterparts, ordered by short option key
 	       dec_md=?* | december_mode=?* | dec_mode=?* ) dec_md="${LONG_OPTARG}" ;; # -a # December mode
-	       clm_md=?* | climatology_mode=?* | climo_mode=?* ) clm_md="${LONG_OPTARG}" ;; # -C # Climatology mode
+	       clm_md=?* | climatology_mode=?* | climo_mode=?* ) clm_md_usr="${LONG_OPTARG}" ;; # -C # Climatology mode
 	       caseid=?* | case_id=?* | case=?* ) caseid="${LONG_OPTARG}" ;; # -c # CASEID
 	       dbg_lvl=?* | dbg=?* | debug=?* | debug_level=?* ) dbg_lvl="${LONG_OPTARG}" ;; # -d # Debugging level
 	       yr_end_prv=?* | prv_yr_end=?* | previous_end=?* ) yr_end_prv="${LONG_OPTARG}" ;; # -E # End year previous
 	       yr_end=?* | end_yr=?* | year_end=?* | end_year=?* | end=?* ) yr_end="${LONG_OPTARG}" ;; # -e # End year
-	       fml_nm=?* | family_name=?* | family=?* ) fml_nm="${LONG_OPTARG}" ;; # -f # Family name
+	       fml_nm=?* | family_name=?* | family=?* ) fml_nm_usr="${LONG_OPTARG}" ;; # -f # Family name
 	       hst_nm=?* | history_name=?* | history=?* ) hst_nm="${LONG_OPTARG}" ;; # -h # History tape name
 	       drc_in=?* | in_drc=?* | dir_in=?* | in_dir=?* | input=?* ) drc_in="${LONG_OPTARG}" ;; # -i # Input directory
+	       job_nbr=?* | job_number=?* | jobs=?* ) job_usr="${LONG_OPTARG}" ;; # -j # Job simultaneity
 	       lnk_flg | link_flag | no_amwg_link | no_amwg_links | no_AMWG_link | no_AMWG_links ) lnk_flg='No' ;; # -l # Link ACME to AMWG name
 	       lnk_flg=?* | link_flag=?* | no_amwg_link=?* | no_amwg_links=?* | no_AMWG_link=?* | no_AMWG_links=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # -l # Link ACME to AMWG name
 	       mdl_nm=?* | model_name=?* | model=?* ) mdl_nm="${LONG_OPTARG}" ;; # -m # Model name
@@ -530,20 +568,81 @@ while getopts :a:C:c:d:E:e:f:h:i:l:m:n:O:o:p:R:r:S:s:t:v:X:x:Y:y:-: OPT; do
 	       yr_srt_prv=?* | prv_yr_srt=?* | previous_start=?* ) yr_srt_prv="${LONG_OPTARG}" ;; # -S # Start year previous
 	       yr_srt=?* | start_yr=?* | year_start=?* | start_year=?* | start=?* ) yr_srt="${LONG_OPTARG}" ;; # -s # Start year
 	       thr_nbr=?* | thread_number=?* | thread=?* | threads=?* ) thr_usr="${LONG_OPTARG}" ;; # -t # Thread number
-	       var_lst=?* | variable_list=?* | variable=?* | variables=?* ) var_lst="${LONG_OPTARG}" ;; # -v # Variables
+	       stdin | inp_std | std_flg | redirect | standard_input ) inp_std='Yes' ;; # # Input file list from stdin
+	       stdin=?* | inp_std=?* | std_flg=?* | redirect=?* | standard_input=?* ) echo "No argument allowed for --${OPTARG switch}" >&2; exit 1 ;; # # Input file list from stdin
+	       tpd_out=?* | tpd=?* | timesteps_per_day=?* ) tpd_out="${LONG_OPTARG}" ;; # # Timesteps-per-day in output
+	       var_lst=?* | variable_list=?* | var=?* | vars=?* | variable=?* | variables=?* ) var_lst="${LONG_OPTARG}" ;; # -v # Variables
 	       drc_xtn=?* | xtn_drc=?* | extended_dir=?* | extended_climo=?* | extended=?* ) drc_xtn="${LONG_OPTARG}" ;; # -X # Extended climo directory
 	       drc_prv=?* | prv_drc=?* | previous_dir=?* | previous_climo=?* | previous=?* ) drc_prv="${LONG_OPTARG}" ;; # -x # Previous climo directory
 	       drc_rgr_xtn=?* | drc_xtn_rgr=?* | regridded_extended=?* | extended_regridded=?* ) drc_rgr_xtn="${LONG_OPTARG}" ;; # -Y # Regridded extended climo directory
 	       drc_rgr_prv=?* | drc_prv_rgr=?* | regridded_previous=?* | previous_regridded=?* ) drc_rgr_prv="${LONG_OPTARG}" ;; # -y # Regridded previous climo directory
+	       ypf_max=?* | ypf=?* | years=?* | years_per_file=?* ) ypf_max_usr="${LONG_OPTARG}" ;; # -z # Years-per-output-file maximum
                '' ) break ;; # "--" terminates argument processing
-               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}" >&2; fnc_usg_prn ;;
-	   esac ;;
+               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
+	   esac ;; # !OPTARG
 	\?) # Unrecognized option
-	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed" >&2
+	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed\n" >&2
 	    fnc_usg_prn ;;
-    esac
-done
+    esac # !OPT
+done # !getopts
 shift $((OPTIND-1)) # Advance one argument
+psn_nbr=$#
+if [ ${psn_nbr} -ge 1 ]; then
+    inp_psn='Yes'
+fi # !psn_nbr
+    
+# Detect input on pipe to stdin:
+# http://stackoverflow.com/questions/2456750/detect-presence-of-stdin-contents-in-shell-script
+# http://unix.stackexchange.com/questions/33049/check-if-pipe-is-empty-and-run-a-command-on-the-data-if-it-isnt
+# 20170119 "if [ ! -t 0 ]" tests whether unit 0 (stdin) is connected to terminal, not whether pipe has data
+# Non-interactive batch mode (e.g., qsub, sbatch) disconnects stdin from terminal and triggers false-positives with ! -t 0
+# 20170123 "if [ -p foo ]" tests whether foo exists and is a pipe or named pipe
+# Non-interactive batch mode (i.e., sbatch) behaves as desired for -p /dev/stdin on SLURM
+# Non-interactive batch mode (e.g., qsub) always returns true for -p /dev/stdin on PBS, leads to FALSE POSITIVES!
+# This is because PBS uses stdin to set the job name
+# Hence -p /dev/stdin test works everywhere tested except PBS non-interactive batch environment
+if [ -n "${PBS_ENVIRONMENT}" ]; then
+    if [ "${PBS_ENVIRONMENT}" = 'PBS_BATCH' ]; then
+	# PBS batch detection suggested by OLCF ticket CCS #338970 on 20170127
+	bch_pbs='Yes'
+    fi # !PBS_ENVIRONMENT
+fi # !PBS
+if [ -n "${SLURM_JOBID}" ] && [ -z "${SLURM_PTY_PORT}" ]; then
+    # SLURM batch detection suggested by NERSC ticket INC0096873 on 20170127
+    bch_slr='Yes'
+fi # !SLURM
+if [ ${bch_pbs} = 'Yes' ] || [ ${bch_slr} = 'Yes' ]; then
+    # Batch environment
+    if [ ${bch_pbs} = 'Yes' ]; then
+	if [ ! -p /dev/stdin ]; then
+	    # PBS batch jobs cause -p to return true except for stdin redirection 
+	    # When -p returns true we do not know whether stdin pipe contains any input
+	    # User must explicitly indicate use of stdin pipes with --stdin option
+	    # Redirection in PBS batch jobs unambiguously causes -p to return false
+	    inp_std='Yes'
+	fi # !stdin
+    fi # !bch_slr
+    if [ ${bch_slr} = 'Yes' ]; then
+	if [ -p /dev/stdin ]; then
+	    # SLURM batch jobs cause -p to return true for stdin pipes
+	    # When -p returns false we do not know whether output was redirectd
+	    # User must explicitly indicate use of redirection with --stdin option
+	    # Stdin pipes in SLURM batch jobs unambiguously cause -p to return true
+	    inp_std='Yes'
+	fi # !stdin
+    fi # !bch_slr
+else # !bch
+    # Interactive environment
+    if [ -p /dev/stdin ] || [ ! -t 0 ]; then
+	# Interactive environments unambiguously cause -p to return true for stdin pipes
+	# Interactive environments unambiguously cause -t 0 to return false for stdin redirection
+	inp_std='Yes'
+    fi # !stdin
+fi # !bch
+if [ ${inp_std} = 'Yes' ] && [ ${inp_psn} = 'Yes' ]; then
+    echo "${spt_nm}: ERROR expecting input both from stdin and positional command-line arguments\n"
+    exit 1
+fi # !inp_std
 
 # Determine mode first (this helps determine other defaults)
 if [ -n "${yr_srt_prv}" ]; then
@@ -556,6 +655,28 @@ if [ -n "${yr_srt_prv}" ]; then
 	ncr_flg='Yes'
     fi # !yr_end_prv binary method
 fi # !yr_srt_prv extended climo
+if [ -n "${clm_md_usr}" ]; then 
+    # Climo mode must be explicitly selected with --clm_md when climo input files are piped or positional
+    clm_md="${clm_md_usr}"
+    clm_flg='Yes' # redundant (and safe)
+else
+    # Otherwise subset (split) mode whenever stdin pipe has data or positional arguments are used
+    if [ ${inp_std} = 'Yes' ] || [ ${inp_psn} = 'Yes' ]; then
+	sbs_flg='Yes'
+	clm_flg='No'
+	dec_md='sdd'
+	mdl_nm='nil' # Unset model name for stdin pipe and positional arguments, otherwise default mdl_nm could be used to add model-specific variables to var_lst_xtn
+    fi # !stdin || !psn
+    if [ -n "${ypf_max_usr}" ]; then 
+	# fxm: Must specify --ypf to turn-on split mode when input files are specified by -i drc_in
+	# Otherwise it is ambiguous whether to generate climatology or to split
+	ypf_max=${ypf_max_usr}
+	sbs_flg='Yes'
+	clm_flg='No'
+	dec_md='sdd'
+	mdl_nm='nil'
+    fi # !ypf_max
+fi # !clm_md_usr
 
 # Derived variables
 if [ -n "${drc_out_usr}" ]; then
@@ -615,7 +736,8 @@ if [ "${mdl_typ}" = 'mpas' ]; then
     out_nm="${mdl_nm}"
     hst_nm='hist'
 fi # !mdl_typ
-if [ -n "${fml_nm}" ]; then 
+if [ -n "${fml_nm_usr}" ]; then 
+    fml_nm="${fml_nm_usr}"
     out_nm="${fml_nm}"
 fi # !fml_nm
 # http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
@@ -629,27 +751,38 @@ if [[ "${caseid}" =~ ^(.*)([0-9][0-9][0-9][0-9][01][0-9].nc.?)$ ]]; then
     out_nm=${bs_nm}
     bs_sfx="${caseid#*.}"
 fi # !caseid
-if [ "${clm_md}" != 'ann' ] && [ "${clm_md}" != 'dly' ] && [ "${clm_md}" != 'mth' ]; then 
-    echo "ERROR: User-defined climatology mode is ${clm_md}. Valid options are 'ann', 'dly', or 'mth' (default)"
+if [ "${clm_md}" != 'ann' ] && [ "${clm_md}" != 'dly' ] && [ "${clm_md}" != 'mth' ] ; then 
+    echo "${spt_nm}: ERROR User-defined climatology mode is ${clm_md}. Valid options are 'ann', 'dly', or 'mth' (default)"
     exit 1
 fi # !clm_md
 if [ "${clm_md}" = 'ann' ]; then 
     clm_nbr=1
     dec_md='sdd'
+elif [ "${clm_md}" = 'dly' ]; then 
+    clm_nbr=${dpy}
+    dec_md='sdd'
 elif [ "${clm_md}" = 'mth' ]; then 
     clm_nbr=17
 fi # !clm_md
-
+if [ -z "${drc_in}" ]; then
+    drc_in="${drc_pwd}"
+else # !drc_in
+    drc_in_usr_flg='Yes'
+fi # !drc_in
 if [ -n "${gaa_sng_std}" ]; then
     if [ "${yr_nbr}" -gt 1 ] ; then
 	yrs_avg_sng="${yr_srt}-${yr_end}"
     else
 	yrs_avg_sng="${yr_srt}"
     fi # !yr_nbr
-    gaa_sng="${gaa_sng_std} --gaa yrs_averaged=${yrs_avg_sng}"
-    nco_opt="${nco_opt} ${gaa_sng}"
-fi # !var_lst
-if [ -n "${var_lst}" ]; then
+    if [ "${sbs_flg}" != 'Yes' ]; then
+	gaa_sng="${gaa_sng_std} --gaa yrs_averaged=${yrs_avg_sng}"
+    fi # !sbs_flg
+fi # !gaa_sng
+if [ -n "${job_usr}" ]; then 
+    job_nbr="${job_usr}"
+fi # !job_usr
+if [ -n "${var_lst}" ] && [ "${sbs_flg}" != 'Yes' ]; then
     nco_opt="${nco_opt} -v ${var_lst}"
 fi # !var_lst
 if [ -n "${hdr_pad}" ]; then
@@ -668,8 +801,8 @@ elif [ "${par_typ}" = 'mpi' ]; then
 fi # !par_typ
 if [ -n "${rgr_map}" ]; then 
     if [ ! -f "${rgr_map}" ]; then
-	echo "ERROR: Unable to find specified regrid map ${rgr_map}"
-	echo "HINT: Supply the full path-name for the regridding map"
+	echo "${spt_nm}: ERROR Unable to find specified regrid map ${rgr_map}"
+	echo "${spt_nm}: HINT Supply the full path-name for the regridding map"
 	exit 1
     fi # ! -f
     rgr_opt="${rgr_opt} --map ${rgr_map}"
@@ -696,6 +829,125 @@ if [ ${dec_md} = 'scd' ]; then
     let yr_cln=${yr_cln}+1
 fi # !scd
 
+# Read files from stdin pipe, positional arguments, or directory glob
+#printf "dbg: inp_aut  = ${inp_aut}\n"
+#printf "dbg: inp_glb  = ${inp_glb}\n"
+#printf "dbg: inp_psn  = ${inp_psn}\n"
+#printf "dbg: inp_std  = ${inp_std}\n"
+if [ ${clm_flg} = 'Yes' ] && [ ${clm_md} = 'dly' ] && [ ${inp_psn} = 'No' ] && [ ${inp_std} = 'No' ] && [ "${drc_in_usr_flg}" = 'Yes' ]; then
+    inp_glb='Yes'
+fi # !clm_flg, !dly
+if [ ${sbs_flg} = 'Yes' ] && [ ${inp_psn} = 'No' ] && [ ${inp_std} = 'No' ] && [ "${drc_in_usr_flg}" = 'Yes' ]; then
+    inp_glb='Yes'
+fi # !sbs_flg
+if [ ${sbs_flg} = 'Yes' ] && [ ${inp_glb} = 'No' ] && [ ${inp_psn} = 'No' ] && [ ${inp_std} = 'No' ]; then
+    echo "${spt_nm}: ERROR Specify input file(s) with -i \$drc_in or with positional argument(s) or with stdin"
+    if [ ${bch_pbs} = 'Yes' ]; then
+	echo "${spt_nm}: HINT PBS batch job environment detected, pipe to stdin not allowed, try positional arguments instead"
+    else # !bch_pbs
+	echo "${spt_nm}: HINT Pipe input file list to stdin with, e.g., 'ls *.nc | ${spt_nm}'"
+    fi # !bch_pbs
+    exit 1
+fi # !sbs_flg
+if [ ${clm_flg} = 'Yes' ] && [ ${clm_md} = 'ann' ]; then
+    inp_aut='Yes'
+    inp_std='No' # fxm: 20170123 hack for false positives in non-interactive batch mode on PBS
+fi # !clm_flg
+if [ ${clm_flg} = 'Yes' ] && [ ${clm_md} = 'mth' ]; then
+    inp_aut='Yes'
+    inp_std='No' # fxm: 20170123 hack for false positives in non-interactive batch mode on PBS
+fi # !clm_flg
+if [ ${inp_glb} = 'Yes' ]; then 
+    for fl in "${drc_in}"/*.nc "${drc_in}"/*.nc3 "${drc_in}"/*.nc4 "${drc_in}"/*.cdf "${drc_in}"/*.hdf "${drc_in}"/*.he5 "${drc_in}"/*.h5 ; do
+	if [ -f "${fl}" ]; then
+	    fl_in[${fl_nbr}]=${fl}
+	    let fl_nbr=${fl_nbr}+1
+	fi # !file
+    done
+fi # !inp_glb
+if [ ${inp_psn} = 'Yes' ]; then
+    # Read any positional arguments
+    for ((psn_idx=1;psn_idx<=psn_nbr;psn_idx++)); do
+	fl_in[(${psn_idx}-1)]=${!psn_idx}
+	fl_nbr=${psn_nbr}
+    done # !psn_idx
+fi # !inp_psn
+if [ ${inp_std} = 'Yes' ]; then
+    # Input awaits on unit 0, i.e., on stdin
+    while read -r line; do # NeR05 p. 179
+	fl_in[${fl_nbr}]=${line}
+	let fl_nbr=${fl_nbr}+1
+    done < /dev/stdin
+fi # !inp_std
+
+# Parse grid/map arguments before in_fl arguments so we know whether this could be a map-only invocation
+if [ "${sbs_flg}" = 'Yes' ]; then
+    if [ -z "${var_lst}" ]; then
+	echo "${spt_nm}: ERROR Split mode requires variable list"
+	echo "${spt_nm}: HINT Supply the variable list with -v var_lst"
+	exit 1
+    fi # !var_lst
+    # http://stackoverflow.com/questions/27702452/loop-through-a-comma-separated-shell-variable
+    var_nbr=0 # [sng] Split (subset) files
+    for var in ${var_lst//,/ }; do
+	# NB:
+	var_sbs[${var_nbr}]=${var}
+	let var_nbr=${var_nbr}+1
+    done # !var_lst
+
+    # Input files per year
+    if [ "${clm_md}" = 'ann' ]; then
+	fpy=1
+    elif [ "${clm_md}" = 'dly' ]; then
+	fpy=${dpy}
+    elif [ "${clm_md}" = 'mth' ]; then
+	fpy=12
+    fi # !clm_md
+    let yr_sbs=${fl_nbr}/${fpy}
+    let fl_rmd=${fl_nbr}%${fpy}
+    if [ ${fl_rmd} -ne 0 ]; then
+	printf "${spt_nm}: ERROR ${fl_nbr} files of clm_md=${clm_md} input contain non-integral number of years, ${fl_rmd} files leftover in final year\n"
+	printf "${spt_nm}: HINT Provide input filenames in multiples of ${fpy}\n"
+	exit 1
+    fi # !fl_rmd
+    if [ ${yr_sbs} -ne ${yr_nbr} ]; then
+	# Sanity check that number of files specified matches number expected from date switches
+	printf "${spt_nm}: ERROR ${fl_nbr} files specified (via stdin pipe, positional, or input directory) expected to contain ${yr_sbs} years of data but date options specified ${yr_nbr} years of data\n"
+	printf "${spt_nm}: HINT Number of files at ${fpy} files-per-year must match number of years implied by arguments to start- and end-year switches (which are --yr_srt=${yr_srt} and --yr_end=${yr_end}, respectively)\n"
+	exit 1
+    fi # !yr_sbs
+
+    # How many segments of output?
+    let sgm_nbr=${yr_sbs}/${ypf_max}
+    let sgm_rmd=${yr_sbs}%${ypf_max}
+    if [ ${sgm_rmd} -ne 0 ]; then
+	let sgm_nbr=${sgm_nbr}+1
+	let sgm_nbrm1=${sgm_nbr}-1
+	sgm_flg='Yes'
+    else # !sgm_rmd
+	sgm_flg='No'
+    fi # !sgm_rmd  
+
+else # !sbs_flg
+
+    if [ -z "${out_nm}" ]; then
+	echo "${spt_nm}: ERROR Missing information needed to generate output filenames"
+	echo "${spt_nm}: HINT Climo generation requires that users specify a case ID with -c \$caseid or specify with -m \$mdl_nm a recognized model name (like \"mpaso\")"
+	echo "${spt_nm}: HINT ${spt_nm} needs this information to generate output filenames"
+	echo "${spt_nm}: HINT See invocation examples at http://nco.sf.net/nco.html#ncclimo"
+	exit 1
+    fi # out_nm
+
+    if [ ${inp_std} = 'Yes' ] && [ ${clm_md} != 'dly' ] ; then
+	echo "${spt_nm}: ERROR Detected input on pipe to stdin rather than console in climatology generation mode"
+	echo "${spt_nm}: HINT Piping filenames to ${spt_nm} only works when splitting files or in daily climatology mode"
+	echo "${spt_nm}: HINT In other climo generation modes (montly and annual), one specifies the year/month boundaries and ${spt_nm} automatically generates the correct input file names"
+	echo "${spt_nm}: HINT See invocation examples at http://nco.sf.net/nco.html#ncclimo"
+	exit 1
+    fi # !stdin
+
+fi # !sbs_flg
+
 if [ "${mpi_flg}" = 'Yes' ]; then
     if [ -n "${COBALT_NODEFILE}" ]; then 
 	nd_fl="${COBALT_NODEFILE}"
@@ -709,44 +961,59 @@ if [ "${mpi_flg}" = 'Yes' ]; then
 	nd_lst=`scontrol show hostname ${SLURM_NODELIST}`
 	echo ${nd_lst} > ${nd_fl}
     else
-	echo "ERROR: MPI job unable to find node list"
-	echo "HINT: ${spt_nm} uses first node list found in \$COBALT_NODEFILE (= \"${COBALT_NODEFILE}\"), \$PBS_NODEFILE (= \"${PBS_NODEFILE}\"), \$SLURM_NODELIST (= \"${SLURM_NODELIST}\")"
+	echo "${spt_nm}: ERROR MPI job unable to find node list"
+	echo "${spt_nm}: HINT ${spt_nm} uses first node list found in \$COBALT_NODEFILE (= \"${COBALT_NODEFILE}\"), \$PBS_NODEFILE (= \"${PBS_NODEFILE}\"), \$SLURM_NODELIST (= \"${SLURM_NODELIST}\")"
 	exit 1
     fi # !PBS
+    if [ "${sbs_flg}" = 'Yes' ]; then 
+	mpi_nbr=${var_nbr}
+    else
+	mpi_nbr=${clm_nbr}
+    fi # !sbs_flg
     if [ -n "${nd_fl}" ]; then 
-	# NB: nodes are 0-based, e.g., [0..11]
+	# NB: nodes are always 0-based, e.g., [0..11]
+	# For climo generation MPI index loops over months    and is 1-based, e.g., [1..17] (December is 12 and ANN is 17)
+	# For climo subsetting MPI index loops over variables and is 0-based, e.g., [0..5], as are input files
 	nd_idx=0
 	for nd in `cat ${nd_fl} | uniq` ; do
 	    nd_nm[${nd_idx}]=${nd}
 	    let nd_idx=${nd_idx}+1
 	done # !nd
 	nd_nbr=${#nd_nm[@]}
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	for ((mpi_idx_zro=0;mpi_idx_zro<mpi_nbr;mpi_idx_zro++)); do
+	    mpi_idx=${mpi_idx_zro}
+	    if [ "${clm_flg}" = 'Yes' ] && [ ${clm_md} = 'mth' ] ; then 
+		# Offset MPI index from 0- to 1-based for traditional monthly-based climo generation
+		let mpi_idx=${mpi_idx_zro}+1
+	    fi # !sbs_flg
 	    case "${HOSTNAME}" in 
 		# 20160502: Remove tasks-per-node limits (ntasks, npernode) so round-robin algorithm can schedule multiple jobs on same node
 		constance* | cori* | edison* | nid* | node* )
 		    # 20160502: Non-interactive batch jobs at NERSC return HOSTNAME as nid*, not cori* or edison*
 		    # 20160803: Non-interactive batch jobs at PNNL return HOSTNAME as node*, not constance*
 		    # NB: NERSC staff says srun automatically assigns to unique nodes even without "-L $node" argument?
- 		    cmd_mpi[${clm_idx}]="srun --nodelist ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} --nodes=1" ; ;; # SLURM
-# 		    cmd_mpi[${clm_idx}]="srun --nodelist ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} --nodes=1 --ntasks=1" ; ;; # SLURM
+ 		    cmd_mpi[${mpi_idx}]="srun --nodelist ${nd_nm[$((${mpi_idx_zro} % ${nd_nbr}))]} --nodes=1" ; ;; # SLURM
+# 		    cmd_mpi[${mpi_idx}]="srun --nodelist ${nd_nm[$((${mpi_idx_zro} % ${nd_nbr}))]} --nodes=1 --ntasks=1" ; ;; # SLURM
 		hopper* )
 		    # NB: NERSC migrated from aprun to srun in 201601. Hopper commands will soon be deprecated.
-		    cmd_mpi[${clm_idx}]="aprun -L ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -n 1" ; ;; # NERSC
+		    cmd_mpi[${mpi_idx}]="aprun -L ${nd_nm[$((${mpi_idx_zro} % ${nd_nbr}))]} -n 1" ; ;; # NERSC
 		* )
-		    cmd_mpi[${clm_idx}]="mpirun -H ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -n 1" ; ;; # Other (Cobalt, PBS)
-#		    cmd_mpi[${clm_idx}]="mpirun -H ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -npernode 1 -n 1" ; ;; # Other
+		    cmd_mpi[${mpi_idx}]="mpirun -H ${nd_nm[$((${mpi_idx_zro} % ${nd_nbr}))]} -n 1" ; ;; # Other (Cobalt, PBS)
+#		    cmd_mpi[${mpi_idx}]="mpirun -H ${nd_nm[$((${mpi_idx_zro} % ${nd_nbr}))]} -npernode 1 -n 1" ; ;; # Other
 	    esac # !HOSTNAME
-	done # !clm_idx
+	done # !mpi_idx_zro
 	if [ -n "${SLURM_NODELIST}" ]; then 
 	    /bin/rm -f ${nd_fl}
 	fi # !SLURM
     else # !nd_fl
 	mpi_flg='No'
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
-	    cmd_mpi[${clm_idx}]=''
-	done # !clm_idx
+	for ((mpi_idx=0;mpi_idx<=mpi_nbr;mpi_idx++)); do
+	    cmd_mpi[${mpi_idx}]=''
+	done # !mpi_idx
     fi # !nd_fl
+    if [ -z "${job_usr}" ]; then 
+	job_nbr=${nd_nbr}
+    fi # !job_usr
     if [ -z "${thr_usr}" ]; then 
 	if [ -n "${PBS_NUM_PPN}" ]; then
 #	NB: use export OMP_NUM_THREADS when thr_nbr > 8
@@ -757,11 +1024,13 @@ if [ "${mpi_flg}" = 'Yes' ]; then
 fi # !mpi
 
 # Print initial state
-if [ ${dbg_lvl} -ge 1 ]; then
+if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: bnr_flg  = ${bnr_flg}\n"
     printf "dbg: caseid   = ${caseid}\n"
     printf "dbg: cf_flg   = ${cf_flg}\n"
+    printf "dbg: clm_flg  = ${clm_flg}\n"
     printf "dbg: clm_md   = ${clm_md}\n"
+    printf "dbg: clm_nbr  = ${clm_nbr}\n"
     printf "dbg: dec_md   = ${dec_md}\n"
     printf "dbg: dbg_lvl  = ${dbg_lvl}\n"
     printf "dbg: drc_in   = ${drc_in}\n"
@@ -772,25 +1041,50 @@ if [ ${dbg_lvl} -ge 1 ]; then
     printf "dbg: drc_rgr  = ${drc_rgr}\n"
     printf "dbg: drc_spt  = ${drc_spt}\n"
     printf "dbg: drc_xtn  = ${drc_xtn}\n"
+    printf "dbg: fl_nbr   = ${fl_nbr}\n"
     printf "dbg: fml_nm   = ${fml_nm}\n"
     printf "dbg: gaa_sng  = ${gaa_sng}\n"
     printf "dbg: hdr_pad  = ${hdr_pad}\n"
     printf "dbg: hst_nm   = ${hst_nm}\n"
+    printf "dbg: inp_aut  = ${inp_aut}\n"
+    printf "dbg: inp_glb  = ${inp_glb}\n"
+    printf "dbg: inp_psn  = ${inp_psn}\n"
+    printf "dbg: inp_std  = ${inp_std}\n"
+    printf "dbg: job_nbr  = ${job_nbr}\n"
     printf "dbg: lnk_flg  = ${lnk_flg}\n"
     printf "dbg: mdl_nm   = ${mdl_nm}\n"
     printf "dbg: mdl_typ  = ${mdl_typ}\n"
     printf "dbg: mpi_flg  = ${mpi_flg}\n"
+    printf "dbg: mpi_nbr  = ${mpi_nbr}\n"
     printf "dbg: nco_opt  = ${nco_opt}\n"
     printf "dbg: ncr_flg  = ${ncr_flg}\n"
     printf "dbg: nd_nbr   = ${nd_nbr}\n"
+    printf "dbg: out_nm   = ${out_nm}\n"
     printf "dbg: par_typ  = ${par_typ}\n"
     printf "dbg: rgr_map  = ${rgr_map}\n"
     printf "dbg: rgr_sfx  = ${rgr_sfx}\n"
+    printf "dbg: sbs_flg  = ${sbs_flg}\n"
     printf "dbg: thr_nbr  = ${thr_nbr}\n"
     printf "dbg: var_lst  = ${var_lst}\n"
     printf "dbg: xtn_flg  = ${xtn_flg}\n"
+    printf "dbg: ypf_max  = ${ypf_max}\n"
+    printf "dbg: yr_sbs   = ${yr_sbs}\n"
     printf "dbg: yyyy_end = ${yyyy_end}\n"
     printf "dbg: yyyy_srt = ${yyyy_srt}\n"
+    if [ "${sbs_flg}" = 'Yes' ]; then
+	printf "dbg: Will split into files for ${var_nbr} variables:\n"
+	for ((var_idx=0;var_idx<${var_nbr};var_idx++)); do
+	    printf "${var_sbs[${var_idx}]}\n"
+	done # !var_idx
+	printf "dbg: Will split timeseries into ${sgm_nbr} segments:\n"
+	for ((sgm_idx=0;sgm_idx<${sgm_nbr};sgm_idx++)); do
+	    printf "Segment ${sgm_idx} months: ${yyyy_srt_sgm[${sgm_idx}]}01--${yyyy_end_sgm[${sgm_idx}]}12\n"
+	done # !sgm_idx
+	printf "dbg: Will split ${fl_nbr} files into ${sgm_nbr} segments:\n"
+	for ((sgm_idx=0;sgm_idx<${sgm_nbr};sgm_idx++)); do
+	    printf "${fl_sgm[${sgm_idx}]}\n"
+	done # !sgm_idx
+    fi # !sbs
 fi # !dbg
 if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: yyyy_srt   = ${yyyy_srt}\n"
@@ -803,100 +1097,149 @@ if [ ${dbg_lvl} -ge 2 ]; then
 	done # !nd
     fi # !mpi
 fi # !dbg
+if [ ${dbg_lvl} -ge 2 ]; then
+    psn_nbr=$#
+    printf "dbg: Found ${psn_nbr} positional parameters (besides \$0):\n"
+    for ((psn_idx=1;psn_idx<=psn_nbr;psn_idx++)); do
+	printf "dbg: psn_arg[${psn_idx}] = ${!psn_idx}\n"
+    done # !psn_idx
+fi # !dbg
 
 # Create output directory
-if [ -n "${drc_out}" ]; then 
+if [ -n "${drc_out}" ] && [ ! -d "${drc_out}" ]; then 
     mkdir -p ${drc_out}
 fi # !drc_out
-if [ -n "${drc_rgr}" ]; then 
+if [ -n "${drc_rgr}" ] && [ ! -d "${drc_rgr}" ]; then 
     mkdir -p ${drc_rgr}
 fi # !drc_rgr
 
 # Human-readable summary
 date_srt=$(date +"%s")
 if [ ${dbg_lvl} -ge 0 ]; then
-    printf "Climatology generation invoked with command:\n"
+    printf "Climatology operations invoked with command:\n"
     echo "${cmd_ln}"
 fi # !dbg
-printf "Started climatology generation for dataset ${caseid} at `date`.\n"
+if [ -n "${caseid}" ]; then
+    printf "Started climatology generation for dataset ${caseid} at `date`\n"
+else
+    printf "Started climatology splitting at `date`\n"
+fi # !caseid
 printf "Running climatology script ${spt_nm} from directory ${drc_spt}\n"
 printf "NCO binaries version ${nco_vrs} from directory ${drc_nco}\n"
-if [ "${xtn_flg}" = 'No' ]; then
-    printf "Producing standard climatology from raw input files in directory ${drc_in}\n"
+if [ "${sbs_flg}" = 'Yes' ]; then
+    if [ ${inp_std} = 'No' ]; then 
+	if [ "${drc_in_usr_flg}" = 'Yes' ]; then
+	    printf "Splitting climatology from ${fl_nbr} raw input files in directory ${drc_in}\n"
+	else # !drc_in
+	    printf "Splitting climatology from ${fl_nbr} raw input files specified as positional arguments\n"
+	fi # !drc_in
+    else
+	printf "Splitting climatology from list of ${fl_nbr} raw input files piped to stdin\n"
+    fi # !stdin
+    if [ ${clm_md} = 'ann' ]; then 
+	printf "Each input file assumed to contain mean of one year\n"
+    elif [ ${clm_md} = 'dly' ]; then 
+	printf "Each input file assumed to contain mean of one day\n"
+    elif [ ${clm_md} = 'mth' ]; then 
+	printf "Each input file assumed to contain mean of one month\n"
+    fi # !mth
+    printf "Input to split comprises ${yr_sbs} years of contiguous raw data touching ${yr_cln} calendar years from YYYYMM = ${yyyy_clm_srt_dec}${mm_ann_srt} to ${yyyy_end}${mm_ann_end}\n"
+    if [ ${sgm_nbr} -gt 1 ]; then
+	if [ ${sgm_flg} = 'Yes' ]; then 
+	    printf "Will split data into ${sgm_nbrm1} segment(s) of length ${ypf_max} years and 1 segment of length ${sgm_rmd} year(s)\n"
+	else
+	    printf "Will split data into ${sgm_nbr} segment(s) of length ${ypf_max} years\n"
+	fi # !sgm_flg
+    else # !sgm_nbr
+	printf "Will place all output into one segment of length ${yr_sbs} years\n"
+    fi # !sgm_nbr
     printf "Output files to directory ${drc_out}\n"
-fi # !xtn_flg
-if [ "${bnr_flg}" = 'Yes' ]; then
-    printf "Producing extended climatology in binary mode: Will combine pre-computed climatology in directory ${drc_prv} with pre-computed climatology in directory ${drc_in}\n"
-    printf "Output files to directory ${drc_xtn}\n"
-fi # !bnr_flg
-if [ "${ncr_flg}" = 'Yes' ]; then
-    printf "Producing extended climatology in incremental mode: Pre-computed climatology in directory ${drc_prv} will be incremented by raw input files in directory ${drc_in}\n"
-    printf "Output files to directory ${drc_xtn}\n"
-fi # !ncr_flg
-#printf "Intermediate/temporary files written to directory ${drc_tmp}\n"
-if [ "${bnr_flg}" = 'No' ]; then
-    printf "Climatology from ${yr_nbr} years of contiguous raw data touching ${yr_cln} calendar years from YYYYMM = ${yyyy_clm_srt_dec}${mm_ann_srt} to ${yyyy_end}${mm_ann_end}.\n"
-fi # !bnr_flg
-if [ "${mdl_typ}" = 'yyyymm' ]; then
-    printf "Filenames will be constructed with generic conventions as ${bs_nm}_YYYYMM.${bs_sfx}\n"
-else # !mdl_typ
-    printf "Filenames will be constructed with CESM'ish or ACME'ish conventions.\n"
-fi # !mdl_typ
-if [ ${clm_md} = 'ann' ]; then 
-    printf "Each input file assumed to contain mean of one year.\n"
-elif [ ${clm_md} = 'mth' ]; then 
-    printf "Each input file assumed to contain mean of one month.\n"
-fi # !mth
-if [ ${clm_md} = 'mth' ]; then 
-    if [ ${dec_md} = 'scd' ]; then 
-	printf "Winter statistics based on seasonally contiguous December (scd-mode): DJF sequences are consecutive months that cross calendar-year boundaries.\n"
+    if [ -n "${rgr_map}" ]; then 
+	printf "Split files will also be regridded\n"
     else
-	printf "Winter statistics based on seasonally discontiguous December (sdd-mode): DJF sequences comprise three months from the same calendar year.\n"
-    fi # !scd
-fi # !mth
-if [ ${cf_flg} = 'Yes' ]; then 
-    printf "Annotation for CF climatology attribute and climatology_bounds variable will be performed.\n"
-else
-    printf "Annotation for CF climatology attribute and climatology_bounds variable will not be performed.\n"
-fi # !cf
-if [ -n "${rgr_map}" ]; then 
-    printf "This climatology will be regridded.\n"
-else
-    printf "This climatology will not be regridded.\n"
-fi # !rgr
+	printf "Split files will not be regridded\n"
+    fi # !rgr
+fi # !sbs_flg
+if [ "${clm_flg}" = 'Yes' ]; then
+    if [ "${xtn_flg}" = 'No' ]; then
+	printf "Producing standard climatology from raw input files in directory ${drc_in}\n"
+	printf "Output files to directory ${drc_out}\n"
+    fi # !xtn_flg
+    if [ "${bnr_flg}" = 'Yes' ]; then
+	printf "Producing extended climatology in binary mode: Will combine pre-computed climatology in directory ${drc_prv} with pre-computed climatology in directory ${drc_in}\n"
+	printf "Output files to directory ${drc_xtn}\n"
+    fi # !bnr_flg
+    if [ "${ncr_flg}" = 'Yes' ]; then
+	printf "Producing extended climatology in incremental mode: Pre-computed climatology in directory ${drc_prv} will be incremented by raw input files in directory ${drc_in}\n"
+	printf "Output files to directory ${drc_xtn}\n"
+    fi # !ncr_flg
+    #printf "Intermediate/temporary files written to directory ${drc_tmp}\n"
+    if [ "${bnr_flg}" = 'No' ]; then
+	printf "Climatology from ${yr_nbr} years of contiguous raw data touching ${yr_cln} calendar years from YYYYMM = ${yyyy_clm_srt_dec}${mm_ann_srt} to ${yyyy_end}${mm_ann_end}\n"
+    fi # !bnr_flg
+    if [ "${mdl_typ}" = 'yyyymm' ]; then
+	printf "Filenames will be constructed with generic conventions as ${bs_nm}_YYYYMM.${bs_sfx}\n"
+    else # !mdl_typ
+	printf "Filenames will be constructed with CESM'ish or ACME'ish conventions\n"
+    fi # !mdl_typ
+    if [ ${clm_md} = 'ann' ]; then 
+	printf "Each input file assumed to contain mean of one year\n"
+    elif [ ${clm_md} = 'dly' ]; then 
+	printf "Each input file assumed to contain mean of one day\n"
+    elif [ ${clm_md} = 'mth' ]; then 
+	printf "Each input file assumed to contain mean of one month\n"
+    fi # !mth
+    if [ ${clm_md} = 'mth' ]; then 
+	if [ ${dec_md} = 'scd' ]; then 
+	    printf "Winter statistics based on seasonally contiguous December (scd-mode): DJF sequences are consecutive and cross calendar-year boundaries\n"
+	else
+	    printf "Winter statistics based on seasonally discontiguous December (sdd-mode): DJF sequences comprise three months from the same calendar year\n"
+	fi # !scd
+    fi # !mth
+    if [ ${cf_flg} = 'Yes' ]; then 
+	printf "Annotation for CF climatology attribute and climatology_bounds variable will be performed\n"
+    else
+	printf "Annotation for CF climatology attribute and climatology_bounds variable will not be performed\n"
+    fi # !cf
+    if [ -n "${rgr_map}" ]; then 
+	printf "This climatology will also be regridded\n"
+    else
+	printf "This climatology will not be regridded\n"
+    fi # !rgr
+fi # !clm_flg
 
 # Block 1: Generate, check, and store (but do not yet execute) commands
 
 # Block 1 Loop 1: Climatologies based on monthly means
-if [ "${clm_md}" = 'mth' ]; then
+if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ]; then
     clm_idx=0
     for mth in {01..12}; do
 	let clm_idx=${clm_idx}+1
 	MM=`printf "%02d" ${clm_idx}`
-	yr_fl=''
+	fl_all=''
 	for yr in `seq ${yyyy_srt} ${yyyy_end}`; do
 	    YYYY=`printf "%04d" ${yr}`
 	    if [ ${mdl_typ} = 'cesm' ]; then
-		yr_fl="${yr_fl} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${MM}.nc"
+		fl_all="${fl_all} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${MM}.nc"
 	    elif [ ${mdl_typ} = 'mpas' ]; then # Use MPAS not CESM conventions
 		# 20161130: Old MPAS rule until today
-		# yr_fl="${yr_fl} ${caseid}.${mdl_nm}.${YYYY}-${MM}-01_00.00.00.nc"
+		# fl_all="${fl_all} ${caseid}.${mdl_nm}.${YYYY}-${MM}-01_00.00.00.nc"
 		# Example file: /scratch2/scratchdirs/golaz/ACME_simulations/20161117.beta0.A_WCYCL1850S.ne30_oEC_ICG.edison/run/mpascice.hist.am.timeSeriesStatsMonthly.0001-02-01.nc
- 		yr_fl="${yr_fl} ${mdl_nm}.hist.am.timeSeriesStatsMonthly.${YYYY}-${MM}-01.nc"
+ 		fl_all="${fl_all} ${mdl_nm}.hist.am.timeSeriesStatsMonthly.${YYYY}-${MM}-01.nc"
 	    elif [ ${mdl_typ} = 'yyyymm' ]; then # Generate from caseid + YYYYMM
-		yr_fl="${yr_fl} ${bs_nm}_${YYYY}${MM}.${bs_sfx}"
+		fl_all="${fl_all} ${bs_nm}_${YYYY}${MM}.${bs_sfx}"
 	    fi # !cesm
 	done # !yr
 	if [ ${dec_md} = 'scd' ] && [ ${MM} = '12' ]; then 
-	    yr_fl=''
+	    fl_all=''
 	    for yr in `seq ${yr_srtm1} ${yr_endm1}`; do
 		YYYY=`printf "%04d" ${yr}`
 		if [ ${mdl_typ} = 'cesm' ]; then
-		    yr_fl="${yr_fl} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${MM}.nc"
+		    fl_all="${fl_all} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${MM}.nc"
 		elif [ ${mdl_typ} = 'mpas' ]; then # Use MPAS not CESM conventions
- 		    yr_fl="${yr_fl} ${mdl_nm}.hist.am.timeSeriesStatsMonthly.${YYYY}-${MM}-01.nc"
+ 		    fl_all="${fl_all} ${mdl_nm}.hist.am.timeSeriesStatsMonthly.${YYYY}-${MM}-01.nc"
 		elif [ ${mdl_typ} = 'yyyymm' ]; then # Generate from caseid + YYYYMM
-		    yr_fl="${yr_fl} ${bs_nm}_${YYYY}${MM}.${bs_sfx}"
+		    fl_all="${fl_all} ${bs_nm}_${YYYY}${MM}.${bs_sfx}"
 		fi # !cesm
 	    done # !yr
 	    yyyy_clm_srt=${yyyy_clm_srt_dec}
@@ -904,19 +1247,19 @@ if [ "${clm_md}" = 'mth' ]; then
 	fi # !scd
 	# Check for existence of raw input only when file will be used
 	if [ "${bnr_flg}" = 'No' ]; then
-	    for fl_in in ${yr_fl} ; do
-		if [ ! -f "${drc_in}/${fl_in}" ]; then
-		    echo "ERROR: Unable to find required input file ${drc_in}/${fl_in}"
-		    echo "HINT: All files implied to exist by the climatology bounds (start/end year/month) must be in ${drc_in} before ${spt_nm} will proceed"
+	    for fl_crr in ${fl_all} ; do
+		if [ ! -f "${drc_in}/${fl_crr}" ]; then
+		    echo "${spt_nm}: ERROR Unable to find required input file ${drc_in}/${fl_crr}"
+		    echo "${spt_nm}: HINT All files implied to exist by the climatology bounds (start/end year/month) must be in ${drc_in} before ${spt_nm} will proceed"
 		    exit 1
 		fi # ! -f
-	    done # !fl_in
+	    done # !fl_crr
 	else # !bnr_flg
 	    # In binary mode drc_out is actually used to locate input files from climatology B (same as output files in incremental mode)
 	    drc_out="${drc_in}"
 	fi # !bnr_flg
 	fl_out[${clm_idx}]="${drc_out}/${out_nm}_${MM}_${yyyy_clm_srt}${MM}_${yyyy_clm_end}${MM}_climo.nc"
-	cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --cb -O ${nco_opt} -p ${drc_in} ${yr_fl} ${fl_out[${clm_idx}]}"
+	cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra --cb -O ${nco_opt} ${gaa_sng} -p ${drc_in} ${fl_all} ${fl_out[${clm_idx}]}"
     done # !mth
 
     # Monthly output filenames constructed above; specify remaining (seasonal, annual) output names
@@ -926,7 +1269,7 @@ if [ "${clm_md}" = 'mth' ]; then
     fl_out[16]="${drc_out}/${out_nm}_DJF_${yyyy_clm_srt_dec}${mm_djf_srt}_${yyyy_end}${mm_djf_end}_climo.nc"
     fl_out[17]="${drc_out}/${out_nm}_ANN_${yyyy_clm_srt_dec}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
     # Derive all seventeen regridded and AMWG names from output names
-    for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+    for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 	fl_amwg[${clm_idx}]=`expr match "${fl_out[${clm_idx}]}" '\(.*\)_.*_.*_climo.nc'` # Prune _YYYYYMM_YYYYMM_climo.nc
 	fl_amwg[${clm_idx}]="${fl_amwg[${clm_idx}]}_climo.nc" # Replace with _climo.nc
 	fl_amwg[${clm_idx}]="${fl_amwg[${clm_idx}]/${drc_out}\//}" # Delete prepended path to ease symlinking
@@ -953,29 +1296,232 @@ if [ "${clm_md}" = 'mth' ]; then
     done # !clm_idx
 fi # !clm_md
 
+# Block 1 Loop N: Split
+if [ "${sbs_flg}" = 'Yes' ]; then
+	
+    case ${mdl_nm} in
+	# CAM-SE contains area (though does not contain lat,lon until regridded)
+	cam* ) var_lst_xtn=',area' ;;
+    esac # !mdl_nm
+
+    for ((sgm_idx=0;sgm_idx<sgm_nbr;sgm_idx++)); do
+	fl_sgm[${sgm_idx}]=''
+
+	let fl_idx_srt=${sgm_idx}*${ypf_max}*${fpy}
+	let fl_idx_end=${fl_idx_srt}+${ypf_max}*${fpy}
+	let yr_srt_sgm=${yr_srt_rth}+${sgm_idx}*${ypf_max}
+	let yr_end_sgm=${yr_srt_sgm}+${ypf_max}-1
+	if [ ${sgm_rmd} -ne 0 ]; then
+	    let fl_idx_end=${fl_idx_srt}+${sgm_rmd}*${fpy}
+	    let yr_end_sgm=${yr_srt_sgm}+${sgm_rmd}-1
+	fi # !sgm_rmd
+	for ((fl_idx=fl_idx_srt;fl_idx<fl_idx_end;fl_idx++)); do
+	    fl_sgm[${sgm_idx}]="${fl_sgm[${sgm_idx}]} ${fl_in[${fl_idx}]}"
+	    yyyy_srt_sgm[${sgm_idx}]=`printf "%04d" ${yr_srt_sgm}`
+	    yyyy_end_sgm[${sgm_idx}]=`printf "%04d" ${yr_end_sgm}`
+	done # !fl_idx
+	#printf "dbg: fxm fl_sgm[${sgm_idx}]=${fl_sgm[${sgm_idx}]}\n"
+
+	for fl_crr in ${fl_sgm[${sgm_idx}]} ; do
+	    if [ ! -f "${fl_crr}" ]; then
+		echo "${spt_nm}: ERROR Unable to find required input file ${fl_crr}"
+		echo "${spt_nm}: HINT All files implied to exist by the climatology bounds (start/end year/month) must be in ${drc_in} before ${spt_nm} will proceed"
+		exit 1
+	    fi # ! -f
+	done # !fl_crr
+
+    done # !sgm_idx
+
+    # Create template output filenames (to avoid Bash 2D string arrays)
+    for ((sgm_idx=0;sgm_idx<sgm_nbr;sgm_idx++)); do
+	if [ -z "${fml_nm_usr}" ]; then 
+	    fl_out_tpl[${sgm_idx}]="${drc_out}/var_nm_tpl_${yyyy_srt_sgm[${sgm_idx}]}01_${yyyy_end_sgm[${sgm_idx}]}12.nc"
+	else # !fml_nm_usr
+	    fl_out_tpl[${sgm_idx}]="${drc_out}/var_nm_tpl_${fml_nm}_${yyyy_srt_sgm[${sgm_idx}]}01_${yyyy_end_sgm[${sgm_idx}]}12.nc"
+	fi # !fml_nm_usr
+	if [ -n "${rgr_map}" ]; then
+	    fl_rgr_tpl[${sgm_idx}]="${fl_out_tpl[${sgm_idx}]/${drc_out}/${drc_rgr}}"
+	    if [ "${drc_out}" = "${drc_rgr}" ]; then 
+		# Append geometry suffix to regridded files in same directory as native climo
+		# http://tldp.org/LDP/abs/html/string-manipulation.html
+		dfl_sfx='rgr'
+		rgr_sfx=`expr match "${rgr_map}" '.*_to_\(.*\).nc'`
+		if [ "${#rgr_sfx}" -eq 0 ]; then
+		    printf "${spt_nm}: WARNING Unable to extract geometric suffix from mapfile, will suffix regridded files with \"${dfl_sfx}\" instead\n"
+		    rgr_sfx=${dfl_sfx}
+		else
+		    yyyymmdd_sng=`expr match "${rgr_sfx}" '.*\(\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)'` # Find YYYYYMMDD
+		    if [ "${#yyyymmdd_sng}" -ne 0 ]; then
+			rgr_sfx=${rgr_sfx%%${yyyymmdd_sng}} # Delete YYYYYMMDD
+		    fi # !strlen
+		fi # !strlen
+		#    rgr_sfx=`expr match "${rgr_sfx}" '\(.*\)\.[0-9][0-9][0-9][0-9][0-9][0-9]'` # 
+		fl_rgr_tpl[${sgm_idx}]="${fl_rgr_tpl[${sgm_idx}]/.nc/_${rgr_sfx}.nc}"
+	    fi # !drc_rgr
+	fi # !rgr_map
+    done # !sgm_idx
+
+    # Begin outer loop over time segments
+    for ((sgm_idx=0;sgm_idx<sgm_nbr;sgm_idx++)); do
+
+	# Begin loop over variables to split
+	idx_srt=0
+	let idx_end=$((job_nbr-1))
+	for ((var_idx=0;var_idx<var_nbr;var_idx++)); do
+	    fl_out[${var_idx}]="${fl_out_tpl[${sgm_idx}]/var_nm_tpl/${var_sbs[${var_idx}]}}"
+	    cmd_sbs[${var_idx}]="${cmd_mpi[${var_idx}]} ncrcat -O -v ${var_sbs[${var_idx}]}${var_lst_xtn} ${nco_opt} ${gaa_sng} ${fl_sgm[${sgm_idx}]} ${fl_out[${var_idx}]}"
+	    if [ ${dbg_lvl} -ge 1 ]; then
+		echo ${cmd_sbs[${var_idx}]}
+	    fi # !dbg
+	    if [ ${dbg_lvl} -le 1 ]; then
+		if [ -z "${par_opt}" ]; then
+		    eval ${cmd_sbs[${var_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR subset cmd_sbs[${var_idx}] failed. Debug this:\n${cmd_sbs[${var_idx}]}\n"
+			exit 1
+		    fi # !err
+		else # !par_opt
+		    eval ${cmd_sbs[${var_idx}]} ${par_opt}
+		    sbs_pid[${var_idx}]=$!
+		fi # !par_opt
+	    fi # !dbg
+	    
+	    # Block NNN: Wait
+	    # Parallel splitting (both Background and MPI) spawns simultaneous processes in batches of ${job_nbr}
+	    # Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
+	    if [ -n "${par_opt}" ]; then
+		let bch_idx=$((var_idx / job_nbr))
+		let bch_flg=$(((var_idx+1) % job_nbr))
+		#printf "${spt_nm}: var_idx = ${var_idx}, bch_idx = ${bch_idx}, bch_flg = ${bch_flg}\n"
+		if [ ${bch_flg} -eq 0 ]; then
+		    if [ ${dbg_lvl} -ge 1 ]; then
+			printf "${spt_nm}: Waiting for batch ${bch_idx} to finish at var_idx = ${var_idx}...\n"
+		    fi # !dbg
+		    for ((pid_idx=${idx_srt};pid_idx<=${idx_end};pid_idx++)); do
+			wait ${sbs_pid[${pid_idx}]}
+			if [ $? -ne 0 ]; then
+			    printf "${spt_nm}: ERROR Failed to split. cmd_sbs[${pid_idx}] failed. Debug this:\n${cmd_sbs[${pid_idx}]}\n"
+			    exit 1
+			fi # !err
+		    done # !pid_idx
+		    let idx_srt=$((idx_srt + job_nbr))
+		    let idx_end=$((idx_end + job_nbr))
+		fi # !bch_flg
+	    fi # !par_typ
+	    
+	done # !var_idx
+	
+	# Parallel mode might exit loop after a partial batch, wait() for remaining jobs to finish
+	if [ -n "${par_opt}" ]; then
+	    let bch_flg=$((var_nbr % job_nbr))
+	    if [ ${bch_flg} -ne 0 ]; then
+		let bch_idx=$((bch_idx+1))
+		printf "${spt_nm}: Waiting for (partial) batch ${bch_idx} to finish...\n"
+		for ((pid_idx=${idx_srt};pid_idx<${var_nbr};pid_idx++)); do
+		    wait ${sbs_pid[${pid_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR Failed to split. cmd_sbs[${pid_idx}] failed. Debug this:\n${cmd_sbs[${pid_idx}]}\n"
+			exit 1
+		    fi # !err
+		done # !pid_idx
+	    fi # !bch_flg
+	fi # !par_typ
+	
+	# Begin loop over variables to regrid
+	if [ -n "${rgr_map}" ]; then 
+	    idx_srt=0
+	    let idx_end=$((job_nbr-1))
+	    for ((var_idx=0;var_idx<var_nbr;var_idx++)); do
+		fl_rgr[${var_idx}]="${fl_rgr_tpl[${sgm_idx}]/var_nm_tpl/${var_sbs[${var_idx}]}}"
+		cmd_rgr[${var_idx}]="${cmd_mpi[${var_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${var_idx}]} ${fl_rgr[${var_idx}]}"
+		if [ "${mdl_typ}" = 'mpas' ]; then
+		    cmd_rgr[${var_idx}]="${cmd_mpi[${var_idx}]} ncremap -C -u .pid${spt_pid}.split.${var_idx}.tmp -P mpas -t ${thr_nbr} -m ${rgr_map} -i ${fl_out[${var_idx}]} -o ${fl_rgr[${var_idx}]}"
+		fi # !mdl_typ
+		if [ ${dbg_lvl} -ge 1 ]; then
+		    echo ${cmd_rgr[${var_idx}]}
+		fi # !dbg
+		if [ ${dbg_lvl} -le 1 ]; then
+		    if [ -z "${par_opt}" ]; then
+			eval ${cmd_rgr[${var_idx}]}
+			if [ $? -ne 0 ]; then
+			    printf "${spt_nm}: ERROR regrid cmd_rgr[${var_idx}] failed. Debug this:\n${cmd_rgr[${var_idx}]}\n"
+			    exit 1
+			fi # !err
+		    else # !par_opt
+			eval ${cmd_rgr[${var_idx}]} ${par_opt}
+			rgr_pid[${var_idx}]=$!
+		    fi # !par_opt
+		fi # !dbg
+		
+		# Block NNN: Wait
+		# Parallel regridding (both Background and MPI) spawns simultaneous processes in batches of ${job_nbr}
+		# Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
+		if [ -n "${par_opt}" ]; then
+		    let bch_idx=$((var_idx / job_nbr))
+		    let bch_flg=$(((var_idx+1) % job_nbr))
+		    #printf "${spt_nm}: var_idx = ${var_idx}, bch_idx = ${bch_idx}, bch_flg = ${bch_flg}\n"
+		    if [ ${bch_flg} -eq 0 ]; then
+			if [ ${dbg_lvl} -ge 1 ]; then
+			    printf "${spt_nm}: Waiting for batch ${bch_idx} to finish at var_idx = ${var_idx}...\n"
+			fi # !dbg
+			for ((pid_idx=${idx_srt};pid_idx<=${idx_end};pid_idx++)); do
+			    wait ${rgr_pid[${pid_idx}]}
+			    if [ $? -ne 0 ]; then
+				printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+				exit 1
+			    fi # !err
+			done # !pid_idx
+			let idx_srt=$((idx_srt + job_nbr))
+			let idx_end=$((idx_end + job_nbr))
+		    fi # !bch_flg
+		fi # !par_typ
+		
+	    done # !var_idx
+	    
+	    # Parallel mode might exit loop after a partial batch, wait() for remaining jobs to finish
+	    if [ -n "${par_opt}" ]; then
+		let bch_flg=$((var_nbr % job_nbr))
+		if [ ${bch_flg} -ne 0 ]; then
+		    let bch_idx=$((bch_idx+1))
+		    printf "${spt_nm}: Waiting for (partial) batch ${bch_idx} to finish...\n"
+		    for ((pid_idx=${idx_srt};pid_idx<${var_nbr};pid_idx++)); do
+			wait ${rgr_pid[${pid_idx}]}
+			if [ $? -ne 0 ]; then
+			    printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+			    exit 1
+			fi # !err
+		    done # !pid_idx
+		fi # !bch_flg
+	    fi # !par_typ
+	fi # !rgr_map
+	
+    done # !sgm_idx
+    
+fi # !sbs_flg
+
 # Block 1 Loop 2: Climatologies based on annual means
-if [ "${clm_md}" = 'ann' ]; then
+if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'ann' ]; then
     clm_idx=1
-    yr_fl=''
+    fl_all=''
     for yr in `seq ${yyyy_srt} ${yyyy_end}`; do
 	YYYY=`printf "%04d" ${yr}`
-	yr_fl="${yr_fl} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${ann_sfx}.nc"
+	fl_all="${fl_all} ${caseid}.${mdl_nm}.${hst_nm}.${YYYY}-${ann_sfx}.nc"
     done # !yr
     # Check for existence of raw input only when file will be used (NB: next ~12 lines duplicate monthly code)
     if [ "${bnr_flg}" = 'No' ]; then
-	for fl_in in ${yr_fl} ; do
-	    if [ ! -e "${drc_in}/${fl_in}" ]; then
-		echo "ERROR: Unable to find required input file ${drc_in}/${fl_in}"
-		echo "HINT: All files implied to exist by the climatology bounds (start/end year) must be in ${drc_in} before ${spt_nm} will proceed"
+	for fl_crr in ${fl_all} ; do
+	    if [ ! -e "${drc_in}/${fl_crr}" ]; then
+		echo "${spt_nm}: ERROR Unable to find required input file ${drc_in}/${fl_crr}"
+		echo "${spt_nm}: HINT All files implied to exist by the climatology bounds (start/end year) must be in ${drc_in} before ${spt_nm} will proceed"
 		exit 1
 	    fi # ! -e
-	done # !fl_in
+	done # !fl_crr
     else # !bnr_flg
 	# In binary mode drc_out is actually used to locate input files from climatology B (same as output files in incremental mode)
 	drc_out="${drc_in}"
     fi # !bnr_flg
     fl_out[${clm_idx}]="${drc_out}/${out_nm}_ANN_${yyyy_srt}01_${yyyy_end}12_climo.nc"
-    cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} -p ${drc_in} ${yr_fl} ${fl_out[${clm_idx}]} ${par_opt}"
+    cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -p ${drc_in} ${fl_all} ${fl_out[${clm_idx}]} ${par_opt}"
 
     # Block 1 Loop 2: Climatological annual mean
     printf "Climatological annual mean...\n"
@@ -1009,10 +1555,195 @@ if [ "${clm_md}" = 'ann' ]; then
 	printf "Done with regridding\n"
     fi # !rgr_map
     
-fi # !clm_md
+fi # !ann
+
+# Block 1 Loop 2: Climatologies based on daily means
+if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'dly' ]; then
+
+    fl_all=''
+    for ((fl_idx=0;fl_idx<fl_nbr;fl_idx++)); do
+	fl_all="${fl_all} ${fl_in[${fl_idx}]}"
+    done # !fl
+
+    unset dpm # Days per month
+    declare -a dpm
+    dpm=(0 31 28 31 30 31 30 31 31 30 31 30 31) # 365-day calendar, 1-based indexing
+    let srd=${dpy}*${tpd_out}
+    drn=${tpd_out}
+    
+    # fxm stormy
+    yyyy_srt=`printf "%04d" ${yr_srt}`
+    yyyy_end=`printf "%04d" ${yr_end}`
+    clm_idx=0
+    for mth in `seq 1 12`; do
+	MM=`printf "%02d" ${mth}`
+	for day in `seq 1 ${dpm[${mth}]}`; do
+	    DD=`printf "%02d" ${day}`
+	    fl_out[${clm_idx}]="${drc_out}/${out_nm}_${yyyy_srt}${MM}${DD}_${yyyy_end}${MM}${DD}_climo.nc"
+	    fl_rgr[${clm_idx}]="${fl_out[${clm_idx}]/${drc_out}/${drc_rgr}}"
+	    tm_srt="${yyyy_srt}-${MM}-${DD} 00:00:00"
+	    tm_end="${yyyy_end}-${MM}-${DD} 23:59:59"
+	    cmd_clm[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncra -O ${nco_opt} ${gaa_sng} -d time,'${tm_srt}','${tm_end}',${srd},${drn} ${fl_all} -p ${drc_in} ${fl_out[${clm_idx}]}"
+	    let clm_idx=${clm_idx}+1
+	done # !day
+    done # !mth
+
+    if [ -n "${rgr_map}" ]; then
+	for ((clm_idx=0;clm_idx<clm_nbr;clm_idx++)); do
+	    fl_rgr[${clm_idx}]="${fl_out[${clm_idx}]/${drc_out}/${drc_rgr}}"
+	    if [ "${drc_out}" = "${drc_rgr}" ]; then 
+		# Append geometry suffix to regridded files in same directory as native climo
+		# http://tldp.org/LDP/abs/html/string-manipulation.html
+		dfl_sfx='rgr'
+		rgr_sfx=`expr match "${rgr_map}" '.*_to_\(.*\).nc'`
+		if [ "${#rgr_sfx}" -eq 0 ]; then
+		    printf "${spt_nm}: WARNING Unable to extract geometric suffix from mapfile, will suffix regridded files with \"${dfl_sfx}\" instead\n"
+		    rgr_sfx=${dfl_sfx}
+		else
+		    yyyymmdd_sng=`expr match "${rgr_sfx}" '.*\(\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)'` # Find YYYYYMMDD
+		    if [ "${#yyyymmdd_sng}" -ne 0 ]; then
+			rgr_sfx=${rgr_sfx%%${yyyymmdd_sng}} # Delete YYYYYMMDD
+		    fi # !strlen
+		fi # !strlen
+		#    rgr_sfx=`expr match "${rgr_sfx}" '\(.*\)\.[0-9][0-9][0-9][0-9][0-9][0-9]'` # 
+		fl_rgr[${clm_idx}]="${fl_rgr[${clm_idx}]/.nc/_${rgr_sfx}.nc}"
+	    fi # !drc_rgr
+	done # !clm_idx
+    fi # !rgr_map
+    
+    # Begin loop over days to climatologize
+    printf "Climatological daily mean...\n"
+    idx_srt=0
+    let idx_end=$((job_nbr-1))
+    for ((clm_idx=0;clm_idx<clm_nbr;clm_idx++)); do
+	if [ ${dbg_lvl} -ge 1 ]; then
+	    echo ${cmd_clm[${clm_idx}]}
+	fi # !dbg
+	if [ ${dbg_lvl} -le 1 ]; then
+	    if [ -z "${par_opt}" ]; then
+		eval ${cmd_clm[${clm_idx}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR daily cmd_clm[${clm_idx}] failed. Debug this:\n${cmd_clm[${clm_idx}]}\n"
+		    exit 1
+		fi # !err
+	    else # !par_opt
+		eval ${cmd_clm[${clm_idx}]} ${par_opt}
+		clm_pid[${clm_idx}]=$!
+	    fi # !par_opt
+	fi # !dbg
+	
+	# Block NNN: Wait
+	# Parallel splitting (both Background and MPI) spawns simultaneous processes in batches of ${job_nbr}
+	# Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
+	if [ -n "${par_opt}" ]; then
+	    let bch_idx=$((clm_idx / job_nbr))
+	    let bch_flg=$(((clm_idx+1) % job_nbr))
+	    #printf "${spt_nm}: clm_idx = ${clm_idx}, bch_idx = ${bch_idx}, bch_flg = ${bch_flg}\n"
+	    if [ ${bch_flg} -eq 0 ]; then
+		if [ ${dbg_lvl} -ge 1 ]; then
+		    printf "${spt_nm}: Waiting for batch ${bch_idx} to finish at clm_idx = ${clm_idx}...\n"
+		fi # !dbg
+		for ((pid_idx=${idx_srt};pid_idx<=${idx_end};pid_idx++)); do
+		    wait ${clm_pid[${pid_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR Failed daily average. cmd_clm[${pid_idx}] failed. Debug this:\n${cmd_clm[${pid_idx}]}\n"
+			exit 1
+		    fi # !err
+		done # !pid_idx
+		let idx_srt=$((idx_srt + job_nbr))
+		let idx_end=$((idx_end + job_nbr))
+	    fi # !bch_flg
+	fi # !par_typ
+
+    done # !clm_idx
+    
+    # Parallel mode might exit loop after a partial batch, wait() for remaining jobs to finish
+    if [ -n "${par_opt}" ]; then
+	let bch_flg=$((clm_nbr % job_nbr))
+	if [ ${bch_flg} -ne 0 ]; then
+	    let bch_idx=$((bch_idx+1))
+	    printf "${spt_nm}: Waiting for (partial) batch ${bch_idx} to finish...\n"
+	    for ((pid_idx=${idx_srt};pid_idx<${clm_nbr};pid_idx++)); do
+		wait ${clm_pid[${pid_idx}]}
+		if [ $? -ne 0 ]; then
+		    printf "${spt_nm}: ERROR Failed daily average. cmd_clm[${pid_idx}] failed. Debug this:\n${cmd_clm[${pid_idx}]}\n"
+		    exit 1
+		fi # !err
+	    done # !pid_idx
+	fi # !bch_flg
+    fi # !par_typ
+
+    # Begin loop over days to regrid
+    if [ -n "${rgr_map}" ]; then 
+	idx_srt=0
+	let idx_end=$((job_nbr-1))
+	for ((clm_idx=0;clm_idx<clm_nbr;clm_idx++)); do
+	    cmd_rgr[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncks -t ${thr_nbr} -O ${nco_opt} ${rgr_opt} ${fl_out[${clm_idx}]} ${fl_rgr[${clm_idx}]}"
+	    if [ "${mdl_typ}" = 'mpas' ]; then
+		cmd_rgr[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncremap -C -u .pid${spt_pid}.split.${clm_idx}.tmp -P mpas -t ${thr_nbr} -m ${rgr_map} -i ${fl_out[${clm_idx}]} -o ${fl_rgr[${clm_idx}]}"
+	    fi # !mdl_typ
+	    if [ ${dbg_lvl} -ge 1 ]; then
+		echo ${cmd_rgr[${clm_idx}]}
+	    fi # !dbg
+	    if [ ${dbg_lvl} -le 1 ]; then
+		if [ -z "${par_opt}" ]; then
+		    eval ${cmd_rgr[${clm_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR regrid cmd_rgr[${clm_idx}] failed. Debug this:\n${cmd_rgr[${clm_idx}]}\n"
+			exit 1
+		    fi # !err
+		else # !par_opt
+		    eval ${cmd_rgr[${clm_idx}]} ${par_opt}
+		    rgr_pid[${clm_idx}]=$!
+		fi # !par_opt
+	    fi # !dbg
+	    
+	    # Block NNN: Wait
+	    # Parallel regridding (both Background and MPI) spawns simultaneous processes in batches of ${job_nbr}
+	    # Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
+	    if [ -n "${par_opt}" ]; then
+		let bch_idx=$((clm_idx / job_nbr))
+		let bch_flg=$(((clm_idx+1) % job_nbr))
+		#printf "${spt_nm}: clm_idx = ${clm_idx}, bch_idx = ${bch_idx}, bch_flg = ${bch_flg}\n"
+		if [ ${bch_flg} -eq 0 ]; then
+		    if [ ${dbg_lvl} -ge 1 ]; then
+			printf "${spt_nm}: Waiting for batch ${bch_idx} to finish at clm_idx = ${clm_idx}...\n"
+		    fi # !dbg
+		    for ((pid_idx=${idx_srt};pid_idx<=${idx_end};pid_idx++)); do
+			wait ${rgr_pid[${pid_idx}]}
+			if [ $? -ne 0 ]; then
+			    printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+			    exit 1
+			fi # !err
+		    done # !pid_idx
+		    let idx_srt=$((idx_srt + job_nbr))
+		    let idx_end=$((idx_end + job_nbr))
+		fi # !bch_flg
+	    fi # !par_typ
+	    
+	done # !clm_idx
+	
+	# Parallel mode might exit loop after a partial batch, wait() for remaining jobs to finish
+	if [ -n "${par_opt}" ]; then
+	    let bch_flg=$((clm_nbr % job_nbr))
+	    if [ ${bch_flg} -ne 0 ]; then
+		let bch_idx=$((bch_idx+1))
+		printf "${spt_nm}: Waiting for (partial) batch ${bch_idx} to finish...\n"
+		for ((pid_idx=${idx_srt};pid_idx<${clm_nbr};pid_idx++)); do
+		    wait ${rgr_pid[${pid_idx}]}
+		    if [ $? -ne 0 ]; then
+			printf "${spt_nm}: ERROR Failed to regrid. cmd_rgr[${pid_idx}] failed. Debug this:\n${cmd_rgr[${pid_idx}]}\n"
+			exit 1
+		    fi # !err
+		done # !pid_idx
+	    fi # !bch_flg
+	fi # !par_typ
+    fi # !rgr_map
+    
+fi # !dly
 
 # Many subsequent blocks only executed for normal and incremental monthly climos, not for binary climos, or non-monthly climos
-if [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
+if [ "${clm_flg}" = 'Yes' ] && [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
     
     # Block 1 Loop 2: Execute and/or echo monthly climatology commands
     printf "Generating climatology...\n"
@@ -1087,10 +1818,10 @@ if [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
     # Block 2: Climatological seasonal means
     # Block 2 Loop 1: Generate seasonal commands
     printf "Climatological seasonal means...\n"
-    cmd_clm[13]="${cmd_mpi[13]} ncra --cb -O -w 31,30,31 ${nco_opt} ${fl_out[3]} ${fl_out[4]} ${fl_out[5]} ${fl_out[13]}"
-    cmd_clm[14]="${cmd_mpi[14]} ncra --cb -O -w 30,31,31 ${nco_opt} ${fl_out[6]} ${fl_out[7]} ${fl_out[8]} ${fl_out[14]}"
-    cmd_clm[15]="${cmd_mpi[15]} ncra --cb -O -w 30,31,30 ${nco_opt} ${fl_out[9]} ${fl_out[10]} ${fl_out[11]} ${fl_out[15]}"
-    cmd_clm[16]="${cmd_mpi[16]} ncra --cb -O -w 31,31,28 ${nco_opt} ${fl_out[12]} ${fl_out[1]} ${fl_out[2]} ${fl_out[16]}"
+    cmd_clm[13]="${cmd_mpi[13]} ncra --cb -O -w 31,30,31 ${nco_opt} ${gaa_sng} ${fl_out[3]} ${fl_out[4]} ${fl_out[5]} ${fl_out[13]}"
+    cmd_clm[14]="${cmd_mpi[14]} ncra --cb -O -w 30,31,31 ${nco_opt} ${gaa_sng} ${fl_out[6]} ${fl_out[7]} ${fl_out[8]} ${fl_out[14]}"
+    cmd_clm[15]="${cmd_mpi[15]} ncra --cb -O -w 30,31,30 ${nco_opt} ${gaa_sng} ${fl_out[9]} ${fl_out[10]} ${fl_out[11]} ${fl_out[15]}"
+    cmd_clm[16]="${cmd_mpi[16]} ncra --cb -O -w 31,31,28 ${nco_opt} ${gaa_sng} ${fl_out[12]} ${fl_out[1]} ${fl_out[2]} ${fl_out[16]}"
 
     # Block 2 Loop 2: Execute and/or echo seasonal climatology commands
     for ((clm_idx=13;clm_idx<=16;clm_idx++)); do
@@ -1167,7 +1898,7 @@ if [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
     
     # Block 3: Climatological annual mean (seventeenth file)
     printf "Climatological annual mean...\n"
-    cmd_clm[17]="${cmd_mpi[17]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${fl_out[13]} ${fl_out[14]} ${fl_out[15]} ${fl_out[16]} ${fl_out[17]}"
+    cmd_clm[17]="${cmd_mpi[17]} ncra --c2b -O -w 92,92,91,90 ${nco_opt} ${gaa_sng} ${fl_out[13]} ${fl_out[14]} ${fl_out[15]} ${fl_out[16]} ${fl_out[17]}"
     if [ ${dbg_lvl} -ge 1 ]; then
 	echo ${cmd_clm[17]}
     fi # !dbg
@@ -1231,7 +1962,7 @@ if [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
     # Strategy: Start in drc_pwd, cd to drc_rgr, then link so return code comes from ln not cd
     if [ ${lnk_flg} = 'Yes' ]; then
 	printf "Link ACME-climo to AMWG-climo filenames...\n"
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 	    if [ -n "${rgr_map}" ]; then 
 		cmd_lnk[${clm_idx}]="cd ${drc_pwd};cd ${drc_rgr};ln -s -f ${fl_rgr[${clm_idx}]/${drc_rgr}\//} ${fl_amwg[${clm_idx}]/${drc_rgr}\//}"
 	    else
@@ -1253,7 +1984,7 @@ if [ "${clm_md}" = 'mth' ] && [ "${bnr_flg}" = 'No' ]; then
 fi # !clm_md !bnr_flg
 
 # Extended climos
-if [ "${xtn_flg}" = 'Yes' ]; then
+if [ "${clm_flg}" = 'Yes' ] && [ "${xtn_flg}" = 'Yes' ]; then
     mkdir -p ${drc_prv}
     mkdir -p ${drc_xtn}
 
@@ -1324,7 +2055,7 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 	fl_xtn[17]="${drc_xtn}/${out_nm}_ANN_${yyyy_clm_srt_dec_prv}${mm_ann_srt}_${yyyy_end}${mm_ann_end}_climo.nc"
 	
 	# Derive all seventeen regridded and AMWG names from output names
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 	    fl_rgr_prv[${clm_idx}]="${fl_rgr[${clm_idx}]/${drc_rgr}/${drc_rgr_prv}}"
 	    fl_rgr_prv[${clm_idx}]="${fl_rgr_prv[${clm_idx}]/_${yyyy_srt}/_${yyyy_srt_prv}}"
 	    fl_rgr_prv[${clm_idx}]="${fl_rgr_prv[${clm_idx}]/_${yyyy_end}/_${yyyy_end_prv}}"
@@ -1353,8 +2084,8 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 	done # !clm_idx
 	
 	printf "Weight input climos to produce extended climo...\n"
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
-	    cmd_xtn[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncflint -O ${nco_opt} -w ${wgt_prv},${wgt_crr} ${fl_prv[${clm_idx}]} ${fl_out[${clm_idx}]} ${fl_xtn[${clm_idx}]}"
+	for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
+	    cmd_xtn[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncflint -O ${nco_opt} ${gaa_sng} -w ${wgt_prv},${wgt_crr} ${fl_prv[${clm_idx}]} ${fl_out[${clm_idx}]} ${fl_xtn[${clm_idx}]}"
 	    if [ ${dbg_lvl} -ge 1 ]; then
 		echo ${cmd_xtn[${clm_idx}]}
 	    fi # !dbg
@@ -1372,7 +2103,7 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 	    fi # !dbg
 	done # !clm_idx
 	if [ -n "${par_opt}" ]; then
-	    for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	    for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 		wait ${xtn_pid[${clm_idx}]}
 		if [ $? -ne 0 ]; then
 		    printf "${spt_nm}: ERROR extended climo cmd_xtn[${clm_idx}] failed. Debug this:\n${cmd_xtn[${clm_idx}]}\n"
@@ -1384,7 +2115,7 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 	
 	if [ -n "${rgr_map}" ]; then 
 	    printf "Weight input climos to produce extended regridded climo...\n"
-	    for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	    for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 		cmd_rgr_xtn[${clm_idx}]="${cmd_mpi[${clm_idx}]} ncflint -O ${nco_opt} -w ${wgt_prv},${wgt_crr} ${fl_rgr_prv[${clm_idx}]} ${fl_rgr[${clm_idx}]} ${fl_rgr_xtn[${clm_idx}]}"
 		if [ ${dbg_lvl} -ge 1 ]; then
 		    echo ${cmd_rgr_xtn[${clm_idx}]}
@@ -1403,7 +2134,7 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 		fi # !dbg
 	    done # !clm_idx
 	    if [ -n "${par_opt}" ]; then
-		for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+		for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 		    wait ${rgr_xtn_pid[${clm_idx}]}
 		    if [ $? -ne 0 ]; then
 			printf "${spt_nm}: ERROR extended climo cmd_rgr_xtn[${clm_idx}] failed. Debug this:\n${cmd_rgr_xtn[${clm_idx}]}\n"
@@ -1419,7 +2150,7 @@ if [ "${xtn_flg}" = 'Yes' ]; then
 	# Strategy: Start in drc_pwd, cd to drc_rgr, then link so return code comes from ln not cd
 	if [ ${lnk_flg} = 'Yes' ]; then
 	    printf "Link extended ACME-climo to AMWG-climo filenames...\n"
-	    for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	    for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
 		if [ -n "${rgr_map}" ]; then 
 		    cmd_lnk_xtn[${clm_idx}]="cd ${drc_pwd};cd ${drc_rgr_xtn};ln -s -f ${fl_rgr_xtn[${clm_idx}]/${drc_rgr_xtn}\//} ${fl_amwg[${clm_idx}]/${drc_rgr_xtn}\//}"
 		else
@@ -1447,33 +2178,57 @@ else # !xtn_flg extended climos
 fi # !xtn_flg extended climos
 
 date_end=$(date +"%s")
-printf "Completed ${yr_nbr_xtn}-year climatology generation for dataset ${caseid} at `date`.\n"
+if [ -n "${caseid}" ]; then
+    printf "Completed ${yr_nbr_xtn}-year climatology operations for dataset ${caseid} at `date`\n"
+else # !caseid
+    printf "Completed ${yr_nbr_xtn}-year climatology operations for input data at `date`\n"
+fi # !caseid
 date_dff=$((date_end-date_srt))
-echo "Quick plots of climatological annual mean:"
-if [ -n "${yr_srt_prv}" ]; then
-    if [ -n "${rgr_map}" ]; then 
-	echo "ncview ${fl_rgr_xtn[${clm_nbr}]} &"
-	echo "panoply ${fl_rgr_xtn[${clm_nbr}]} &"
+if [ "${clm_flg}" = 'Yes' ]; then
+    if [ "${clm_md}" = 'dly' ]; then
+	echo "Quick plots of last climatological daily mean:"
+	let idx_lst=${clm_nbr}-1
     else
-	echo "ncview ${fl_xtn[${clm_nbr}]} &"
-	echo "panoply ${fl_xtn[${clm_nbr}]} &"
-    fi # !rgr_map    
-else
+	echo "Quick plots of climatological annual mean:"
+	let idx_lst=${clm_nbr}
+    fi # !dly
+    
+    if [ -n "${yr_srt_prv}" ]; then
+	if [ -n "${rgr_map}" ]; then 
+	    echo "ncview ${fl_rgr_xtn[${idx_lst}]} &"
+	    echo "panoply ${fl_rgr_xtn[${idx_lst}]} &"
+	else
+	    echo "ncview ${fl_xtn[${idx_lst}]} &"
+	    echo "panoply ${fl_xtn[${idx_lst}]} &"
+	fi # !rgr_map    
+    else
+	if [ -n "${rgr_map}" ]; then 
+	    echo "ncview ${fl_rgr[${idx_lst}]} &"
+	    echo "panoply ${fl_rgr[${idx_lst}]} &"
+	else
+	    echo "ncview ${fl_out[${idx_lst}]} &"
+	    echo "panoply ${fl_out[${idx_lst}]} &"
+	fi # !rgr_map    
+    fi # !yr_srt_prv
+    echo "Elapsed time $((date_dff/60))m$((date_dff % 60))s"
+fi # !clm_flg
+if [ "${sbs_flg}" = 'Yes' ]; then
+    echo "Quick plots of last variable split in last segment:"
+    let idx_lst=${var_nbr}-1
     if [ -n "${rgr_map}" ]; then 
-	echo "ncview ${fl_rgr[${clm_nbr}]} &"
-	echo "panoply ${fl_rgr[${clm_nbr}]} &"
+	echo "ncview ${fl_rgr[${idx_lst}]} &"
+	echo "panoply ${fl_rgr[${idx_lst}]} &"
     else
-	echo "ncview ${fl_out[${clm_nbr}]} &"
-	echo "panoply ${fl_out[${clm_nbr}]} &"
+	echo "ncview ${fl_out[${idx_lst}]} &"
+	echo "panoply ${fl_out[${idx_lst}]} &"
     fi # !rgr_map    
-fi # !yr_srt_prv
-echo "Elapsed time $((date_dff/60))m$((date_dff % 60))s"
+fi # !sbs_flg
 
 # PMC: add SMB's Git (SHA1) hash info to climo files
 # Assumes utility to add Git hash resides in ../utils/add_git_hash_to_netcdf_metadata
-for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
-    fl_out_lst="${fl_out_lst} ${fl_out[${clm_idx}]}"
-done
+#for ((clm_idx=1;clm_idx<=clm_nbr;clm_idx++)); do
+#    fl_out_lst="${fl_out_lst} ${fl_out[${clm_idx}]}"
+#done
 # CSZ: 20150826 disable until less fragile (than relative path) solution is found 
 #cd ${drc_spt}
 # ../utils/add_git_hash_to_netcdf_metadata ${fl_out_lst}
diff --git a/data/ncremap b/data/ncremap
index 6626009..fa11136 100755
--- a/data/ncremap
+++ b/data/ncremap
@@ -1,8 +1,8 @@
 #!/bin/bash
 
-# Purpose: Regrid (subsets of) netCDF files between different grids, generate rectangular grids (in SCRIP format), generate mapfiles
+# Purpose: Regrid (subsets of) netCDF files between different Swath, Curvilinear, Rectangular, or Unstructured data (SCRUD) grids, generate required/requested rectangular grids and/or mapfiles in SCRIP format
 
-# Copyright (C) 2015-2016 Charlie Zender
+# Copyright (C) 2015--2017 Charlie Zender
 # This file is part of NCO, the netCDF Operators. NCO is free software.
 # You may redistribute and/or modify NCO under the terms of the 
 # GNU General Public License (GPL) Version 3.
@@ -42,6 +42,17 @@
 # Use Free-Will, Old-Grid, or New-Grid mode to process Swath-Like-Data (SLD) where each input may be a granule on a new grid, yet all inputs are to be regridded to the same output grid
 # Use Pre-Destination mode to post-process models or analyses where all files are converted from the same source grid to the same destination grid so the map-file can be pre-generated and never change
 
+# Insta-install:
+# scp ~/nco/data/ncremap aims4.llnl.gov:bin
+# scp ~/nco/data/ncremap blues.lcrc.anl.gov:bin
+# scp ~/nco/data/ncremap cooley.alcf.anl.gov:bin
+# scp ~/nco/data/ncremap cori.nersc.gov:bin_cori
+# scp ~/nco/data/ncremap edison.nersc.gov:bin_edison
+# scp ~/nco/data/ncremap rhea.ccs.ornl.gov:bin_rhea
+# scp ~/nco/data/ncremap skyglow.ess.uci.edu:bin
+# scp ~/nco/data/ncremap yellowstone.ucar.edu:bin
+# scp dust.ess.uci.edu:nco/data/ncremap ~/bin
+
 # Set script name, directory, PID, run directory
 drc_pwd=${PWD}
 # Set these before 'module' command which can overwrite ${BASH_SOURCE[0]}
@@ -151,10 +162,6 @@ case "${HOSTNAME}" in
         export LD_LIBRARY_PATH='/glade/apps/opt/netcdf/4.3.0/intel/12.1.5/lib:/glade/u/home/zender/lib'\:${LD_LIBRARY_PATH}
 esac # !HOSTNAME
 
-# Insta-install
-# scp ~/nco/data/ncremap cori.nersc.gov:bin_cori
-# scp ~/nco/data/ncremap edison.nersc.gov:bin_edison
-
 # Test cases (for Charlie's machines)
 # Map-only:
 # ncremap -s ${DATA}/grids/oEC60to30.SCRIP.150729.nc -g ${DATA}/grids/t62_SCRIP.20150901.nc -m ~/map.nc -w esmf -a bilinear
@@ -182,14 +189,20 @@ esac # !HOSTNAME
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.cice.h.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.pop.h.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
 # ncremap -i ${DATA}/ne120/raw/b1850c5_m2a.rtm.h0.0060-01.nc -g ${DATA}/grids/180x360_SCRIP.20150901.nc -O ~/rgr
-# MPAS:
-# ncremap -P mpas -i ${DATA}/mpas/raw/hist.ocn.0001-01-01_00.00.00.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
-# ncremap -P mpas -i ${DATA}/mpas/raw/hist.ice.0003-12-01_00.00.00.nc -m ${DATA}/maps/map_mpas120_TO_T62_aave.121116.nc -O ~/rgr
+# Old MPAS filename conventions (until ~201609)::
+# ncremap -P mpas -i ${DATA}/hdf/hist.ocn.0003-12-01_00.00.00.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
+# ncremap -P mpas -i ${DATA}/hdf/hist.ice.0003-12-01_00.00.00.nc -m ${DATA}/maps/map_mpas120_TO_T62_aave.121116.nc -O ~/rgr
+# New MPAS filename conventions (as of ~201612):
+# ncremap -P mpas -i ${DATA}/hdf/mpaso.hist.am.timeSeriesStatsMonthly.0001-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
+# ncremap -P mpas --rgr_opt="--rgr cll_msr=Y" -i ${DATA}/hdf/mpascice.hist.am.timeSeriesStatsMonthly.0251-01-01.nc -m ${DATA}/maps/map_oEC60to30_to_t62_bilin.20160301.nc -O ~/rgr
 # ACME benchmarks:
 # ncremap -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
 # ncremap -v FSNT,AODVIS -w esmf    -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
 # ncremap -v FSNT,AODVIS -w tempest -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -s ${DATA}/grids/ne30np4_pentagons.091226.nc -g ${DATA}/grids/129x256_SCRIP.20150901.nc -O ~/rgr
-
+# Positional arguments:
+# ncremap --var=FSNT,AODVIS --map=${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc --drc_out=~/rgr ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-??.nc
+# cell_measures:
+# ncremap --nco_opt="--rgr cll_msr=Y" -v FSNT,AODVIS -i ${DATA}/ne30/raw/famipc5_ne30_v0.3_00003.cam.h0.1979-01.nc -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
 # Debugging and Benchmarking:
 # ncremap -D 1 -i ${DATA}/sld/raw/AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc -d ${DATA}/dstmch90/dstmch90_clm.nc -O ~/rgr > ~/ncremap.out 2>&1 &
 
@@ -233,7 +246,7 @@ fi # !TERM
 # Modify these defaults to save typing later
 alg_typ='bilinear' # [nbr] Algorithm for ESMF interpolation (bilinear|patch|neareststod|nearestdtos|conserve)
 cln_flg='Yes' # [flg] Clean-up (remove) intermediate files before exiting
-clm_flg='No' # [flg] Invoked by climo_nco.sh script
+clm_flg='No' # [flg] Invoked by ncclimo script
 dbg_lvl=0 # [nbr] Debugging level
 #drc_in="${drc_pwd}" # [sng] Input file directory
 drc_in='' # [sng] Input file directory
@@ -255,7 +268,6 @@ grd_src='' # [sng] Source grid-file
 grd_src_xmp='grd_src.nc' # [sng] Source grid-file for examples
 hdr_pad='10000' # [B] Pad at end of header section
 in_fl='' # [sng] Input file
-#in_fl='AIRS.2014.10.01.202.L2.TSurfStd.Regrid010.1DLatLon.hole.nc' # [sng] Input file
 in_xmp='in.nc' # [sng] Input file for examples
 job_nbr=2 # [nbr] Job simultaneity for parallelism
 map_fl='' # [sng] Map-file
@@ -272,12 +284,13 @@ par_typ='nil' # [sng] Parallelism type
 pdq_typ='' # [sng] Permutation type
 #rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon --rnr=0.0' # [sng] Regridding options
 rgr_opt='--rgr lat_nm_out=lat --rgr lon_nm_out=lon' # [sng] Regridding options
+std_flg='No' # [sng] Input available from pipe to stdin
 thr_nbr=2 # [nbr] Thread number for regridder
 tmp_out_fl='ncremap_grd_tmp.nc' # [sng] Temporary output file
 #tps_opt='--mono' # [sng] TempestRemap options
 tps_opt='' # [sng] TempestRemap options
-#var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
 unq_sfx=".pid${spt_pid}" # [sng] Unique suffix
+#var_lst='FSNT,AODVIS' # [sng] Variables to process (empty means all)
 var_lst='' # [sng] Variables to process (empty means all)
 var_rgr='' # [sng] CF template variable
 var_xmp='FSNT' # [sng] Variable list for examples
@@ -306,7 +319,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-G${fnt_nrm} ${fnt_bld}grd_sng${fnt_nrm}  Grid generation argument string (empty means none) (default ${fnt_bld}${grd_sng}${fnt_nrm}) [${fnt_tlc}grd_sng, grid_generation, grid_gen, grid_string${fnt_nrm}]"
     echo "${fnt_rvr}-g${fnt_nrm} ${fnt_bld}grd_dst${fnt_nrm}  Grid-file (destination) (empty means none, i.e., infer from dst_fl or use grd_sng or map_fl) (default ${fnt_bld}${grd_dst}${fnt_nrm}) [${fnt_tlc}grd_dst, grid_dest, dest_grid, destination_grid${fnt_nrm}]"
     echo "${fnt_rvr}-I${fnt_nrm} ${fnt_bld}drc_in${fnt_nrm}   Input directory (empty means none) (default ${fnt_bld}${drc_in}${fnt_nrm}) [${fnt_tlc}drc_in, in_drc, dir_in, in_dir, input${fnt_nrm}]"
-    echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}in_fl${fnt_nrm}    Input file (empty means use stdin or drc_in) (default ${fnt_bld}${in_fl}${fnt_nrm}) [${fnt_tlc}in_fl, in_file, input_file${fnt_nrm}]"
+    echo "${fnt_rvr}-i${fnt_nrm} ${fnt_bld}in_fl${fnt_nrm}    Input file (empty means pipe to stdin or drc_in) (default ${fnt_bld}${in_fl}${fnt_nrm}) [${fnt_tlc}in_fl, in_file, input_file${fnt_nrm}]"
     echo "${fnt_rvr}-j${fnt_nrm} ${fnt_bld}job_nbr${fnt_nrm}  Job simultaneity for parallelism (default ${fnt_bld}${job_nbr}${fnt_nrm}) [${fnt_tlc}job_nbr, job_number, jobs${fnt_nrm}]"
     echo "${fnt_rvr}-M${fnt_nrm}          Multi-map-file toggle (unset means generate one map-file per input file) [${fnt_tlc}mlt_map, no_multimap${fnt_nrm}]"
     echo "${fnt_rvr}-m${fnt_nrm} ${fnt_bld}map_fl${fnt_nrm}   Map-file (empty means generate internally) (default ${fnt_bld}${map_fl}${fnt_nrm}) [${fnt_tlc}map_fl, map, map_file, rgr_map, regrid_map${fnt_nrm}]"
@@ -322,7 +335,7 @@ function fnc_usg_prn { # NB: dash supports fnc_nm (){} syntax, not function fnc_
     echo "${fnt_rvr}-U${fnt_nrm} ${fnt_bld}drc_tmp${fnt_nrm}  Temporary directory (for intermediate files) (default ${fnt_bld}${drc_tmp}${fnt_nrm}) [${fnt_tlc}drc_tmp, tmp_drc, dir_tmp, tmp_dir, tmp${fnt_nrm}]"
     echo "${fnt_rvr}-u${fnt_nrm} ${fnt_bld}unq_sfx${fnt_nrm}  Unique suffix (prevents intermediate files from sharing names) (default ${fnt_bld}${unq_sfx}${fnt_nrm}) [${fnt_tlc}unq_sfx, unique_suffix, suffix${fnt_nrm}]"
     echo "${fnt_rvr}-V${fnt_nrm} ${fnt_bld}var_rgr${fnt_nrm}  CF template variable (empty means none) (default ${fnt_bld}${var_rgr}${fnt_nrm}) [${fnt_tlc}var_rgr, rgr_var, var_cf, cf_var, cf_variable${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}) [${fnt_tlc}var_lst, variable_list, variable, variables${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}) [${fnt_tlc}var_lst, variable_list, var, vars, variable, variables${fnt_nrm}]"
     echo "${fnt_rvr}-w${fnt_nrm} ${fnt_bld}wgt_gnr${fnt_nrm}  Weight-generator (default ${fnt_bld}${wgt_gnr}${fnt_nrm}) [${fnt_tlc}wgt_gnr, weight_generator, generator${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}) [${fnt_tlc}xtn_var, xtn_lst, extensive, var_xtn, extensive_variables${fnt_nrm}]"
     printf "\n"
@@ -427,19 +440,29 @@ while getopts :a:CD:d:E:f:g:G:h:I:i:j:Mm:n:O:o:P:p:R:s:T:t:U:u:V:v:w:x:-: OPT; d
 	       drc_tmp=?* | tmp_drc=?* | dir_tmp=?* | tmp_dir=?* | tmp=?* ) tmp_usr="${LONG_OPTARG}" ;; # -U # Temporary directory
 	       unq_sfx=?* | unique_suffix=?* | suffix=?* ) unq_usr="${LONG_OPTARG}" ;; # -u # Unique suffix
 	       var_rgr=?* | rgr_var=?* | var_cf=?* | cf_var=?* | cf_variable=?* ) var_rgr="${LONG_OPTARG}" ;; # -V # CF template variable 
-	       var_lst=?* | variable_list=?* | variable=?* | variables=?* ) var_lst="${LONG_OPTARG}" ;; # -v # Variables
+	       var_lst=?* | variable_list=?* | var=?* | vars=?* | variable=?* | variables=?* ) var_lst="${LONG_OPTARG}" ;; # -v # Variables
 	       wgt_gnr=?* | weight_generator=?* | generator=?* ) wgt_usr="${LONG_OPTARG}" ;; # -w # Weight-generator
 	       xtn_var=?* | extensive=?* | var_xtn=?* | extensive_variables=?* ) xtn_var="${LONG_OPTARG}" ;; # -x # Extensive variables
                '' ) break ;; # "--" terminates argument processing
-               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}" >&2; fnc_usg_prn ;;
-	   esac ;;
+               * ) printf "\nERROR: Illegal option ${fnt_bld}--${OPTARG}${fnt_nrm}\n" >&2; fnc_usg_prn ;;
+	   esac ;; # !OPTARG
 	\?) # Unrecognized option
-	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed" >&2
+	    printf "\nERROR: Option ${fnt_bld}-${OPTARG}${fnt_nrm} not allowed\n" >&2
 	    fnc_usg_prn ;;
-    esac
-done
+    esac # !OPT
+done # !getopts
 shift $((OPTIND-1)) # Advance one argument
 
+# Detect input on pipe to stdin:
+# http://stackoverflow.com/questions/2456750/detect-presence-of-stdin-contents-in-shell-script
+# http://unix.stackexchange.com/questions/33049/check-if-pipe-is-empty-and-run-a-command-on-the-data-if-it-isnt
+# 20170119 "if [ ! -t 0 ]" tests whether stdin connected to terminal, not whether pipe has data
+# Non-interactive batch mode (e.g., qsub, sbatch) disconnects stdin from terminal and triggers false-positives
+# Switch test from "if [ ! -t 0 ]" to "if [ -p /dev/stdin ]"
+if [ -p /dev/stdin ]; then
+    std_flg='Yes'
+fi # !stdin
+
 # Derived variables
 if [ -n "${drc_usr}" ]; then
     drc_out="${drc_usr%/}"
@@ -613,8 +636,8 @@ if [ -n "${map_fl}" ]; then
     if [ "${map_mk}" = 'Yes' ]; then
 	# Confirm before overwriting maps
         if [ -f "${map_fl}" ]; then
-	    # 20160803: fxm get to work on Interactive shells only (block hangs on read() in non-interactive shells)
-#	    if [[ -t 0 || -p /dev/stdin ]]; then
+	    # 20160803: fxm invoke iff in interactive shell (block hangs on read() in non-interactive shells)
+#	    if [ -t 0 ] || [ ! -p /dev/stdin ]; then
 #           if [ -n "${TERM}" ]; then
 #           if [ -n "${PS1}" ]; then
             if [ 1 -eq 0 ]; then
@@ -659,13 +682,10 @@ fi # !tempest
 # Parse grid/map arguments before in_fl arguments so we know whether this could be a map-only invocation
 if [ -n "${in_fl}" ]; then
     # Single file argument
-    fl_in[${fl_nbr}]=${in_fl}
-    let fl_nbr=${fl_nbr}+1
+    fl_in[0]=${in_fl}
+    fl_nbr=1
 else # !in_fl
-    # Detecting input on stdin:
-    # http://stackoverflow.com/questions/2456750/detect-presence-of-stdin-contents-in-shell-script
-    # ls ${DATA}/ne30/raw/famipc5*1979*.nc | ncremap -D 1 -m ${DATA}/maps/map_ne30np4_to_fv129x256_aave.20150901.nc -O ~/rgr
-    if [ -t 0 ]; then 
+    if [ ${std_flg} = 'No' ]; then 
 	if [ "${drc_in_usr_flg}" = 'Yes' ]; then
 	    for fl in "${drc_in}"/*.nc "${drc_in}"/*.nc3 "${drc_in}"/*.nc4 "${drc_in}"/*.cdf "${drc_in}"/*.hdf "${drc_in}"/*.he5 "${drc_in}"/*.h5 ; do
 		if [ -f "${fl}" ]; then
@@ -675,12 +695,34 @@ else # !in_fl
 	    done
 	else # !drc_in
 	    if [ "${map_mk}" != 'Yes' ]; then 
-		echo "ERROR: Must specify input file with -i or with stdin"
-		echo "HINT: Pipe file list to script via stdin with, e.g., 'ls *.nc | ${spt_nm}'"
-		exit 1
+		# Read any positional arguments
+		psn_nbr=$#
+		if [ ${psn_nbr} -eq 1 ]; then
+		    fl_in[0]=${1}
+		    fl_nbr=1
+		elif [ ${psn_nbr} -eq 2 ]; then
+		    if [ -z "${out_fl}" ]; then
+			out_fl=${2}
+			out_usr_flg='Yes'
+			fl_nbr=1
+		    else # !out_fl
+			echo "ERROR: Output file specified with -o (${out_fl}) conflicts with second positional argument ${2}"
+			echo "HINT: Use -o out_fl or positional argument, not both"
+			exit 1
+		    fi # !out_fl
+		elif [ ${psn_nbr} -ge 3 ]; then
+		    for ((psn_idx=1;psn_idx<=psn_nbr;psn_idx++)); do
+			fl_in[(${psn_idx}-1)]=${!psn_idx}
+			fl_nbr=${psn_nbr}
+		    done # !psn_idx
+		else
+		    echo "ERROR: Specify input file(s) with -i or with positional argument(s) or with pipe to stdin"
+		    echo "HINT: Pipe input file list to stdin with, e.g., 'ls *.nc | ${spt_nm}'"
+		    exit 1
+		fi # !psn_nbr
 	    fi # !map_mk
 	fi # !drc_in
-    else
+    else # !std_flg
 	# Input awaits on unit 0, i.e., on stdin
 	while read -r line; do # NeR05 p. 179
 	    fl_in[${fl_nbr}]=${line}
@@ -698,7 +740,7 @@ if [ "${mpi_flg}" = 'Yes' ]; then
 	# SLURM returns compressed lists (e.g., "nid00[076-078,559-567]")
 	# Convert this to file with uncompressed list (like Cobalt, PBS)
 	# http://www.ceci-hpc.be/slurm_faq.html#Q12
-	nd_fl='ncclimo.slurm_nodelist'
+	nd_fl='ncremap.slurm_nodelist'
 	nd_lst=`scontrol show hostname ${SLURM_NODELIST}`
 	echo ${nd_lst} > ${nd_fl}
     else
@@ -714,22 +756,22 @@ if [ "${mpi_flg}" = 'Yes' ]; then
 	    let nd_idx=${nd_idx}+1
 	done # !nd
 	nd_nbr=${#nd_nm[@]}
-	for ((clm_idx=1;clm_idx<=17;clm_idx++)); do
+	for ((fl_idx=0;fl_idx<fl_nbr;fl_idx++)); do
 	    case "${HOSTNAME}" in 
 		# 20160502: Remove limits on tasks per node so round-robin algorithm can schedule multiple jobs on same node
 		cori* | edison* | nid* )
 		    # 20160502: Non-interactive batch jobs at NERSC return HOSTNAME as nid*, not cori* or edison*
 		    # NB: NERSC staff says srun automatically assigns to unique nodes even without "-L $node" argument?
- 		    cmd_mpi[${clm_idx}]="srun --nodelist ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} --nodes=1" ; ;; # NERSC
-# 		    cmd_mpi[${clm_idx}]="srun --nodelist ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} --nodes=1 --ntasks=1" ; ;; # NERSC
+ 		    cmd_mpi[${fl_idx}]="srun --nodelist ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} --nodes=1" ; ;; # NERSC
+# 		    cmd_mpi[${fl_idx}]="srun --nodelist ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} --nodes=1 --ntasks=1" ; ;; # NERSC
 		hopper* )
 		    # NB: NERSC migrated from aprun to srun in 201601. Hopper commands will soon be deprecated.
-		    cmd_mpi[${clm_idx}]="aprun -L ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -n 1" ; ;; # NERSC
+		    cmd_mpi[${fl_idx}]="aprun -L ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -n 1" ; ;; # NERSC
 		* )
-		    cmd_mpi[${clm_idx}]="mpirun -H ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -n 1" ; ;; # Other (Cobalt)
-#		    cmd_mpi[${clm_idx}]="mpirun -H ${nd_nm[$(((${clm_idx}-1) % ${nd_nbr}))]} -npernode 1 -n 1" ; ;; # Other
+		    cmd_mpi[${fl_idx}]="mpirun -H ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -n 1" ; ;; # Other (Cobalt)
+#		    cmd_mpi[${fl_idx}]="mpirun -H ${nd_nm[$((${fl_idx} % ${nd_nbr}))]} -npernode 1 -n 1" ; ;; # Other
 	    esac # !HOSTNAME
-	done # !clm_idx
+	done # !fl_idx
 	if [ -n "${SLURM_NODELIST}" ]; then 
 	    /bin/rm -f ${nd_fl}
 	fi # !SLURM
@@ -749,7 +791,7 @@ if [ "${mpi_flg}" = 'Yes' ]; then
 	    thr_nbr=$((PBS_NUM_PPN > 8 ? 8 : PBS_NUM_PPN))
 	fi # !pbs
     fi # !thr_usr
-fi # !mpi
+fi # !mpi_flg
 
 # Print initial state
 if [ ${dbg_lvl} -ge 2 ]; then
@@ -781,7 +823,7 @@ if [ ${dbg_lvl} -ge 2 ]; then
     printf "dbg: var_lst  = ${var_lst}\n"
     printf "dbg: var_rgr  = ${var_rgr}\n"
     printf "dbg: wgt_usr  = ${wgt_usr}\n"
-    printf "Asked to regrid ${fl_nbr} files:\n"
+    printf "dbg: Will regrid ${fl_nbr} files:\n"
     for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 	printf "${fl_in[${fl_idx}]}\n"
     done # !fl_idx
@@ -793,18 +835,28 @@ if [ ${dbg_lvl} -ge 2 ]; then
 	done # !nd
     fi # !mpi
 fi # !dbg
+if [ ${dbg_lvl} -ge 2 ]; then
+    psn_nbr=$#
+    printf "dbg: Found ${psn_nbr} positional parameters (besides \$0):\n"
+    for ((psn_idx=1;psn_idx<=psn_nbr;psn_idx++)); do
+	printf "dbg: psn_arg[${psn_idx}] = ${!psn_idx}\n"
+    done # !psn_idx
+fi # !dbg
 
 # Create output directory
-mkdir -p ${drc_out}
-mkdir -p ${drc_tmp}
+if [ -n "${drc_out}" ]; then 
+    mkdir -p ${drc_out}
+fi # !drc_out
+if [ -n "${drc_tmp}" ]; then 
+    mkdir -p ${drc_tmp}
+fi # !drc_tmp
 
 # Human-readable summary
+date_srt=$(date +"%s")
 if [ ${dbg_lvl} -ge 1 ]; then
     printf "NCO regridder invoked with command:\n"
     echo "${cmd_ln}"
 fi # !dbg
-date_srt=$(date +"%s")
-
 if [ -f 'PET0.RegridWeightGen.Log' ]; then
     printf "${spt_nm}: Removing PET0.RegridWeightGen.Log file from current directory before running\n"
     /bin/rm -f PET0.RegridWeightGen.Log
@@ -840,7 +892,7 @@ if [ ${fl_nbr} -eq 0 ]; then
     printf "Map-only run: no input data detected therefore will exit after generating map\n"
 fi # !fl_nbr
 if [ -n "${pdq_opt}" ]; then 
-    printf "Input data obey \"${pdq_typ}\"-ordering and will be permuted with \"ncpdq ${pdq_opt}\"\n"
+    printf "Input data shaped in \"${pdq_typ}\"-order, will permute with \"ncpdq ${pdq_opt}\"\n"
 fi # !pdq_opt
 if [ "${pdq_typ}" = 'mpas' ]; then
     printf "Input assumed to be MPAS-O/I data: will apply renormalized regridding (--rnr=0.0)\n"
@@ -971,7 +1023,7 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
     if [ "${out_usr_flg}" = 'Yes' ]; then 
 	if [ ${fl_nbr} -ge 2 ]; then 
 	    echo "ERROR: Single output filename specified with -o for multiple input files"
-	    echo "HINT: For multiple input files use -O option to specify output directory and do not use -o option. Output files will have same name as input files, but will be in different directory."
+	    echo "HINT: For multiple input files use -O option to specify output directory and do not use -o or second positional option. Output files will have same name as input files, but will be in different directory."
 	    exit 1
 	fi # !fl_nbr
 	if [ -n "${drc_usr}" ]; then
@@ -1084,7 +1136,7 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
     fi # !map_mk
     
     # Block 4: Special cases
-    # Block 4a: Add missing metadata to MPAS files unless script was invoked by climo_nco.sh (it makes no sense to give naked files to climo_nco.sh and then annotate here, so assume climo_nco.sh is working with annotated files)
+    # Block 4a: Add missing metadata to MPAS files unless script was invoked by ncclimo (it makes no sense to give naked files to ncclimo and then annotate here, so assume ncclimo is working with annotated files)
     if [ "${pdq_typ}" = 'mpas' ] && [ "${clm_flg}" = 'No' ]; then
 	cmd_att[${fl_idx}]="ncatted -O -t -a _FillValue,,o,d,-9.99999979021476795361e+33 ${in_fl} ${att_fl};"
 	in_fl="${att_fl}"
@@ -1141,7 +1193,7 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
     fi # !dbg
 
     # Block 6: Wait
-    # Parallel regridding (both Background and MPI) spawn simultaneous processes in batches of ${job_nbr}
+    # Parallel regridding (both Background and MPI) spawns simultaneous processes in batches of ${job_nbr}
     # Once ${job_nbr} jobs are running, wait() for all to finish before issuing another batch
     if [ -n "${par_opt}" ]; then
 	let bch_idx=$((fl_idx / job_nbr))
@@ -1182,7 +1234,7 @@ for ((fl_idx=0;fl_idx<${fl_nbr};fl_idx++)); do
 
 done # !fl_idx
 
-# Parallel mode will often exit loop after a partial batch, wait() for remaining jobs to finish
+# Parallel mode might exit loop after a partial batch, wait() for remaining jobs to finish
 if [ -n "${par_opt}" ]; then
     let bch_flg=$((fl_nbr % job_nbr))
     if [ ${bch_flg} -ne 0 ]; then
diff --git a/data/split.cdl b/data/split.cdl
new file mode 100644
index 0000000..3f772bd
--- /dev/null
+++ b/data/split.cdl
@@ -0,0 +1,789 @@
+netcdf split {
+dimensions:
+	time = UNLIMITED ; // (36 currently)
+	ncol = 101 ;
+	nbnd = 2 ;
+variables:
+	float AODVIS(time, ncol) ;
+		AODVIS:_FillValue = 1.e+36f ;
+		AODVIS:missing_value = 1.e+36f ;
+		AODVIS:units = "" ;
+		AODVIS:long_name = "Aerosol optical depth 550 nm" ;
+		AODVIS:cell_methods = "time: mean" ;
+	double area(ncol) ;
+	double lat(ncol) ;
+		lat:long_name = "latitude" ;
+		lat:units = "degrees_north" ;
+	double lon(ncol) ;
+		lon:long_name = "longitude" ;
+		lon:units = "degrees_east" ;
+	double time(time) ;
+		time:long_name = "time" ;
+		time:units = "days since 1979-01-01 00:00:00" ;
+		time:calendar = "noleap" ;
+		time:bounds = "time_bnds" ;
+	double time_bnds(time, nbnd) ;
+		time_bnds:long_name = "time interval endpoints" ;
+
+// global attributes:
+		:np = 4 ;
+		:ne = 30 ;
+		:Conventions = "CF-1.0" ;
+		:source = "CAM" ;
+		:case = "famipc5_ne30_v0.3_00003" ;
+		:title = "UNSET" ;
+		:logname = "mbranst" ;
+		:host = "nid02435" ;
+		:Version = "$Name$" ;
+		:revision_Id = "$Id$" ;
+		:initial_file = "/scratch2/scratchdirs/mbranst/acme_scratch/inputdata/ne30_gx1.F1850c5d.cam.i.0006-01-01-00000.nc" ;
+		:topography_file = "/project/projectdirs/ccsm1/inputdata/atm/cam/topo/USGS-gtopo30_ne30np4_16xdel2-PFC-consistentSGH.nc" ;
+		:NCO = "\"4.6.0\"" ;
+		:nco_openmp_thread_number = 1 ;
+data:
+
+ AODVIS =
+  0.1954915, 0.2052418, 0.2055524, 0.1982304, 0.2047635, 0.2120854, 0.184495, 
+    0.193814, 0.1982379, 0.1796773, 0.1873291, 0.1900486, 0.2092419, 
+    0.2124223, 0.2095956, 0.2165151, 0.2197439, 0.2198535, 0.2026321, 
+    0.210454, 0.2129825, 0.1927225, 0.1985276, 0.1994585, 0.2075444, 
+    0.2046486, 0.2036938, 0.2174332, 0.2119768, 0.2074966, 0.2119771, 
+    0.2063783, 0.2007158, 0.1984009, 0.1980032, 0.1993936, 0.2027589, 
+    0.1959963, 0.1937612, 0.2026193, 0.1953114, 0.1911157, 0.1940382, 
+    0.1907044, 0.1884757, 0.2003334, 0.1979246, 0.1983925, 0.1914183, 
+    0.1890862, 0.1885663, 0.1891981, 0.1897797, 0.1897665, 0.1884398, 
+    0.1926364, 0.1953603, 0.2011434, 0.2019434, 0.2036232, 0.1881192, 
+    0.1881149, 0.1857819, 0.1922142, 0.1915971, 0.1921426, 0.1979958, 
+    0.198307, 0.196068, 0.2012686, 0.2007759, 0.2006028, 0.1859224, 
+    0.1863353, 0.1868506, 0.1925839, 0.1933768, 0.1940954, 0.1969706, 
+    0.1940695, 0.1951418, 0.199446, 0.196628, 0.1943224, 0.188907, 0.1917336, 
+    0.1935624, 0.195038, 0.1972754, 0.1976926, 0.1923693, 0.1948078, 
+    0.1949104, 0.1940187, 0.194156, 0.1961968, 0.1962795, 0.1968865, 
+    0.1959289, 0.200077, 0.1979352,
+  0.08774699, 0.08743263, 0.08813152, 0.08697822, 0.08712716, 0.08697484, 
+    0.08066922, 0.08181216, 0.08227495, 0.07723534, 0.08017638, 0.08140094, 
+    0.09060917, 0.09402835, 0.09687552, 0.08742309, 0.0918293, 0.09480345, 
+    0.08381522, 0.08884465, 0.09221447, 0.0819945, 0.08621505, 0.09087382, 
+    0.09871756, 0.1039915, 0.1066364, 0.09834164, 0.1046, 0.1087259, 
+    0.09643233, 0.1029484, 0.1073058, 0.09439981, 0.1007063, 0.1042427, 
+    0.1086272, 0.1132357, 0.1164022, 0.1122138, 0.1168153, 0.1192327, 
+    0.1101353, 0.1146111, 0.1164792, 0.10632, 0.1101103, 0.1108131, 
+    0.1174577, 0.1194424, 0.1198301, 0.1208031, 0.1236182, 0.1253759, 
+    0.1161827, 0.1195217, 0.121555, 0.1105978, 0.1127567, 0.1138001, 
+    0.1241897, 0.129181, 0.1299398, 0.1274792, 0.1320326, 0.1333827, 
+    0.1222774, 0.1241962, 0.1269779, 0.1142067, 0.1131517, 0.1144032, 
+    0.1315697, 0.1317602, 0.132011, 0.1356063, 0.1343876, 0.1365362, 
+    0.1273904, 0.1286372, 0.1312875, 0.1174474, 0.1185959, 0.1207921, 
+    0.1325194, 0.1315188, 0.1314559, 0.1350825, 0.1362105, 0.1351408, 
+    0.1304566, 0.1318385, 0.1342105, 0.1245243, 0.1285835, 0.1316005, 
+    0.1317033, 0.1362245, 0.1395495, 0.1373214, 0.1429455,
+  0.1739239, 0.1729402, 0.1719707, 0.1711836, 0.174391, 0.1745256, 0.1603207, 
+    0.157661, 0.1594325, 0.1611351, 0.1577098, 0.1590508, 0.1724134, 
+    0.1728314, 0.1737903, 0.1757511, 0.176421, 0.1767885, 0.1627198, 
+    0.170582, 0.1744228, 0.164528, 0.1702799, 0.1709895, 0.1761124, 
+    0.1808682, 0.1801839, 0.1775861, 0.177875, 0.1742473, 0.1755064, 
+    0.165073, 0.1578238, 0.1693932, 0.1585429, 0.1538348, 0.1803929, 
+    0.1798392, 0.1750582, 0.1709813, 0.1658825, 0.1617512, 0.1529435, 
+    0.148134, 0.14108, 0.1465365, 0.1392745, 0.1349678, 0.1716387, 0.1645602, 
+    0.1612926, 0.1581703, 0.1528563, 0.1519293, 0.1396111, 0.1401398, 
+    0.1405889, 0.1335033, 0.1348822, 0.1368755, 0.1606339, 0.1534593, 
+    0.1538814, 0.1529485, 0.152769, 0.1529377, 0.1432214, 0.1452122, 
+    0.1481796, 0.1389131, 0.137797, 0.1354714, 0.15597, 0.1617808, 0.1656674, 
+    0.1564982, 0.1605673, 0.1622002, 0.1489572, 0.1474354, 0.1448696, 
+    0.1318119, 0.1297729, 0.1316136, 0.1686257, 0.1727131, 0.1759136, 
+    0.1636261, 0.165663, 0.1689182, 0.1458476, 0.1497804, 0.1498627, 
+    0.1353435, 0.1402377, 0.1444481, 0.1779456, 0.1853191, 0.1852839, 
+    0.1681498, 0.1714406,
+  0.1786167, 0.1873076, 0.194791, 0.1864717, 0.1993225, 0.206763, 0.1901386, 
+    0.1990162, 0.2026069, 0.1908278, 0.193333, 0.1941527, 0.2006553, 0.2057, 
+    0.2014703, 0.2170719, 0.2169071, 0.2115936, 0.2038641, 0.2006001, 
+    0.1951292, 0.1940284, 0.1871726, 0.1834531, 0.198143, 0.1883013, 
+    0.1789255, 0.203945, 0.194141, 0.1842929, 0.1911463, 0.1842547, 0.179635, 
+    0.1815618, 0.179608, 0.1766685, 0.1752679, 0.1709059, 0.1707577, 
+    0.1767845, 0.1709922, 0.1708429, 0.1759156, 0.1752726, 0.1783778, 
+    0.1749188, 0.177655, 0.1779721, 0.1725561, 0.174211, 0.174641, 0.1754592, 
+    0.1814622, 0.1812453, 0.1798575, 0.1822189, 0.177544, 0.1792191, 
+    0.1805906, 0.1779069, 0.1763419, 0.1754508, 0.1706967, 0.1789466, 
+    0.1694007, 0.1647493, 0.1712515, 0.1614626, 0.1580704, 0.1743896, 
+    0.1646255, 0.1600677, 0.1648719, 0.1568906, 0.1547807, 0.1599964, 
+    0.1554217, 0.1554395, 0.1565195, 0.1581038, 0.1590432, 0.162646, 
+    0.1611406, 0.1604452, 0.1528743, 0.1513192, 0.1497111, 0.1586315, 
+    0.1562136, 0.1562016, 0.1655106, 0.1636323, 0.1619447, 0.160639, 
+    0.1601082, 0.1592852, 0.1492148, 0.1500751, 0.1525081, 0.1563363, 0.160644,
+  0.1510869, 0.1542146, 0.156989, 0.1632795, 0.1673208, 0.1679074, 0.1927984, 
+    0.2025148, 0.203211, 0.2143254, 0.21573, 0.2130025, 0.1603853, 0.1657471, 
+    0.1676381, 0.1704904, 0.1730234, 0.1732247, 0.2015578, 0.1927796, 
+    0.1877322, 0.208733, 0.2018969, 0.1967425, 0.1700829, 0.1717525, 
+    0.1729111, 0.1740752, 0.1770962, 0.1760429, 0.1853302, 0.1847549, 
+    0.1870149, 0.1945629, 0.1952988, 0.1985721, 0.1748789, 0.1819272, 
+    0.1849024, 0.1767615, 0.1795637, 0.1793738, 0.1887766, 0.1918996, 
+    0.1945476, 0.1997209, 0.2044196, 0.2060402, 0.188743, 0.1842763, 
+    0.1748654, 0.1774349, 0.1770387, 0.1749263, 0.1968132, 0.199715, 
+    0.1992591, 0.2058188, 0.2077636, 0.2106776, 0.170015, 0.1579867, 
+    0.153783, 0.1710836, 0.1675183, 0.1664319, 0.1997712, 0.1993994, 
+    0.1991671, 0.2138371, 0.2140347, 0.2106524, 0.1581412, 0.1591951, 
+    0.1613065, 0.1704873, 0.1677732, 0.166469, 0.1961351, 0.1909115, 
+    0.1870097, 0.2027994, 0.1919652, 0.1877802, 0.1588414, 0.1552486, 
+    0.1553995, 0.1674631, 0.1674751, 0.168565, 0.1866269, 0.1858682, 
+    0.1832919, 0.1861531, 0.187217, 0.1871001, 0.1577048, 0.165372, 
+    0.1682718, 0.16802, 0.1742394,
+  0.1906363, 0.1901704, 0.1875623, 0.2025749, 0.206433, 0.2005123, 0.2170124, 
+    0.2204212, 0.2193098, 0.2362882, 0.2321109, 0.2297994, 0.1846904, 
+    0.181544, 0.1781296, 0.19502, 0.1966698, 0.1865541, 0.2076659, 0.2046331, 
+    0.2122996, 0.2244332, 0.2236025, 0.2221671, 0.1726549, 0.1683958, 
+    0.1630023, 0.1866049, 0.1762094, 0.1740675, 0.2065514, 0.2078829, 
+    0.2042466, 0.2239724, 0.2190723, 0.2153239, 0.1609292, 0.1569534, 
+    0.1546557, 0.1699765, 0.1666802, 0.1687745, 0.2048534, 0.1955038, 
+    0.1923232, 0.2117693, 0.2075251, 0.2058202, 0.1509489, 0.1497327, 
+    0.1481774, 0.1681512, 0.1666452, 0.1628895, 0.1905132, 0.1884256, 
+    0.1891769, 0.2044083, 0.2005369, 0.2022443, 0.1481222, 0.1447443, 
+    0.1471749, 0.1592498, 0.1619628, 0.1635137, 0.1870604, 0.1917661, 
+    0.192659, 0.2035804, 0.2065762, 0.2076468, 0.1453881, 0.1448493, 
+    0.1440915, 0.1644577, 0.165576, 0.1662327, 0.1950034, 0.1953014, 
+    0.1949191, 0.207452, 0.2062996, 0.2137531, 0.146671, 0.1498499, 
+    0.1521496, 0.1694918, 0.1763436, 0.1811759, 0.2067915, 0.2116499, 
+    0.2167345, 0.2138439, 0.2262517, 0.2315412, 0.1571211, 0.1640163, 
+    0.1674957, 0.1874029, 0.1945786,
+  0.1896786, 0.1918914, 0.1892491, 0.1962431, 0.2014005, 0.1992956, 
+    0.2048586, 0.2066852, 0.2034762, 0.2082825, 0.2001792, 0.1949693, 
+    0.1885221, 0.1902647, 0.1890659, 0.1961279, 0.1928118, 0.1887126, 
+    0.199409, 0.1938328, 0.1902045, 0.1916712, 0.1888143, 0.1893841, 
+    0.190686, 0.1909313, 0.1862512, 0.1912346, 0.1930633, 0.1907808, 
+    0.1902959, 0.1921044, 0.1961961, 0.1935471, 0.1970171, 0.1975437, 
+    0.1806876, 0.1817406, 0.1835687, 0.1862947, 0.1878512, 0.190567, 
+    0.1982914, 0.1967019, 0.1975832, 0.2016835, 0.199562, 0.1941278, 
+    0.1900091, 0.1964789, 0.1986384, 0.1920092, 0.1933239, 0.1931775, 
+    0.1966315, 0.1903583, 0.183803, 0.1900206, 0.1853285, 0.1880271, 
+    0.1987904, 0.1971742, 0.1927225, 0.1930726, 0.1922454, 0.1947364, 
+    0.184542, 0.1896671, 0.1896102, 0.1912159, 0.1969684, 0.1913841, 
+    0.1929263, 0.1847612, 0.1800319, 0.1909867, 0.1811586, 0.1714433, 
+    0.1848235, 0.1768371, 0.173429, 0.1873626, 0.1790878, 0.1723381, 
+    0.1759883, 0.168194, 0.1602721, 0.1666408, 0.1649366, 0.1626477, 
+    0.1664855, 0.1602642, 0.1621723, 0.168886, 0.1638036, 0.1644865, 
+    0.1601189, 0.1610846, 0.1612729, 0.1605711, 0.162232,
+  0.2119588, 0.2176632, 0.2208682, 0.2152513, 0.2200734, 0.2240904, 
+    0.2090581, 0.2107005, 0.2110124, 0.1987567, 0.2040146, 0.2046128, 
+    0.2212195, 0.2174118, 0.2079995, 0.2229085, 0.2193937, 0.2159309, 
+    0.2093493, 0.2101333, 0.2076997, 0.2052733, 0.2060551, 0.2072342, 
+    0.2007361, 0.1909193, 0.1855097, 0.2077152, 0.1959265, 0.1881483, 
+    0.20602, 0.2013719, 0.2005085, 0.2065096, 0.204934, 0.205859, 0.1844421, 
+    0.1793746, 0.1768478, 0.1857276, 0.1854429, 0.1833152, 0.201065, 
+    0.2031028, 0.2054031, 0.207064, 0.2125163, 0.2071044, 0.1746369, 
+    0.1744489, 0.1762774, 0.1819557, 0.1840626, 0.185436, 0.2030785, 
+    0.1988732, 0.1957376, 0.2078757, 0.2054155, 0.2026137, 0.1730461, 
+    0.1723439, 0.1704763, 0.1824181, 0.1783503, 0.1802525, 0.1946535, 
+    0.190704, 0.1911389, 0.2049982, 0.2037122, 0.2029213, 0.1697549, 
+    0.1707603, 0.1701994, 0.1782067, 0.1799704, 0.1797967, 0.1904994, 
+    0.18754, 0.1863115, 0.2003481, 0.1938203, 0.1926307, 0.1702934, 
+    0.1698078, 0.1666698, 0.1795557, 0.178874, 0.1780438, 0.1881538, 
+    0.1861796, 0.1829003, 0.1912631, 0.1895325, 0.1878059, 0.1681777, 
+    0.1660794, 0.167106, 0.1789467, 0.1760756,
+  0.1286334, 0.1269895, 0.127767, 0.1361609, 0.1354878, 0.1336268, 0.1465011, 
+    0.1461069, 0.1402656, 0.1523714, 0.140247, 0.1372345, 0.1294348, 
+    0.1283572, 0.1273577, 0.1334204, 0.1337974, 0.1340785, 0.1346631, 
+    0.1310677, 0.1303914, 0.1363534, 0.1345273, 0.1342929, 0.1284832, 
+    0.130027, 0.1312707, 0.1321506, 0.1340037, 0.1374296, 0.1303741, 
+    0.1337655, 0.1365032, 0.1337021, 0.1340505, 0.1360545, 0.1344812, 
+    0.1397676, 0.1411705, 0.1385749, 0.1422145, 0.1454634, 0.1372489, 
+    0.1379296, 0.1394332, 0.1368502, 0.1394547, 0.1405112, 0.142928, 
+    0.145283, 0.1440065, 0.1517887, 0.1514257, 0.1480746, 0.1405668, 
+    0.1414474, 0.1392117, 0.14344, 0.1455315, 0.143189, 0.1420373, 0.1403603, 
+    0.1400274, 0.1428212, 0.1386795, 0.1377767, 0.1389547, 0.1367873, 
+    0.1389611, 0.1434318, 0.1434912, 0.1433651, 0.1392526, 0.1372387, 
+    0.1316812, 0.1398527, 0.1362854, 0.1324909, 0.140595, 0.141123, 
+    0.1401738, 0.1436628, 0.1457977, 0.1444397, 0.1294797, 0.1272952, 
+    0.1283476, 0.1290243, 0.132112, 0.1339472, 0.1403411, 0.1439678, 
+    0.1451737, 0.1451481, 0.1477971, 0.1471629, 0.1284245, 0.1340864, 
+    0.1365195, 0.1384986, 0.1421767,
+  0.1299628, 0.1294229, 0.1274931, 0.1345598, 0.1340972, 0.1325774, 
+    0.1379275, 0.141089, 0.1393437, 0.1387298, 0.1412361, 0.1417763, 
+    0.1283337, 0.1257687, 0.1237329, 0.1303241, 0.1293273, 0.1273175, 
+    0.1368629, 0.1368748, 0.137399, 0.1407822, 0.1449397, 0.1426928, 
+    0.1224963, 0.1217772, 0.1230937, 0.1249061, 0.1243884, 0.127071, 
+    0.1357506, 0.1302515, 0.1255872, 0.1391151, 0.1289692, 0.1258496, 
+    0.1265729, 0.1261442, 0.1295586, 0.1275589, 0.128249, 0.1298158, 
+    0.1227465, 0.1242012, 0.1295258, 0.1239649, 0.1292922, 0.1390608, 
+    0.1301167, 0.1319485, 0.1314989, 0.1323018, 0.135418, 0.1360931, 0.13685, 
+    0.148744, 0.151734, 0.1489494, 0.1559564, 0.1586595, 0.1302561, 
+    0.1306875, 0.1316861, 0.1348991, 0.1367945, 0.137563, 0.1534979, 
+    0.1527037, 0.1522826, 0.159484, 0.1605415, 0.1575736, 0.1286758, 
+    0.1246191, 0.1229084, 0.135054, 0.1334736, 0.1347913, 0.1497687, 
+    0.1463766, 0.1484456, 0.1524964, 0.147383, 0.1415917, 0.1253459, 
+    0.1306985, 0.1343014, 0.1380304, 0.1402359, 0.1408973, 0.1472926, 
+    0.142153, 0.1399773, 0.138021, 0.1320983, 0.1306829, 0.1366407, 
+    0.1398129, 0.1399482, 0.1436093, 0.141966,
+  0.146344, 0.142248, 0.1393117, 0.1552604, 0.1531578, 0.1497421, 0.1563542, 
+    0.158169, 0.1598406, 0.1535019, 0.1556785, 0.1577791, 0.1405883, 
+    0.1488269, 0.1508076, 0.1517251, 0.1560772, 0.1619961, 0.1598524, 
+    0.1668183, 0.1677451, 0.1593428, 0.164622, 0.1669476, 0.1523084, 0.15468, 
+    0.1526962, 0.1635156, 0.1668611, 0.1685837, 0.1705939, 0.1744903, 
+    0.1756771, 0.1644497, 0.1675043, 0.1689485, 0.1493731, 0.1463022, 
+    0.1438671, 0.1696408, 0.1631103, 0.1638779, 0.1800926, 0.1868232, 
+    0.1833488, 0.1742091, 0.1793512, 0.1798557, 0.1422958, 0.1377194, 
+    0.1345088, 0.1606339, 0.1543148, 0.1494279, 0.1831117, 0.1813686, 
+    0.1768945, 0.1813985, 0.1805276, 0.1794018, 0.1292731, 0.1276147, 
+    0.126546, 0.1450379, 0.1438734, 0.1430462, 0.1741115, 0.1730857, 
+    0.1764767, 0.1782845, 0.1786447, 0.1749635, 0.1269091, 0.1283551, 
+    0.1301016, 0.1424581, 0.1450208, 0.1427712, 0.171021, 0.1654073, 
+    0.1641171, 0.1747841, 0.1729056, 0.1682506, 0.1317082, 0.1303201, 
+    0.1263227, 0.1443875, 0.1403969, 0.1363788, 0.1624428, 0.1551939, 
+    0.1524396, 0.1650937, 0.1575785, 0.1571647, 0.1248747, 0.123309, 
+    0.1232975, 0.1350061, 0.1329321,
+  0.1755102, 0.1782824, 0.1814537, 0.1732881, 0.1765223, 0.1797348, 
+    0.1697965, 0.1716152, 0.1735759, 0.1708749, 0.172013, 0.1716569, 
+    0.184084, 0.1849064, 0.1850084, 0.1815074, 0.1810918, 0.1784322, 
+    0.1749404, 0.1728542, 0.1660836, 0.1695973, 0.1634995, 0.1627289, 
+    0.182243, 0.1759662, 0.1747504, 0.1755952, 0.1722731, 0.1706973, 
+    0.1660955, 0.1647148, 0.1645323, 0.1583723, 0.1584442, 0.1574573, 
+    0.1738243, 0.1744748, 0.1735976, 0.170867, 0.1720889, 0.1713889, 
+    0.1650033, 0.1641487, 0.1615691, 0.1557691, 0.1532708, 0.1506609, 
+    0.1730418, 0.1679271, 0.1627403, 0.1694104, 0.1623394, 0.156324, 
+    0.1572356, 0.1524252, 0.1497952, 0.1495337, 0.14782, 0.1475905, 
+    0.1577343, 0.1518547, 0.1485603, 0.151631, 0.1481112, 0.1495731, 
+    0.1486705, 0.1479519, 0.1477144, 0.1469421, 0.1447637, 0.1441316, 
+    0.148768, 0.1506405, 0.1511921, 0.1493118, 0.1517575, 0.1535962, 
+    0.1478382, 0.146755, 0.1478933, 0.1433997, 0.1424003, 0.1417823, 
+    0.1537059, 0.156788, 0.1595886, 0.1553896, 0.1575987, 0.1592122, 0.14973, 
+    0.1535225, 0.1557317, 0.1481648, 0.1546776, 0.1572393, 0.1608133, 
+    0.1618119, 0.1613342, 0.1591998, 0.1599037,
+  0.139913, 0.1412289, 0.1455513, 0.1396898, 0.1435158, 0.1453746, 0.1463682, 
+    0.1543897, 0.1567084, 0.1488611, 0.1526124, 0.1515827, 0.1498866, 
+    0.1587924, 0.1638683, 0.1478017, 0.1554752, 0.1599506, 0.1573369, 
+    0.158221, 0.1601354, 0.1523053, 0.1529154, 0.1535422, 0.1658488, 
+    0.1716795, 0.1688759, 0.1647966, 0.1708144, 0.1736228, 0.1628351, 
+    0.1701769, 0.1740719, 0.1555968, 0.1605071, 0.1639858, 0.165073, 
+    0.1609458, 0.1570887, 0.1733034, 0.1754312, 0.174106, 0.1761086, 
+    0.180278, 0.1807026, 0.1690371, 0.1715597, 0.1735135, 0.1529972, 
+    0.1491329, 0.1452413, 0.1704442, 0.1661207, 0.1627326, 0.1784918, 
+    0.1776706, 0.1736342, 0.173457, 0.1697119, 0.1692021, 0.1438615, 
+    0.1433771, 0.1408377, 0.1599263, 0.1545115, 0.1549845, 0.1704183, 
+    0.1652213, 0.1649592, 0.1668992, 0.1686076, 0.1720167, 0.1408773, 
+    0.143125, 0.1423426, 0.1523266, 0.1515496, 0.152986, 0.1650627, 
+    0.1655363, 0.1645259, 0.171628, 0.1737596, 0.1745078, 0.1426373, 
+    0.1454382, 0.1491868, 0.1541699, 0.1574278, 0.1583546, 0.168814, 
+    0.1652257, 0.1593018, 0.1736458, 0.1679257, 0.1633575, 0.1511276, 
+    0.1509706, 0.1503545, 0.1592737, 0.1570367,
+  0.1246863, 0.1219536, 0.1190693, 0.1254627, 0.1242086, 0.1250418, 
+    0.1255953, 0.1275962, 0.1277172, 0.125637, 0.1281339, 0.1270378, 
+    0.1196316, 0.1160785, 0.1148444, 0.1260579, 0.1257013, 0.1256686, 
+    0.1269731, 0.1279412, 0.1275063, 0.1273239, 0.1279111, 0.1283612, 
+    0.1137424, 0.1128109, 0.1135152, 0.1258531, 0.124796, 0.1229969, 
+    0.1284424, 0.1306434, 0.1328965, 0.1276713, 0.1271854, 0.127332, 
+    0.1134498, 0.1130523, 0.1143744, 0.1231111, 0.1248598, 0.1247131, 
+    0.1345185, 0.1356363, 0.1344033, 0.129937, 0.130238, 0.1296404, 
+    0.1142002, 0.1173661, 0.1196253, 0.1246305, 0.1247103, 0.12595, 0.133165, 
+    0.1293872, 0.1263612, 0.1306048, 0.1269332, 0.1248906, 0.1234029, 
+    0.1297777, 0.1319967, 0.1270217, 0.1287481, 0.1298174, 0.1254088, 
+    0.1243806, 0.1233314, 0.1230178, 0.124957, 0.1239709, 0.1349693, 
+    0.1414731, 0.1424994, 0.1305704, 0.1315547, 0.1321315, 0.1223826, 
+    0.1238686, 0.1242745, 0.1270712, 0.1288312, 0.1327871, 0.1432531, 
+    0.1444277, 0.1453653, 0.1316171, 0.1340172, 0.1343308, 0.1268829, 
+    0.1317597, 0.1342965, 0.1356966, 0.1389286, 0.1411946, 0.1464154, 
+    0.1480325, 0.1483928, 0.1361819, 0.1413696,
+  0.160341, 0.1635033, 0.1621206, 0.1515452, 0.1585005, 0.1614555, 0.1398125, 
+    0.1423866, 0.1456765, 0.1396807, 0.139869, 0.140501, 0.1608388, 
+    0.1609773, 0.1592907, 0.1621868, 0.1657887, 0.1668044, 0.1475483, 
+    0.1514947, 0.1539889, 0.1411643, 0.1427867, 0.1441789, 0.1590194, 
+    0.1573306, 0.1560811, 0.1664279, 0.1654406, 0.161945, 0.155193, 
+    0.1538208, 0.1558266, 0.1454617, 0.1457111, 0.1464898, 0.1561266, 
+    0.1546205, 0.1530069, 0.1604971, 0.1599716, 0.1587257, 0.1572253, 
+    0.1547799, 0.1563955, 0.1479519, 0.1481985, 0.1510885, 0.1519727, 
+    0.153555, 0.153074, 0.1562887, 0.1563622, 0.1575526, 0.1564805, 
+    0.1550865, 0.1581646, 0.150941, 0.1534169, 0.1538319, 0.1540512, 
+    0.1600211, 0.1630145, 0.1586583, 0.159132, 0.1585571, 0.159025, 
+    0.1616082, 0.1572852, 0.1535651, 0.1535514, 0.1523865, 0.16494, 
+    0.1675206, 0.162421, 0.1588283, 0.1540163, 0.150922, 0.1515824, 
+    0.1472509, 0.1467513, 0.1512851, 0.1503641, 0.1486479, 0.1594772, 
+    0.1596295, 0.1619115, 0.1486044, 0.1501469, 0.1547556, 0.1452666, 
+    0.1414726, 0.1406678, 0.1460992, 0.139055, 0.1331514, 0.1642474, 
+    0.1722728, 0.1703433, 0.157058, 0.158688,
+  0.2219688, 0.2192966, 0.218588, 0.2278748, 0.2287727, 0.2268884, 0.2317646, 
+    0.242741, 0.2434133, 0.2411369, 0.2510195, 0.2544318, 0.213603, 
+    0.2101426, 0.2105355, 0.2253622, 0.223389, 0.2198058, 0.2472358, 
+    0.2482178, 0.2502292, 0.2557815, 0.2563511, 0.2557927, 0.2095963, 
+    0.2095486, 0.2101364, 0.2169804, 0.213447, 0.2082549, 0.251557, 
+    0.2455387, 0.2386892, 0.2533324, 0.2465655, 0.2405316, 0.2056717, 
+    0.1949571, 0.1913736, 0.207105, 0.2046446, 0.2040785, 0.2327742, 
+    0.2237252, 0.2179521, 0.233891, 0.2224127, 0.2150826, 0.1896309, 
+    0.1904342, 0.1875363, 0.205963, 0.2023262, 0.2032399, 0.2127466, 
+    0.2095153, 0.2096834, 0.2132701, 0.2085732, 0.2064312, 0.185988, 
+    0.1858601, 0.1831141, 0.2041567, 0.2011562, 0.1985588, 0.2100198, 
+    0.2120034, 0.2087582, 0.208389, 0.2103929, 0.2097145, 0.1810902, 
+    0.1777561, 0.1766852, 0.1945111, 0.1896358, 0.1884039, 0.2032826, 
+    0.1960589, 0.196144, 0.2109251, 0.2105203, 0.2097526, 0.1750808, 
+    0.1778845, 0.1771683, 0.1862403, 0.1858459, 0.1862284, 0.194868, 
+    0.1928691, 0.1948864, 0.2109767, 0.2136056, 0.2148038, 0.1746529, 
+    0.1728472, 0.1708699, 0.1868666, 0.185789,
+  0.2351467, 0.2232926, 0.2187398, 0.2140746, 0.2072348, 0.2054752, 
+    0.1987498, 0.1946953, 0.1908217, 0.206033, 0.2007624, 0.1971389, 
+    0.2156579, 0.2155334, 0.2131321, 0.2041002, 0.207699, 0.2126335, 
+    0.1915473, 0.1976223, 0.2025083, 0.1971653, 0.2009866, 0.2022992, 
+    0.2176784, 0.2228633, 0.2187544, 0.214001, 0.2185877, 0.2140497, 
+    0.2061231, 0.2065106, 0.2014224, 0.2072845, 0.206794, 0.2046946, 
+    0.2145764, 0.2025695, 0.1916149, 0.2092959, 0.1983277, 0.1910123, 
+    0.1984383, 0.1941958, 0.193971, 0.2023256, 0.2020953, 0.1957219, 
+    0.1837536, 0.1737093, 0.1683474, 0.1846378, 0.1777872, 0.1723011, 
+    0.1912805, 0.1863299, 0.1861476, 0.1910618, 0.189579, 0.1911637, 
+    0.1660194, 0.1663002, 0.1632531, 0.1726962, 0.1692982, 0.1692332, 
+    0.1866185, 0.185738, 0.183803, 0.1944554, 0.1878936, 0.1843572, 
+    0.1645128, 0.1611739, 0.1654865, 0.1674676, 0.1732864, 0.1793182, 
+    0.1782852, 0.1799644, 0.1806711, 0.1824575, 0.1812101, 0.1796821, 
+    0.1727975, 0.1810001, 0.1790856, 0.1820909, 0.1839266, 0.1824702, 
+    0.1802306, 0.1785491, 0.1783706, 0.1801679, 0.1798219, 0.1800515, 
+    0.1782534, 0.1707326, 0.165179, 0.1780285, 0.1716749,
+  0.2328141, 0.2253507, 0.2235527, 0.2561473, 0.2486514, 0.2459111, 0.280061, 
+    0.2749005, 0.2761213, 0.3008731, 0.2998164, 0.2962229, 0.2184264, 
+    0.2138063, 0.209667, 0.2384951, 0.2267841, 0.2254802, 0.2729947, 
+    0.2731359, 0.2619722, 0.2914295, 0.2903389, 0.2793564, 0.206498, 
+    0.2038189, 0.2029108, 0.2194337, 0.2103137, 0.2083619, 0.2561122, 
+    0.2471438, 0.2428971, 0.2763221, 0.2657825, 0.2653511, 0.1990098, 
+    0.1978013, 0.1951801, 0.2082962, 0.1985353, 0.1937048, 0.2407465, 
+    0.2322109, 0.2296394, 0.2653607, 0.2673402, 0.2678256, 0.1939786, 
+    0.187762, 0.1823819, 0.1911756, 0.1887725, 0.1853522, 0.2262627, 
+    0.225146, 0.2273801, 0.2677045, 0.2643768, 0.2698668, 0.1837924, 
+    0.1829629, 0.1794883, 0.1842971, 0.182448, 0.1830351, 0.2240176, 
+    0.225499, 0.2245524, 0.2692265, 0.2637211, 0.2574579, 0.1825373, 
+    0.1837556, 0.1818831, 0.1876919, 0.1920198, 0.1933108, 0.2221532, 
+    0.2253574, 0.2200859, 0.2534838, 0.248567, 0.2446133, 0.1823702, 
+    0.1832367, 0.1770775, 0.197365, 0.1954164, 0.1967893, 0.2205968, 
+    0.2237628, 0.2201617, 0.24115, 0.2416659, 0.2385316, 0.1788117, 
+    0.1795344, 0.175938, 0.1973906, 0.1963828,
+  0.204444, 0.2072698, 0.2067574, 0.2176633, 0.2135747, 0.2178392, 0.2335735, 
+    0.2299278, 0.2262418, 0.2236743, 0.2212161, 0.2159656, 0.2084925, 
+    0.2021631, 0.2008516, 0.2226151, 0.2189734, 0.2158672, 0.2217481, 
+    0.2190054, 0.2204123, 0.2130173, 0.2136159, 0.2142838, 0.2027153, 
+    0.206304, 0.2081103, 0.2174216, 0.2124261, 0.2099107, 0.2184698, 
+    0.2157317, 0.2140991, 0.219043, 0.2140676, 0.2128523, 0.2107146, 
+    0.2122156, 0.2090498, 0.2133374, 0.2115416, 0.2058555, 0.2109797, 
+    0.2048368, 0.2043152, 0.2105579, 0.2080344, 0.2062403, 0.2067657, 
+    0.2013219, 0.200346, 0.2065167, 0.2008361, 0.1984873, 0.2001425, 
+    0.2000109, 0.1979567, 0.2059634, 0.2031755, 0.2030543, 0.1996704, 
+    0.1920203, 0.1821725, 0.1973005, 0.1906978, 0.1843055, 0.197426, 
+    0.1928427, 0.1902122, 0.2033072, 0.2016314, 0.1979146, 0.1774764, 
+    0.1716716, 0.1653709, 0.1831256, 0.1775313, 0.1754184, 0.1897976, 
+    0.186005, 0.1863624, 0.1977658, 0.1952214, 0.1950417, 0.1671808, 
+    0.1680032, 0.1682307, 0.1742246, 0.1789841, 0.1745003, 0.1895942, 
+    0.18645, 0.1821378, 0.1953169, 0.1920279, 0.1882636, 0.1707138, 
+    0.1733059, 0.1777821, 0.1737445, 0.1800582,
+  0.1874763, 0.1854456, 0.1814247, 0.1976035, 0.1998249, 0.1943721, 0.181789, 
+    0.1794651, 0.1787239, 0.1732308, 0.1759064, 0.1783534, 0.1802338, 
+    0.1753629, 0.1733582, 0.1895151, 0.1836687, 0.1836294, 0.1798311, 
+    0.1776651, 0.1788806, 0.1808146, 0.1874484, 0.1917937, 0.1724441, 
+    0.175578, 0.1767362, 0.1828668, 0.1839954, 0.1871086, 0.1845045, 
+    0.1909551, 0.1983147, 0.195524, 0.2031294, 0.2073578, 0.1791757, 
+    0.1824039, 0.1865295, 0.1908334, 0.1931793, 0.1944435, 0.2044816, 
+    0.2137128, 0.2177168, 0.2139698, 0.2200673, 0.2263955, 0.1917258, 
+    0.1921584, 0.1917933, 0.2003127, 0.2016572, 0.2016441, 0.2196665, 
+    0.2220605, 0.2207931, 0.2291016, 0.2282213, 0.2269297, 0.1951355, 
+    0.1926471, 0.1904399, 0.2039793, 0.2054035, 0.2021953, 0.226084, 
+    0.2211898, 0.2169362, 0.2291686, 0.2223285, 0.2205108, 0.192067, 
+    0.1860932, 0.1825772, 0.1986128, 0.19397, 0.1925947, 0.2149823, 
+    0.2083118, 0.2072918, 0.2146216, 0.2106358, 0.2068996, 0.1826895, 
+    0.1812841, 0.1783689, 0.1925931, 0.1915429, 0.1877338, 0.2053726, 
+    0.2062912, 0.2117327, 0.2081459, 0.2069673, 0.2057144, 0.1760216, 
+    0.1741731, 0.1701998, 0.1882237, 0.187264,
+  0.1639496, 0.1595451, 0.156531, 0.1652171, 0.1610244, 0.1591977, 0.1557436, 
+    0.1509242, 0.147754, 0.145687, 0.1427514, 0.1401382, 0.155261, 0.1537484, 
+    0.1506867, 0.1573244, 0.1542185, 0.1504657, 0.1449548, 0.139431, 
+    0.1368212, 0.1376683, 0.1318312, 0.1290433, 0.1428579, 0.1331931, 
+    0.1306754, 0.1459978, 0.1365148, 0.1328484, 0.1346847, 0.129936, 
+    0.1305152, 0.1280837, 0.1281873, 0.1286501, 0.1295359, 0.1266263, 
+    0.12501, 0.1320954, 0.1341981, 0.1366763, 0.1332892, 0.141581, 0.1454187, 
+    0.1322034, 0.1391025, 0.1443336, 0.1230571, 0.1240539, 0.1252189, 
+    0.1361701, 0.1384341, 0.1381979, 0.1478914, 0.1534673, 0.1557051, 
+    0.1472054, 0.1534983, 0.1586755, 0.1258428, 0.131171, 0.1332238, 
+    0.1397339, 0.1444615, 0.1440398, 0.1596013, 0.1657794, 0.167528, 0.16337, 
+    0.1698887, 0.1687638, 0.1377382, 0.146675, 0.1497508, 0.1477413, 
+    0.155737, 0.1595023, 0.1687649, 0.1701479, 0.1669537, 0.1701636, 
+    0.1695872, 0.1655654, 0.1530678, 0.1561455, 0.1565032, 0.1594906, 
+    0.1585625, 0.1550934, 0.1625452, 0.1582287, 0.1546297, 0.1649762, 
+    0.1584144, 0.1544651, 0.1558895, 0.1566933, 0.156946, 0.1553478, 0.1537159,
+  0.1353782, 0.1312087, 0.1292458, 0.1426762, 0.1361229, 0.1328902, 
+    0.1535928, 0.1433089, 0.1388196, 0.1573098, 0.146523, 0.1389918, 
+    0.1245651, 0.1150763, 0.109313, 0.1279398, 0.1192965, 0.1135766, 
+    0.1309429, 0.1231705, 0.1198923, 0.1323208, 0.1258093, 0.1217002, 
+    0.1040016, 0.1016777, 0.09872911, 0.1067144, 0.1047865, 0.1015466, 
+    0.1154291, 0.1124931, 0.1088241, 0.1172297, 0.1116155, 0.1078881, 
+    0.09788425, 0.09889922, 0.0999926, 0.09980367, 0.1035499, 0.1045499, 
+    0.1056143, 0.1055134, 0.1063924, 0.1026411, 0.1048483, 0.107031, 
+    0.1008385, 0.09706043, 0.09352417, 0.1052834, 0.09941827, 0.09489581, 
+    0.1068266, 0.1028343, 0.09999228, 0.1077049, 0.1068426, 0.1064215, 
+    0.08877205, 0.08181074, 0.08057696, 0.09097475, 0.08514158, 0.08170754, 
+    0.09858683, 0.09541271, 0.09283178, 0.1056114, 0.09951932, 0.09540126, 
+    0.07911389, 0.07714377, 0.07695907, 0.08063359, 0.07975329, 0.08066572, 
+    0.09082519, 0.08779536, 0.08894471, 0.09267303, 0.09253707, 0.09651057, 
+    0.07706194, 0.0776449, 0.07805382, 0.08135448, 0.08540493, 0.08491925, 
+    0.09154148, 0.09411108, 0.09483948, 0.09866248, 0.1024592, 0.1038351, 
+    0.07768513, 0.07748754, 0.07787821, 0.08415257, 0.08371783,
+  0.1382949, 0.1450226, 0.148034, 0.1351843, 0.1423517, 0.1455969, 0.1269834, 
+    0.1332947, 0.1362588, 0.1188061, 0.1254395, 0.128265, 0.1504975, 
+    0.1513442, 0.1490947, 0.148807, 0.149872, 0.1480099, 0.1397791, 
+    0.1434865, 0.1443396, 0.1318148, 0.1365135, 0.1382835, 0.1487013, 
+    0.1486881, 0.1485823, 0.146389, 0.1456712, 0.1477453, 0.1452807, 
+    0.1472689, 0.1519227, 0.1412855, 0.1469412, 0.151781, 0.1509573, 
+    0.1542943, 0.1552909, 0.1527777, 0.1558307, 0.1582843, 0.154592, 
+    0.1606407, 0.1639641, 0.1554668, 0.1610759, 0.1626997, 0.1541734, 
+    0.1541477, 0.1518399, 0.1604304, 0.1583867, 0.1580848, 0.1672571, 
+    0.1651968, 0.1613963, 0.1653595, 0.1633147, 0.1615627, 0.1508166, 
+    0.1512521, 0.1531667, 0.1548624, 0.1537739, 0.1559115, 0.1594255, 
+    0.1581944, 0.1571706, 0.1596704, 0.1558136, 0.156253, 0.1532934, 
+    0.1551352, 0.156336, 0.1558671, 0.1586895, 0.160724, 0.158261, 0.158468, 
+    0.1603837, 0.1562793, 0.1582433, 0.1591779, 0.1579367, 0.1617875, 
+    0.1627547, 0.1620818, 0.1650384, 0.1638088, 0.1614345, 0.1611486, 
+    0.1601361, 0.1606927, 0.1607834, 0.1580767, 0.1616362, 0.1614227, 
+    0.1611511, 0.1609218, 0.158991,
+  0.1428538, 0.1445044, 0.1425923, 0.1426579, 0.1413944, 0.1407125, 
+    0.1364104, 0.1366594, 0.1363738, 0.132962, 0.1319296, 0.1338147, 
+    0.1429807, 0.1430847, 0.1434638, 0.1399993, 0.1414684, 0.1439629, 
+    0.1383283, 0.1417851, 0.1464691, 0.1367006, 0.1418087, 0.1424577, 
+    0.1437016, 0.145293, 0.1442515, 0.1449031, 0.1476569, 0.1505536, 
+    0.1447543, 0.1483661, 0.1524974, 0.1446298, 0.1466715, 0.147372, 
+    0.1469412, 0.1494225, 0.1517926, 0.1527238, 0.156586, 0.158306, 
+    0.1534151, 0.1582753, 0.1619965, 0.1515539, 0.1578692, 0.1613436, 
+    0.1536035, 0.1559664, 0.1576068, 0.1609645, 0.1624408, 0.166122, 
+    0.1647256, 0.1710236, 0.174675, 0.1640714, 0.1686623, 0.1714816, 
+    0.158515, 0.162247, 0.1654732, 0.1683774, 0.1704258, 0.1733287, 
+    0.1775742, 0.1817226, 0.1841532, 0.1710595, 0.1750595, 0.1757429, 
+    0.1682188, 0.173983, 0.1759125, 0.1771324, 0.1809456, 0.1844898, 0.18458, 
+    0.1847741, 0.1817765, 0.1773918, 0.1762646, 0.1798744, 0.1793412, 
+    0.1851471, 0.1884616, 0.1861663, 0.1875532, 0.1855837, 0.1784803, 
+    0.1789475, 0.1800691, 0.1757767, 0.1791561, 0.1790625, 0.1870868, 
+    0.1856772, 0.1812662, 0.1849439, 0.1827552,
+  0.1114668, 0.1117572, 0.1137109, 0.1123473, 0.1090506, 0.1091674, 
+    0.1066714, 0.1048104, 0.1053871, 0.1061258, 0.1047961, 0.1042288, 
+    0.1143955, 0.1188063, 0.1245094, 0.1099888, 0.116806, 0.1214506, 
+    0.1079257, 0.1128635, 0.1143611, 0.1051767, 0.1077919, 0.110173, 
+    0.1251327, 0.1245165, 0.1238515, 0.1247278, 0.1264436, 0.1277844, 
+    0.1194365, 0.1244638, 0.1256402, 0.1139666, 0.1197496, 0.119506, 
+    0.1252479, 0.1245234, 0.1231315, 0.1282175, 0.1265963, 0.1276615, 
+    0.1240689, 0.1243562, 0.1256312, 0.1186379, 0.1200207, 0.1232827, 
+    0.1222743, 0.1204777, 0.119525, 0.1248277, 0.1259445, 0.1263142, 
+    0.1279189, 0.1308628, 0.1350332, 0.1256219, 0.1326889, 0.1359928, 
+    0.1201318, 0.1232656, 0.1298773, 0.1284368, 0.132803, 0.1360237, 
+    0.1384837, 0.1423043, 0.1415664, 0.1382871, 0.1405343, 0.1397824, 
+    0.131799, 0.1329814, 0.1332365, 0.1354107, 0.1343369, 0.1333424, 
+    0.1415186, 0.1380852, 0.1352166, 0.1379745, 0.1361696, 0.1341835, 
+    0.1328081, 0.1331753, 0.1347166, 0.1341383, 0.1334959, 0.1333819, 
+    0.1316389, 0.1315629, 0.1319548, 0.1327208, 0.1304544, 0.1307182, 
+    0.1372361, 0.1406366, 0.1418632, 0.1364852, 0.1397609,
+  0.1602387, 0.1568671, 0.1544906, 0.1440604, 0.1443709, 0.1444191, 
+    0.1284406, 0.1277434, 0.1277922, 0.128046, 0.1280519, 0.1289813, 
+    0.1534733, 0.150717, 0.1503597, 0.1430183, 0.140761, 0.1419737, 
+    0.1285734, 0.1308771, 0.1329144, 0.1288784, 0.1297022, 0.130541, 
+    0.1495953, 0.1486224, 0.1488258, 0.1436143, 0.1437625, 0.1431728, 
+    0.1346518, 0.1323624, 0.1311874, 0.1310046, 0.1309152, 0.1293972, 
+    0.1491942, 0.1499555, 0.1462928, 0.1411681, 0.1367763, 0.1327885, 
+    0.1286456, 0.1237259, 0.1212917, 0.1249014, 0.1192282, 0.1162069, 
+    0.1431972, 0.1392267, 0.1355784, 0.1299733, 0.1258703, 0.1229684, 
+    0.1187575, 0.1165072, 0.1165477, 0.1147363, 0.1145243, 0.1140298, 
+    0.1292798, 0.1212466, 0.1181903, 0.1211085, 0.1172793, 0.1165111, 
+    0.1171926, 0.12089, 0.1232592, 0.1144994, 0.1198958, 0.1221344, 
+    0.1154956, 0.1157786, 0.1169998, 0.1167669, 0.1212647, 0.1224213, 
+    0.1242012, 0.1284865, 0.1284122, 0.121344, 0.1229231, 0.1232181, 
+    0.1210874, 0.1234303, 0.1256993, 0.125475, 0.1273831, 0.1284126, 
+    0.1291642, 0.1268377, 0.1245345, 0.1226114, 0.1213361, 0.119859, 
+    0.1271431, 0.1290349, 0.1276836, 0.1264341, 0.1261583,
+  0.1050755, 0.1062234, 0.1061448, 0.1020185, 0.1024253, 0.1032896, 
+    0.1002943, 0.1006925, 0.09957704, 0.1066907, 0.1065698, 0.1051571, 
+    0.1051281, 0.102196, 0.1024118, 0.1017433, 0.0991314, 0.09848049, 
+    0.09843103, 0.09766504, 0.097927, 0.1028765, 0.1005712, 0.09923952, 
+    0.1022633, 0.1039979, 0.1044579, 0.09935891, 0.1015145, 0.1021418, 
+    0.0987502, 0.1016327, 0.1025257, 0.09918553, 0.1010293, 0.1031687, 
+    0.1070372, 0.1116234, 0.1150643, 0.1051012, 0.1092137, 0.1112501, 
+    0.1051245, 0.1050213, 0.1061022, 0.1046324, 0.1060196, 0.1071381, 
+    0.120111, 0.1264709, 0.1298779, 0.1138941, 0.1209193, 0.1252851, 
+    0.107301, 0.1093941, 0.11171, 0.1071246, 0.1096588, 0.1118321, 0.1347528, 
+    0.1393142, 0.1410836, 0.127227, 0.1311932, 0.1327865, 0.114323, 
+    0.1208021, 0.1235724, 0.1144281, 0.1190242, 0.1206391, 0.1444131, 
+    0.145172, 0.1450475, 0.1341155, 0.1370124, 0.1383893, 0.1265653, 
+    0.1283886, 0.1298017, 0.1235624, 0.1282434, 0.1312317, 0.1427317, 
+    0.1436867, 0.1469251, 0.1394262, 0.1414875, 0.1459295, 0.1314368, 
+    0.1366657, 0.1385289, 0.1311646, 0.1338378, 0.1359334, 0.1485552, 
+    0.1532829, 0.1562486, 0.1476973, 0.1523531,
+  0.1915207, 0.1905512, 0.1891114, 0.1900187, 0.1928829, 0.1920616, 
+    0.1788477, 0.1781291, 0.1769752, 0.1696773, 0.169655, 0.1701644, 
+    0.187976, 0.1816119, 0.1834482, 0.192444, 0.1906275, 0.1885915, 
+    0.1794916, 0.1827076, 0.1870105, 0.1739968, 0.1799391, 0.1853353, 
+    0.1876314, 0.1864454, 0.1837543, 0.1892748, 0.1923203, 0.1959099, 
+    0.1907911, 0.1988162, 0.2028057, 0.191971, 0.199615, 0.2028668, 0.184936, 
+    0.1882321, 0.1896854, 0.1986764, 0.2011138, 0.2025274, 0.2051796, 
+    0.203412, 0.2006076, 0.1991198, 0.2001319, 0.1999938, 0.1910143, 
+    0.192018, 0.1954547, 0.2032, 0.2045579, 0.2040587, 0.2031571, 0.2026904, 
+    0.2030691, 0.198571, 0.2013117, 0.2038108, 0.1976015, 0.2067915, 
+    0.2086159, 0.2026002, 0.2071473, 0.2082788, 0.2025556, 0.2026761, 
+    0.1998926, 0.2030682, 0.2004396, 0.1965656, 0.2099271, 0.2168364, 
+    0.2195687, 0.2093928, 0.2117628, 0.2133301, 0.1996985, 0.197555, 
+    0.1922587, 0.1934512, 0.192504, 0.1924015, 0.2211165, 0.2104659, 
+    0.2051557, 0.2137458, 0.205901, 0.2018786, 0.1900305, 0.1892061, 
+    0.1922204, 0.1943211, 0.2013324, 0.2001679, 0.2019928, 0.1955626, 
+    0.1910436, 0.1977003, 0.1956208,
+  0.1786886, 0.1833761, 0.182936, 0.167746, 0.1711043, 0.1717877, 0.1562743, 
+    0.1560527, 0.1590466, 0.1480945, 0.1545533, 0.1568717, 0.1813385, 
+    0.1727088, 0.1717167, 0.1711712, 0.1689125, 0.165551, 0.1609344, 
+    0.1642672, 0.1635927, 0.1605262, 0.1660524, 0.1657453, 0.1678452, 
+    0.1642451, 0.1616925, 0.1640777, 0.1643642, 0.1623019, 0.163319, 
+    0.1677254, 0.1734749, 0.1641901, 0.1677097, 0.1693747, 0.1598094, 
+    0.1555314, 0.1559358, 0.1617846, 0.1613723, 0.1613546, 0.1744929, 
+    0.1762118, 0.1798715, 0.1715388, 0.1774809, 0.1809742, 0.1538051, 
+    0.1546992, 0.1531337, 0.1675038, 0.1709409, 0.170484, 0.1796484, 
+    0.1820846, 0.1844894, 0.1858571, 0.1907896, 0.1913448, 0.1550318, 
+    0.1598441, 0.156537, 0.1721136, 0.1702973, 0.1705465, 0.1889088, 
+    0.181659, 0.1813747, 0.1922163, 0.1849335, 0.1813839, 0.1604174, 
+    0.1618205, 0.162083, 0.1688964, 0.1680832, 0.1637787, 0.1786449, 
+    0.1716461, 0.16596, 0.1759826, 0.1694941, 0.1653446, 0.1609978, 
+    0.1657248, 0.1669308, 0.1632226, 0.1610157, 0.1619247, 0.1615189, 
+    0.1582473, 0.1569887, 0.1638287, 0.1625439, 0.1635265, 0.1712507, 
+    0.179959, 0.1799442, 0.1672631, 0.1770737,
+  0.2190626, 0.2161675, 0.2124575, 0.2151826, 0.2086686, 0.2061593, 
+    0.2064152, 0.2034399, 0.1979037, 0.2011914, 0.192725, 0.1907427, 
+    0.206601, 0.2032417, 0.2026785, 0.2008825, 0.1951693, 0.1938006, 
+    0.1935272, 0.1936183, 0.1935009, 0.1886067, 0.190855, 0.1953703, 
+    0.2006611, 0.1967442, 0.1991313, 0.1929758, 0.1959505, 0.1954374, 
+    0.1948512, 0.203792, 0.2057316, 0.1947606, 0.2063612, 0.2107576, 
+    0.2026935, 0.2014569, 0.2010473, 0.1977097, 0.1999278, 0.1992519, 
+    0.2057605, 0.2057374, 0.2046032, 0.2137366, 0.2117251, 0.2107314, 
+    0.1978284, 0.1996669, 0.2012285, 0.202851, 0.2026321, 0.2026318, 
+    0.2057471, 0.2081716, 0.2079574, 0.2091661, 0.2094062, 0.2091158, 
+    0.1973222, 0.1981285, 0.1977272, 0.2027561, 0.2015419, 0.1968763, 
+    0.2093275, 0.2066158, 0.2043409, 0.2050741, 0.2039009, 0.2029746, 
+    0.1941545, 0.190312, 0.1831876, 0.1987242, 0.1962608, 0.1952614, 
+    0.2027334, 0.1972917, 0.2024268, 0.2021926, 0.1986063, 0.2034607, 
+    0.181661, 0.1801108, 0.1811988, 0.1904286, 0.1912836, 0.1912515, 
+    0.2080938, 0.2137125, 0.224667, 0.2090217, 0.2226768, 0.2244089, 
+    0.1799948, 0.1855928, 0.1905904, 0.1959832, 0.2028412,
+  0.2363871, 0.2310137, 0.2275852, 0.2397519, 0.2378715, 0.2391831, 0.270887, 
+    0.2670993, 0.2654123, 0.2675422, 0.2742962, 0.2755051, 0.2293099, 
+    0.233057, 0.2325758, 0.2442331, 0.247789, 0.2447284, 0.2689262, 
+    0.2779264, 0.2778774, 0.2780661, 0.2794837, 0.2799218, 0.2292865, 
+    0.223557, 0.2233916, 0.2446221, 0.2425748, 0.2424671, 0.2795719, 
+    0.2866049, 0.2844692, 0.2829563, 0.2805229, 0.2772895, 0.228307, 
+    0.2256315, 0.2290545, 0.2481035, 0.2468491, 0.2458177, 0.2804992, 
+    0.2848791, 0.2817129, 0.2751534, 0.2799759, 0.2863012, 0.2313857, 
+    0.2375565, 0.2440142, 0.2485435, 0.2558631, 0.2578455, 0.2849799, 
+    0.2769746, 0.273105, 0.2868959, 0.2846403, 0.2828279, 0.2495223, 
+    0.255291, 0.2502186, 0.2611667, 0.2678204, 0.2652672, 0.2677513, 
+    0.2659397, 0.2641079, 0.2783761, 0.2705274, 0.2651047, 0.2500214, 
+    0.2407222, 0.2320614, 0.2642207, 0.2563878, 0.2503784, 0.2596502, 
+    0.2562346, 0.2570219, 0.2645656, 0.2599223, 0.255474, 0.2288296, 
+    0.2171425, 0.2138653, 0.2479661, 0.2364154, 0.2348483, 0.2546183, 
+    0.2554798, 0.2620098, 0.2596889, 0.2651418, 0.2680561, 0.2138027, 
+    0.2154066, 0.2126942, 0.2365976, 0.2433262,
+  0.2273601, 0.2264391, 0.2249806, 0.2255498, 0.2239716, 0.225776, 0.2341366, 
+    0.2271899, 0.2237888, 0.2365928, 0.2294157, 0.2291263, 0.2244227, 
+    0.2252293, 0.2251894, 0.2243496, 0.2264393, 0.2273743, 0.2253674, 
+    0.224435, 0.226916, 0.2306219, 0.2329614, 0.2306426, 0.2281481, 
+    0.2254229, 0.2233813, 0.2320441, 0.2302232, 0.2302986, 0.2316897, 
+    0.2338728, 0.237324, 0.2318275, 0.2308813, 0.2316375, 0.2269405, 
+    0.2279114, 0.2335363, 0.2294652, 0.2329853, 0.2355096, 0.237585, 
+    0.2372299, 0.2394412, 0.2318557, 0.2359824, 0.2397066, 0.2362248, 
+    0.2384186, 0.2411703, 0.2406262, 0.2446066, 0.2434119, 0.2428299, 
+    0.2489082, 0.2499716, 0.2461069, 0.2535728, 0.2554342, 0.2422964, 
+    0.2410934, 0.2357847, 0.2438002, 0.246578, 0.2471658, 0.2526763, 
+    0.2536096, 0.2476416, 0.2481783, 0.2420948, 0.2422484, 0.2351049, 
+    0.2339057, 0.2263373, 0.2454067, 0.2410341, 0.2382855, 0.2404874, 
+    0.2374443, 0.2392842, 0.239357, 0.2421721, 0.2457046, 0.2251948, 
+    0.2222316, 0.2207261, 0.2368596, 0.2343885, 0.2265344, 0.2401103, 
+    0.2402156, 0.2356424, 0.2496521, 0.2496633, 0.2449977, 0.2161435, 
+    0.211295, 0.2062158, 0.2196096, 0.217275,
+  0.1833392, 0.1814924, 0.1803719, 0.1779939, 0.1768701, 0.176074, 0.1634538, 
+    0.1678145, 0.1710857, 0.1644397, 0.1675935, 0.1695061, 0.1830664, 
+    0.1833141, 0.1823932, 0.1813454, 0.1878084, 0.1877795, 0.1772014, 
+    0.1823444, 0.1833619, 0.1713593, 0.1746094, 0.1751955, 0.1816076, 
+    0.1776618, 0.1789077, 0.1878611, 0.1857078, 0.1825854, 0.1847088, 
+    0.1824234, 0.1797517, 0.1735295, 0.1732109, 0.1722764, 0.1811599, 
+    0.180442, 0.178427, 0.1818759, 0.1808412, 0.1791587, 0.178409, 0.1767042, 
+    0.1759668, 0.1732458, 0.1743387, 0.1759574, 0.1789876, 0.1809032, 
+    0.1813175, 0.179189, 0.1849938, 0.1870098, 0.1775593, 0.183135, 
+    0.1853722, 0.1773289, 0.1833863, 0.1853209, 0.184155, 0.18352, 0.1796999, 
+    0.1892099, 0.1900401, 0.1876739, 0.1882673, 0.1859271, 0.1835845, 
+    0.1846513, 0.1807886, 0.1759426, 0.1806132, 0.1761451, 0.1756252, 
+    0.1861437, 0.1846994, 0.1806708, 0.1805478, 0.1782488, 0.1746423, 
+    0.1748901, 0.1683411, 0.162845, 0.1711306, 0.1672867, 0.1652438, 
+    0.1796088, 0.1778824, 0.1749175, 0.1725637, 0.1698459, 0.1680615, 
+    0.1605286, 0.1572239, 0.1567249, 0.163386, 0.1595778, 0.1579816, 
+    0.1756621, 0.1677156,
+  0.1768353, 0.1704365, 0.1662122, 0.170723, 0.1668689, 0.1620558, 0.1627614, 
+    0.1571805, 0.1536792, 0.1574781, 0.1557824, 0.151551, 0.1634641, 
+    0.158519, 0.1565732, 0.1578867, 0.1537219, 0.1524752, 0.1521743, 
+    0.1523545, 0.1517183, 0.1499506, 0.1510862, 0.1499685, 0.1531481, 
+    0.1518757, 0.149415, 0.1521942, 0.1532604, 0.1532426, 0.1546461, 
+    0.1554156, 0.1561447, 0.1512384, 0.1552559, 0.156931, 0.1491171, 
+    0.1478736, 0.1456751, 0.1537527, 0.1523206, 0.1502036, 0.1552065, 
+    0.1527256, 0.1532962, 0.1574454, 0.160001, 0.1599603, 0.1456407, 
+    0.1426908, 0.139314, 0.1497785, 0.1473956, 0.1457293, 0.1549507, 
+    0.1572608, 0.1574807, 0.1613142, 0.1583218, 0.1542286, 0.139235, 
+    0.1382236, 0.1372044, 0.1475934, 0.1460287, 0.1456109, 0.1560339, 
+    0.1503131, 0.1460616, 0.1498879, 0.1413872, 0.1363711, 0.1380679, 
+    0.1366222, 0.1371197, 0.1445503, 0.1424511, 0.1413202, 0.1424686, 
+    0.1437623, 0.1440656, 0.1349784, 0.1398705, 0.1434058, 0.138155, 
+    0.1375185, 0.1402052, 0.1415428, 0.1436862, 0.1436375, 0.144942, 
+    0.1449981, 0.1463917, 0.1430753, 0.1459787, 0.150064, 0.1418546, 
+    0.1447684, 0.1497619, 0.1454354, 0.149112,
+  0.1233806, 0.1299262, 0.1329367, 0.1281853, 0.1356412, 0.1379512, 
+    0.1329578, 0.1425893, 0.1468584, 0.1334201, 0.1453158, 0.1492854, 
+    0.1328756, 0.1306882, 0.1301605, 0.1370767, 0.1355338, 0.1321272, 
+    0.1446117, 0.1415721, 0.1392124, 0.1503075, 0.1456869, 0.143813, 
+    0.1303605, 0.1271376, 0.1209919, 0.1317295, 0.1305591, 0.1253362, 
+    0.1381487, 0.1354873, 0.1300382, 0.1400403, 0.1343057, 0.1309104, 
+    0.1169696, 0.1072834, 0.1040777, 0.1214785, 0.1125156, 0.1067991, 
+    0.1209835, 0.1080683, 0.1026791, 0.1213782, 0.1082171, 0.1063813, 
+    0.1044694, 0.09722704, 0.0961274, 0.1016289, 0.09655076, 0.09794204, 
+    0.1007176, 0.1026715, 0.1038659, 0.1067826, 0.1079552, 0.1073005, 
+    0.09593774, 0.09795097, 0.09939069, 0.1004332, 0.1028993, 0.1029212, 
+    0.1028891, 0.1009039, 0.09836306, 0.1023176, 0.09687418, 0.09234102, 
+    0.09733045, 0.09784158, 0.09686849, 0.1021902, 0.1000225, 0.09701466, 
+    0.09519687, 0.08951161, 0.08669902, 0.088146, 0.08186313, 0.07960083, 
+    0.09664916, 0.09513067, 0.09237097, 0.0942224, 0.0887329, 0.0881855, 
+    0.08329523, 0.08116913, 0.08005256, 0.07773824, 0.07640599, 0.07517501, 
+    0.0910221, 0.08911258, 0.08775266, 0.08715925, 0.08547039,
+  0.1688406, 0.1710348, 0.171356, 0.1672868, 0.1718615, 0.1727286, 0.1633426, 
+    0.1644738, 0.1644144, 0.1661194, 0.1670091, 0.1660045, 0.1718054, 
+    0.1682719, 0.1654034, 0.1748282, 0.1699753, 0.1676045, 0.1658645, 
+    0.1670622, 0.1647154, 0.1662265, 0.1661081, 0.165916, 0.1615234, 
+    0.1551331, 0.1514707, 0.1645463, 0.1607642, 0.1564291, 0.1634826, 
+    0.1587933, 0.1555076, 0.1627442, 0.158357, 0.155075, 0.1489802, 
+    0.1424965, 0.1399803, 0.1511063, 0.1454895, 0.1420271, 0.1513158, 
+    0.1447111, 0.1437266, 0.1521958, 0.1472662, 0.1482003, 0.1372176, 
+    0.1331309, 0.1292118, 0.1412891, 0.1362127, 0.1305578, 0.1437601, 
+    0.1430719, 0.1433737, 0.150409, 0.1526376, 0.1560405, 0.1252463, 
+    0.1210408, 0.1199998, 0.1261948, 0.123648, 0.1241905, 0.1430184, 
+    0.1435985, 0.1426001, 0.1581886, 0.1569205, 0.15503, 0.1197255, 
+    0.1180008, 0.1192861, 0.126414, 0.1271208, 0.1281044, 0.1430035, 
+    0.1451576, 0.1436733, 0.1498344, 0.1410937, 0.1336634, 0.1188039, 
+    0.1202592, 0.1214578, 0.1255444, 0.1264641, 0.1251924, 0.1382788, 
+    0.125625, 0.1243998, 0.1295239, 0.126437, 0.1259565, 0.1198862, 
+    0.1209796, 0.1250039, 0.1273838, 0.1288886 ;
+
+ area = 0.000138535035537854, 0.000138063242676441, 5.51133351740581e-05, 
+    0.000350351563033784, 0.000349283468177034, 0.000139459179024405, 
+    0.000356644999159883, 0.000355762606968429, 0.000142093741826655, 
+    0.000144164429551706, 0.000143858593374666, 5.74698205985682e-05, 
+    0.000137512973925224, 0.00013709691415187, 5.47414700454348e-05, 
+    0.000348032852535342, 0.000347084025582322, 0.000138611239906833, 
+    0.000354720920990366, 0.000353924965687112, 0.000141382596205829, 
+    0.000143495040191689, 0.000143215599555958, 5.72202057728467e-05, 
+    0.000136621526727059, 0.000136270294293906, 5.44275208617861e-05, 
+    0.000345996716970601, 0.000345191311810852, 0.000137891406276323, 
+    0.000353007300225509, 0.000352323972686935, 0.0001407720046366, 
+    0.000142891821216884, 0.000142649689936032, 5.70038865267309e-05, 
+    0.000135879563900365, 0.000135599984935344, 5.41776043392406e-05, 
+    0.000344293376801085, 0.000343649664097871, 0.000137316047087783, 
+    0.000351558750150899, 0.000351008077914795, 0.000140279905662028, 
+    0.000142377566253734, 0.000142181139436531, 5.68283813074782e-05, 
+    0.000135301131646374, 0.000135098141809231, 5.39961435185002e-05, 
+    0.000342960495355738, 0.000342491775166504, 0.000136897078836035, 
+    0.000350416658918027, 0.00035001335752274, 0.00013991948065301, 
+    0.000141969647815823, 0.000141825125025086, 5.66992425861007e-05, 
+    0.000134896237903517, 0.000134773166429464, 5.38861220302414e-05, 
+    0.00034202508027183, 0.000341740372763005, 0.000136642583755051, 
+    0.000349610968386061, 0.000349365092423242, 0.000139699736350274, 
+    0.000141680693775172, 0.000141592327806752, 5.66202794187052e-05, 
+    0.000134671432986883, 0.000134630200066165, 5.3849260799652e-05, 
+    0.000341504897264425, 0.000341409424936482, 0.000136557241461346, 
+    0.000349161509538827, 0.000349078910701538, 0.00013962591475864, 
+    0.000141519098339092, 0.000141489371108393, 5.65937148161597e-05, 
+    0.000134630200066165, 0.000134671432986883, 5.38861220302414e-05, 
+    0.000341409424936482, 0.000341504897264425, 0.000136642583755051, 
+    0.000349078910701538, 0.000349161509538827, 0.000139699736350274, 
+    0.000141489371108393, 0.000141519098339092, 5.66202794187052e-05, 
+    0.000134773166429464, 0.000134896237903517, 5.39961435185002e-05, 
+    0.000341740372763005, 0.00034202508027183 ;
+
+ lat = -43.1880092162786, -43.4251557914009, -43.5630005995731, 
+    -42.3612436665401, -42.5978863344025, -42.7354642114613, 
+    -41.0266990661296, -41.2621122848379, -41.399016975171, 
+    -40.2038645450768, -40.4382645514851, -40.5746054270778, 
+    -43.6942519279646, -43.8927912645738, -44.0070271956363, 
+    -42.8664791346531, -43.0646938085549, -43.1787609186728, 
+    -41.5294192763691, -41.7267599148945, -41.8403528927482, 
+    -40.7044880945559, -40.9010746810136, -41.0142512786351, 
+    -44.1148510165636, -44.2758447890606, -44.3670849826627, 
+    -43.286437451671, -43.4472331078255, -43.5383726205395, 
+    -41.9476012104333, -42.1077924196086, -42.1986079661906, 
+    -41.1211183292902, -41.2807615219073, -41.3712778144978, 
+    -44.4520614974551, -44.5763786122228, -44.6451168488014, 
+    -43.6232629149409, -43.7474670128113, -43.8161494525006, 
+    -42.2832086436371, -42.4070101005765, -42.4754806567305, 
+    -41.4556071611961, -41.5790245116986, -41.6472892415569, 
+    -44.7077067917174, -44.7960227295218, -44.842633221219, 
+    -43.8786927360161, -43.9669495608533, -44.0135320282192, 
+    -42.5378376701362, -42.625842470155, -42.6722970285562, 
+    -41.7094629044609, -41.7972155906693, -41.8435402072463, 
+    -44.8831777701286, -44.9359746369799, -44.960712147569, 
+    -44.0540539833997, -44.1068239163782, -44.1315497755592, 
+    -42.7127105890533, -42.765343372397, -42.7900065290456, 
+    -41.8838424889767, -41.9363328110146, -41.9609301708143, 
+    -44.9794330895693, -44.9969999412459, -45, -44.1502623106946, 
+    -44.1678215955947, -44.1708203932499, -42.8086722728506, 
+    -42.8261881688884, -42.8291796067501, -41.9795465246935, 
+    -41.9970163922116, -42, -44.9969999412459, -44.9794330895693, 
+    -44.960712147569, -44.1678215955947, -44.1502623106946, 
+    -44.1315497755592, -42.8261881688884, -42.8086722728506, 
+    -42.7900065290456, -41.9970163922116, -41.9795465246935, 
+    -41.9609301708143, -44.9359746369799, -44.8831777701286, 
+    -44.842633221219, -44.1068239163782, -44.0540539833997 ;
+
+ lon = 339.82917960675, 341.17082039325, 342, 339.82917960675, 
+    341.17082039325, 342, 339.82917960675, 341.17082039325, 342, 
+    339.82917960675, 341.17082039325, 342, 342.82917960675, 344.17082039325, 
+    345, 342.82917960675, 344.17082039325, 345, 342.82917960675, 
+    344.17082039325, 345, 342.82917960675, 344.17082039325, 345, 
+    345.82917960675, 347.17082039325, 348, 345.82917960675, 347.17082039325, 
+    348, 345.82917960675, 347.17082039325, 348, 345.82917960675, 
+    347.17082039325, 348, 348.82917960675, 350.17082039325, 351, 
+    348.82917960675, 350.17082039325, 351, 348.82917960675, 350.17082039325, 
+    351, 348.82917960675, 350.17082039325, 351, 351.82917960675, 
+    353.17082039325, 354, 351.82917960675, 353.17082039325, 354, 
+    351.82917960675, 353.17082039325, 354, 351.82917960675, 353.17082039325, 
+    354, 354.82917960675, 356.17082039325, 357, 354.82917960675, 
+    356.17082039325, 357, 354.82917960675, 356.17082039325, 357, 
+    354.82917960675, 356.17082039325, 357, 357.82917960675, 359.17082039325, 
+    360, 357.82917960675, 359.17082039325, 360, 357.82917960675, 
+    359.17082039325, 360, 357.82917960675, 359.17082039325, 360, 
+    0.829179606750063, 2.17082039324994, 3, 0.829179606750063, 
+    2.17082039324994, 3, 0.829179606750063, 2.17082039324994, 3, 
+    0.829179606750063, 2.17082039324994, 3, 3.82917960675006, 
+    5.17082039324993, 6, 3.82917960675006, 5.17082039324993 ;
+
+ time = 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365, 396, 424, 
+    455, 485, 516, 546, 577, 608, 638, 669, 699, 730, 761, 789, 820, 850, 
+    881, 911, 942, 973, 1003, 1034, 1064, 1095 ;
+
+ time_bnds =
+  0, 31,
+  31, 59,
+  59, 90,
+  90, 120,
+  120, 151,
+  151, 181,
+  181, 212,
+  212, 243,
+  243, 273,
+  273, 304,
+  304, 334,
+  334, 365,
+  365, 396,
+  396, 424,
+  424, 455,
+  455, 485,
+  485, 516,
+  516, 546,
+  546, 577,
+  577, 608,
+  608, 638,
+  638, 669,
+  669, 699,
+  699, 730,
+  730, 761,
+  761, 789,
+  789, 820,
+  820, 850,
+  850, 881,
+  881, 911,
+  911, 942,
+  942, 973,
+  973, 1003,
+  1003, 1034,
+  1034, 1064,
+  1064, 1095 ;
+}
diff --git a/debian/changelog b/debian/changelog
index 22d25b5..2efa2d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nco (4.6.4-1) unstable; urgency=low
+
+  * new upstream version splitter, stdin, clm_md=dly, cll_msr, frm_trm, cln=365 and srd fixes
+
+ -- Charlie Zender <zender at uci.edu>  Tue, 07 Feb 2017 12:25:18 -0700
+
 nco (4.6.3-1) unstable; urgency=low
 
   * new upstream version rebasing, long options, JSON brackets, udunits(), binary/annual climos
diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE
index 01b3e13..d1a0bca 100644
--- a/doc/ANNOUNCE
+++ b/doc/ANNOUNCE
@@ -1,117 +1,94 @@
 $Header$ -*-text-*-
 
-The netCDF Operators NCO version 4.6.3 are ready. 
+The netCDF Operators NCO version 4.6.4 are ready. 
 
 http://nco.sf.net (Homepage, Mailing lists)
 http://github.com/nco (Source Code, Releases, Developers)
 
 What's new?
 
-4.6.3 adds many new convenience features to existing functionality
-like JSON, ncap2, ncremap, and ncclimo. Multi-dimensional bracketing
-completes our JSON implementation. ncap2 adds a convenient UDUnits
-conversion function. ncremap and ncclimo support long options.
-ncclimo supports binary climatology generation and annual-mean mode. 
+The main new features in 4.6.4 are the "splitter" and daily
+climatology capabilities for ncclimo. ncclimo now generates,
+combines existing, and splits climatologies. Thus it is a
+fairly general purpose climatology operator. NCO now supports
+two more CF conventions (formula_terms and cell_measures),
+and has a few bugfixes.
 
-Work on NCO 4.6.4 has commenced. Planned improvements include CMake
-builds, more flexibility in handling extensive variables during
-regridding.
+Work on NCO 4.6.5 has commenced. Planned improvements include 
+support for conda installs on MS Windows, and more ncclimo
+and ncremap features.
 
 Enjoy,
 Charlie
 
 NEW FEATURES (full details always in ChangeLog):
 
-A. ncclimo supports "binary climos" and annual-mean mode.
-   Binary climos are climos created from merging two climos, rather
-   than re-computing a climos from raw input. 
-   This saves disk space and time for long climos.
-   Annual-mean mode allows ncclimo to process input files that are
-   annual rather than monthly means.
+A. ncclimo will reshape timeseries, i.e., split input datasets into
+   per-variable files that span the entire timeseries.
+   Input files are specified via stdin, via positional arguments
+   (after all options) on the command-line, or as the set of .nc files
+   in drc_in 
+   ls $drc_in/*.nc | ncclimo -v T,Q --output=drc_out --map=rgr_map
+   ncclimo -v T,Q --output=drc_out --map=rgr_map < list
+   ncclimo -v T,Q --output=drc_out --map=rgr_map $drc_in/*.nc
+   ncclimo -v T,Q --input=$drc_in --output=drc_out --map=rgr_map
    http://nco.sf.net/nco.html#ncclimo
 
-B. ncrcat and ncra now re-base data (move to a common time origin)
-   from arbitrary time units in multiple calendar systems.
-   Previously, re-basing only worked when the basetime (i.e., the 
-   YYMMDD in units like "XXX since YYMMDD") changed.
-   Now rebasing takes into account the full units, both the increment
-   (XXX) and the basetime (YYMMDD). Thanks to Dave Allured for the
-   suggestion and Henry Butowsky for the re-implementation.
-   http://nco.sf.net/nco.html#rbs
-
-C. ncap2 now supports converting data between any two compatible units
-   systems supported by UDUnits. The udunits() function takes and
-   input variable and a UDUnits dimension string.
-   T[lon]={0.0,100.0,150.0,200.0};
-   T at units="Celsius";
-   T=udunits(T,"kelvin"); 
-   print(T);  
-   273.15, 373.15, 423.15, 473.15 ;
-   The method auto-magically reads var_in at units and var_in at calendar 
-   (so, YES, this works with dates) attributes as necessary.
-   Thanks to Henry Butowsky for this feature.
-   http://nco.sf.net/nco.html#udunits_fnc
-
-D. ncclimo and ncremap now support long options, e.g., 
-   ncclimo --case=caseid --input=drc_in --output=drc_out --map=rgr_map
-   ncremap --input_file=in_fl --destination=dst_fl --output_file=out_fl
-   http://nco.sf.net/nco.html#ncclimo
+A. ncks allows setting per-variable chunk cache-size with --cnk_csh. 
+   The effects of varying chunk cache-size are not well understood,
+   at least by we who work on NCO. Users asked for a knob to tune
+   it, and now that exists. Experiment with this and if you find
+   reasons for NCO to set this to non-default values, let us know.
+   If you want more knobs, let us know.
+   This setting only works on netCDF4 files.
+   ncks -D 3 --cnk_csh 1000000 in.nc4 out.nc
+   http://nco.sf.net/nco.html#cnk_csh
+
+A. ncremap now includes staggered grid weights with FV grid output. 
+   The weights are named w_stag, following the CESM CAM convention. 
    http://nco.sf.net/nco.html#ncremap
 
-E. ncclimo and ncremap now save the full command line with which they
-   were invoked as a single global attribute. 
-   Previously portions were saved as separate attributes.
-   The new attributes are climo_command and remap_command.
-   Their contents will exactly replicate (except for datestamps)
-   the climatologies or regridded files they were created for.
-   This improved provenance comes at the cost of up to a few kB more
-   metadata in each file.
-
-F. ncks can now print attribute CDL types as comments.
-   CDL attribute types can be hard for humans to discern, so now
-   ncks will print the type when invoked with -D 1 or greater.
-   The printed file is fully CDL-compliant and works with ncgen.
-   Credit to whomever first thought of this feature, and implemented
-   it in some CDL output someone sent me.
-   zender at firn:~/nco$ ncks -D 1 -C --cdl ~/nco/data/in_4.nc
-   ...
-   att_var:byte_att = 0b, 1b, 2b, 127b, -128b, -127b, -2b, -1b ; // byte
-   att_var:char_att = "Sentence one.\n",
-      "Sentence two.\n" ; // char
-   att_var:short_att = 37s ; // short
-   att_var:int_att = 73 ; // int
-   att_var:float_att = 73.f, 72.f, 71.f, 70.01f, 69.001f, 68.01f, 67.01f ; // float
-   att_var:double_att = 73., 72., 71., 70.01, 69.001, 68.01, 67.010001 ; // double
-   att_var:ubyte_att = 0ub, 1ub, 2ub, 127ub, 128ub, 254ub, 255ub, 0ub ; // ubyte
-   att_var:ushort_att = 37us ; // ushort
-   att_var:uint_att = 73ul ; // uint
-
-G. JSON brackets
-   Similar the CDL and XML backends, ncks supports JSON (as of 4.6.2).
-   ncks now prints strided brackets to demarcate inner dimensions
-   of multi-dimensional variable data.  
-   Invoking with --json vs. --jsn_fmt=4 on foo(2,3,4) yields:
-   "data": [[[0.0, 1.0, 2.0, 3.0], [4.0, 5.0, 6.0, 7.0], [8.0, 9.0,
-   10.0, 11.0]], [[12.0, 13.0, 14.0, 15.0], [16.0, 17.0, 18.0, 19.0],
-   [20.0, 21.0, 22.0, 23.0]]] 
-   "data": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
-   11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0,
-   22.0, 23.0] 
-   Bracketed data are suitable for pasting into Python. 
-   More sample output at:
-   http://dust.ess.uci.edu/tmp/in.json and other *.json files.
-   Thanks to Henry Butowsky for implementing the bracketing.
-   http://nco.sf.net/nco.html#json
+A. Variables listed in a formula_terms attribute are now extracted
+   by default. Turn-off this behavior with --no_frm_trm.
+   The CF formula_terms convention is used to associate variables
+   with terms in defined formulas, such as vertical coordinates:
+   lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate"
+   lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS"
+   Unless the default behavior is overridden, NCO attaches any 
+   formula variables to the extraction list along with the primary
+   variable and other associated variables. By definition, formula
+   variables are a subset of the rank of the variable they define.
+   http://nco.sf.net/nco.html#frm_trm
+
+A. Variables listed in a cell_measures attribute are now extracted
+   by default. Turn-off this behavior with --no_cll_msr.
+   This convention allows variables to indicate which other variables 
+   contains area or volume information about a gridcell.
+   These measures variables are pointed to by the cell_measures
+   attribute. Unless the default behavior is overridden, NCO attaches
+   all measures variables to the extraction list along with the
+   primary variable.
+   http://nco.sf.net/nco.html#cll_msr
 
 BUG FIXES:
 
-A. None!
+A. Fix bug introduced in 4.6.3 where hyperslabs involving UDUnits
+   dates could fail, depending on exactly how NCO was compiled.
+   Failures most likely on MacOS because clang, unlike gcc, does not
+   initialize pointers to NULL by default. Solution is to upgrade.
+
+A. Fix bug introduced in ~4.4.6 where some hyperslabs of non-unity 
+   stride in netCDF4 files could return incorrect values.
+   If you use the hyperslab stride argument on netCDF4 files, we
+   suggest you upgrade immediately. The workaround is to convert
+   to netCDF3 before using a strided hyperslab. 
+   Thanks to Martin Dix for reporting this bug.
 
 KNOWN PROBLEMS DUE TO NCO:
 
    This section of ANNOUNCE reports and reminds users of the
    existence and severity of known, not yet fixed, problems. 
-   These problems occur with NCO 4.6.3 built/tested under
+   These problems occur with NCO 4.6.4 built/tested under
    MacOS 10.12.1 with netCDF 4.4.1 on HDF5 1.8.16 and with
    Linux with netCDF 4.4.2-development (20161116) on HDF5 1.8.16.
 
diff --git a/doc/ChangeLog b/doc/ChangeLog
index a0f3d65..ae55be4 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,5 +1,194 @@
+2017-02-07  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.4 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4 final changes';git push
+	git tag -a 4.6.4 -m 'Version 4.6.4 new features: splitter, stdin, clm_md=dly, cll_msr, frm_trm, cln=365 and srd fixes';git push --tags
+
+	* NCO 4.6.4-beta02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-beta02 final changes';git push
+	git tag -a 4.6.4-beta02 -m 'Version 4.6.4-beta02 new features: deprecate USE_NC4_SRD_WORKAROUND';git push --tags
+
+2017-02-06 Henry Butowsky  <henryb at hush.com>
+
+	* Switched-off USE_NC4_SRD_WORKAROUND in nco_msa_rcr_clc() in nco_msa.c as algorithm was incorrect
+
+2017-02-01  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.4-beta01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-beta01 final changes';git push
+	git tag -a 4.6.4-beta01 -m 'Version 4.6.4-beta01 new features: ncclimo stdin option, redirection, blues batch, calendar bugfix';git push --tags
+
+	* Calendar code is MUCH slower on MacOS than Linux, unclear why
+
+	* Henry made sscanf() in custom calendar routines be more fault-tolerant, fixes MacOS aborts
+
+2017-01-27  Charlie Zender  <zender at uci.edu>
+
+	* ncclimo improve shell pattern match for $HOSTNAME for blues and cooley
+
+	* ncclimo detect input redirection in interactive mode, and add	--stdin for batch mode
+
+2017-01-26  Charlie Zender  <zender at uci.edu>
+
+	* Learned that MacOS aborts due to custom calendar (e.g., 365_day) handling
+
+2017-01-25  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.4-alpha06 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha06 final changes';git push
+	git tag -a 4.6.4-alpha06 -m 'Version 4.6.4-alpha06 new features: cell_measures, clm_md=dly, stdin PBS/SLURM';git push --tags
+
+	* Unable to reproduce MacOS behavior that leads to unexpected aborts with some time hyperslabs
+
+	* Update bld/Makefile for new ncap2_att.cc
+
+	* Conclusively demonstrated that testing [ -p /dev/stdin ] leads to unexpected results on PBS not SLURM
+
+2017-01-23  Charlie Zender  <zender at uci.edu>
+
+	* Henry eliminated an invalid read in nco_cln_prs_tm() that contributed to ncclimo hyperslab failures on MacOS
+
+2017-01-22  Charlie Zender  <zender at uci.edu>
+
+	* ncclimo omit gaa_sng from regrid commands, since gaa_sng is in files to regrid
+
+	* ncclimo daily mode fix parallelization
+
+	* ncclimo implement daily climatology. commands look good. date hyperslab fails on MacOS.
+
+	* ncclimo allow clm_md='dly' to read input from stdin, positional, or directory glob
+
+	* ncsplit fix directory glob for split-mode
+
+2017-01-20  Charlie Zender  <zender at uci.edu>
+
+	* Implement stubs for clm_md='dly'
+
+	* Document cell_measures and formula_terms
+
+	* Add --cll_msr/--no_cll_msr and --frm_trm/--no_frm_trm to subsetting operators
+
+	* ncks adds/suppresses cell_measures in regridded output with --rgr cll_msr/no_cll_msr
+
+2017-01-19  Charlie Zender  <zender at uci.edu>
+
+	* ncremap change standard_name of area_nm_out from cell_area to area
+
+	* Extract variables in CF "cell_measures" attributes
+
+	* Add areacella to in.cdl in preparation for adding CF cell_measures variables to extraction list
+
+	* NCO 4.6.4-alpha05 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha05 final changes';git push
+	git tag -a 4.6.4-alpha05 -m 'Version 4.6.4-alpha05 new features: fix stdin detection, var_xtr_xtn';git push --tags
+
+	* Rewrite stdin pipe data detection in ncclimo, ncremap
+	Fixes bug running in batch mode where disconnected terminal caused scripts to expect input from stdin pipe
+
+	* ncsplit remove lat/lon from automatic extraction for CAM (only present in regridded files)
+
+	* ncsplit change old gnr_flg to new clm_flg so climatology-generation mode is consistent
+
+2017-01-18  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.4-alpha04 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha04 final changes';git push
+	git tag -a 4.6.4-alpha04 -m 'Version 4.6.4-alpha04 new features: tidy warnings, UDUnits fix, w_stag, split doc, formula_terms';git push --tags
+
+	* Verify formula_terms-based extractions work
+
+2017-01-17  Charlie Zender  <zender at uci.edu>
+
+	* Extract variables in CF "formula_terms" attributes
+
+	* Fix attributes in hdn.cdl
+
+2017-01-16  Charlie Zender  <zender at uci.edu>
+
+	* Squelch warning about deflation with netCDF3 output when dfl_lvl == 0
+
+2017-01-13  Charlie Zender  <zender at uci.edu>
+
+	* Verified ncremap produces identical w_stag weights to those in
+	b.e11.BRCP26C5CNBDRD.f09_g16.1pt5degC.001.cam.h0.AODVIS.200601-210012.nc
+
+	* Add staggered latitude weight w_stag to FV output grids (since NCAR CCSM4 AMIP does)
+
+	* Print offending multi-argument when input error found
+
+	* ZKB in UDUnits code after fixing skyglow UDUnits installation
+
+2017-01-12  Charlie Zender  <zender at uci.edu>
+
+	* Fix all compiler warnings in nco_cln_utl.[ch]
+
+	* Fix bug introduced in 4.6.3 where hyperslabs involving UDUnits dates failed
+
+	* Document ncsplit
+
+2016-01-12  Henry Butowsky  <henryb at hush.com>
+
+	* Add exit(value) function to ncap2 scripting. 'value' propagates from script to code using custom Exception.
+	Value is then returned by ncap2 main().
+
+2017-01-11  Charlie Zender  <zender at uci.edu>
+
+	* NCO 4.6.4-alpha03 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha03 final changes';git push
+	git tag -a 4.6.4-alpha03 -m 'Version 4.6.4-alpha03 new features: ncsplit segments work';git push --tags
+
+	* ncsplit: Verified working on 250-year ACME beta simulation
+
+	* ncsplit: Comment-out old Git hash code which fails with split files anyway
+
+	* ncsplit: Sanity check that number of files on command line matches number predicted by date switches
+
+	* ncsplit: Add outer loop over time segments
+
+	* ncsplit: Fix parallel partial batch PID wait loop to enumerate over variables not files
+
+2016-01-10  Henry Butowsky  <henryb at hush.com>
+
+	* modify min_coord() to take and return an array of values (var or att)
+
+2017-01-08  Charlie Zender  <zender at uci.edu>
+
+	* ncsplit: Customize stdout messages
+
+2017-01-07  Charlie Zender  <zender at uci.edu>
+
+	* ncsplit: Split whenever input files are positional or from stdin or --ypf given
+
+	* ncsplit: Add regridding
+
+	* ncsplit: Add batch parallelism and --job_nbr
+
+	* NCO 4.6.4-alpha02 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha02 final changes';git push
+	git tag -a 4.6.4-alpha02 -m 'Version 4.6.4-alpha02 new features: ncsplit, cnk_csh';git push --tags
+
+	* Set/report chunk cache size in ncks (only) main(), not cnk_ini() when input file is netCDF4
+
+	* ncsplit: Add error-checking on input file number
+
+2017-01-03  Charlie Zender  <zender at uci.edu>
+
+	* Crude ncsplit-functionality works in ncclimo
+
+	* Fix cmd_mpi index error in ncremap
+
+2017-01-02  Charlie Zender  <zender at uci.edu>
+
+	* Implement ncsplit stubs in ncclimo
+
+	* Enumerate MPI commands by fl_idx not clm_idx in ncremap
+
 2016-12-23  Charlie Zender  <zender at uci.edu>
 
+	* NCO 4.6.4-alpha01 release procedure:
+	cd ~/nco;git commit -a -m 'Version 4.6.4-alpha01 final changes';git push
+	git tag -a 4.6.4-alpha01 -m 'Version 4.6.4-alpha01 new features: 2017 dates. Otherwise same as 4.6.3';git push --tags
+
 	* NCO 4.6.3 release procedure:
 	cd ~/nco;git commit -a -m 'Version 4.6.3 final changes';git push
 	git tag -a 4.6.3 -m 'Version 4.6.3 new features: rebasing, long options, JSON brackets, udunits(), binary/annual climos';git push --tags
diff --git a/doc/TODO b/doc/TODO
index 8cdf927..5d71675 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -252,11 +252,11 @@ nco514. MPI builds call superfluous linker steps:
 nco516. Implement SDO-wide data pipes, e.g., ncra in*.nc | ncwa | ncrename t,tpt foo.nc
         This would bring us one step closer to grid services, too
 nco527. Purify ncatted memory: 
-        valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,,c,f,74 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
-        valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a char_att,att_var,a,c,"and appended Sentence three,with,lots,of,commas" -a short_att,att_var,c,s,37,38,39 -a float_att,att_var,d,,, -a long_att,att_var,o,l,37 -a new_att,att_var,o,d,73,74,75 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
-        valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,,a,f,74,75,76 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+        valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,,c,f,74 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+        valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a char_att,att_var,a,c,"and appended Sentence three,with,lots,of,commas" -a short_att,att_var,c,s,37,38,39 -a float_att,att_var,d,,, -a long_att,att_var,o,l,37 -a new_att,att_var,o,d,73,74,75 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+        valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,,a,f,74,75,76 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
 # Commas at end of following aed_sct appear never to be free()'d, are responsible for three unfree'd bytes
-        valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,att_var,d,,, -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+        valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncatted -D 5 -O -a float_att,att_var,d,,, -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
 nco533. Implement C99 mathematical special functions: lgamma_r, j0, j1, jn, y0, y1, yn
 nco542. Put batch scripts, executables in ${DATA}/nco_bm/CASEID? Where to put created files
 nco546. Use makeatletter command in CCSM example in nco.texi?
@@ -358,8 +358,8 @@ nco756. thr: Make nco_ddra() thread-safe
 nco757. ncbo bug: works with --mmr_drt, fails with --mmr_cln
 	ncwa -O -a time -p ~/nco/data in.nc ~/foo_avg.nc
 	ncbo --mmr_cln -O -D 1 ~/nco/data/in.nc ~/foo_avg.nc ~/foo.nc
-	valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo --mmr_cln -O ~/nco/data/in.nc ~/foo_avg.nc ~/foo.nc > ~/foo 2>&1
-	valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo --mmr_cln -O -v one_dmn_rec_var ~/nco/data/in.nc ~/foo_avg.nc ~/foo.nc > ~/foo 2>&1
+	valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo --mmr_cln -O ~/nco/data/in.nc ~/foo_avg.nc ~/foo.nc > ~/foo 2>&1
+	valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo --mmr_cln -O -v one_dmn_rec_var ~/nco/data/in.nc ~/foo_avg.nc ~/foo.nc > ~/foo 2>&1
 nco757. Make sure above ncbo bug is not in ncflint
 nco759. Document --mmr_cln flag
 nco761. mpi: Merge timer srt/end calls to MPI codes
@@ -692,7 +692,12 @@ nco1132. nco: ncclimo fails when input files have different variable orders. All
 nco1133. ncks CDL-mode do UDUnits time conversions to ISO (added 20161116)
 	 ncks -H -v tm_.? ~/nco/data/in.nc
 	 ncdump -t ~/nco/data/in.nc | grep tm_
-nco1134. 
+nco1134. MSA: wrapped limit with an additional limit pvn20160211 -- bug found that happens in nco 4.2.0 also
+	 ncks -O -C --msa -g g19 -v time -d time,9,0 -d time,1,2 ~/nco/data/in_grp_3.nc ~/foo.nc
+nco1135. USE_NC4_SRD_WORKAROUND is broken:
+	 ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in.nc # works
+      	 ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in_4c.nc # borken
+nco1136. 
 qrk
 ************************************************************************
 End ncoXXX TODOs
@@ -763,33 +768,33 @@ Begin valgrind section
 ************************************************************************
 Valgrind: Archive of valgrind tests which are memory-error and leak-free
 vg1. ncap
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncap -O -S ${HOME}/nco/data/ncap.in -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncap -O -S ${HOME}/nco/data/ncap.in -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
      ncap2
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncap2 -O -D 1 -S ~/nco/data/ncap2_tst.nco ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncap2 -O -D 1 -S ~/nco/data/ncap2_tst.nco ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
 vg2. ncbo
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo -t 2 -O -C -d lon,1 -p ${HOME}/nco/data -l /tmp in.nc in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncbo -t 2 -O -C -d lon,1 -p ${HOME}/nco/data -l /tmp in.nc in.nc ~/foo.nc > ~/foo 2>&1
 vg3. nces
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck nces -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck nces -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
 vg4. ncecat
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncecat -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncecat -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
 vg5. ncflint
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncflint -t 2 -O -C -d lon,1 -p ${HOME}/nco/data -l /tmp in.nc in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncflint -t 2 -O -C -d lon,1 -p ${HOME}/nco/data -l /tmp in.nc in.nc ~/foo.nc > ~/foo 2>&1
 vg6. ncks
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncks -O -C -d lat,1,1 -d lev,2,2 -d lon,0,3 -d lon,1,3 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncks -O -C -d lat,1,1 -d lev,2,2 -d lon,0,3 -d lon,1,3 -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
 vg7. ncpdq (re-order)
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncpdq -t 2 -O -D 3 -a lat,lev,lon -v three_dmn_var ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncpdq -t 2 -O -D 3 -a lat,lev,lon -v three_dmn_var ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
 vg8. ncpdq (pack)
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncpdq -t 2 -O -D 3 -P all_new -v three_dmn_var ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncpdq -t 2 -O -D 3 -P all_new -v three_dmn_var ~/nco/data/in.nc ~/foo.nc > ~/foo 2>&1
 vg9. ncra
-   valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncra -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one_dmn_rec_var_sng -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
+   valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncra -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one_dmn_rec_var_sng -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
 vg10. ncrcat
-    valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncrcat -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one_dmn_rec_var_sng -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
+    valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncrcat -t 2 -O -C -D 3 -d lon,1 -n 3,4,1 -v one_dmn_rec_var_sng -p ${HOME}/nco/data -l ${HOME}/nco/data h0001.nc ~/foo.nc > ~/foo 2>&1
 vg11. ncrename
-    valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncrename -O -D 3 -d lon,new_lon -v scalar_var,new_scalar_var -a long_name,new_long_name -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+    valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncrename -O -D 3 -d lon,new_lon -v scalar_var,new_scalar_var -a long_name,new_long_name -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
 vg12. ncwa
-    valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncwa -D 3 -t 2 -O -C -a lat,lon,time -w gw -m gw -v PS -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+    valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck ncwa -D 3 -t 2 -O -C -a lat,lon,time -w gw -m gw -v PS -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
     callgrind ncwa -D 3 -t 2 -O -C -w gw -m gw -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
-    valgrind --suppressions=${HOME}/nco/doc/valgrind.txt --tool=callgrind ncwa -D 3 -t 2 -O -C -a lat,lon,time -w gw -m gw -v PS -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
+    valgrind --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=callgrind ncwa -D 3 -t 2 -O -C -a lat,lon,time -w gw -m gw -v PS -p ${HOME}/nco/data -l /tmp in.nc ~/foo.nc > ~/foo 2>&1
     kcachegrind ncwa &
 ************************************************************************
 End valgrind section
@@ -810,7 +815,7 @@ Status 20050920:
    sand: Ubuntu, dual x86_64, LAM-MPI, gcc-4.0
 
 0. MPI with valgrind example
-   mpirun -np 3 /usr/bin/valgrind --leak-check=yes --show-reachable=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck mpirun -np 3 ${MY_BIN_DIR}/mpncbo -O -D 3 -p ${HOME}/nco/data in.nc in.nc ~/foo.nc > ~/foo 2>&1
+   mpirun -np 3 /usr/bin/valgrind --leak-check=yes --show-reachable=yes --track-origins=yes --suppressions=${HOME}/nco/doc/valgrind.txt --tool=memcheck mpirun -np 3 ${MY_BIN_DIR}/mpncbo -O -D 3 -p ${HOME}/nco/data in.nc in.nc ~/foo.nc > ~/foo 2>&1
 1. mpncbo
    mpirun -np 3 ${MY_BIN_DIR}/mpncbo -O -D 3 -p ${HOME}/nco/data in.nc in.nc ~/foo.nc > ~/foo 2>&1
 2. mpnces
diff --git a/doc/VERSION b/doc/VERSION
index 83da99b..ef36c9a 100644
--- a/doc/VERSION
+++ b/doc/VERSION
@@ -1 +1 @@
-4.6.3
+4.6.4
diff --git a/doc/debian.txt b/doc/debian.txt
index c013314..e4c7bd2 100644
--- a/doc/debian.txt
+++ b/doc/debian.txt
@@ -29,18 +29,18 @@ apt-get install dh-make debhelper devscripts fakeroot gnupg debian-policy develo
 
 2. Debian build procedure recommends placing entire package source in
    subdirectory of main package. 
-   For starters, we wish to create .debs of tagged releases, e.g., nco-4.6.3
-   First we create a clean source distribution of nco and place it in nco-4.6.3
+   For starters, we wish to create .debs of tagged releases, e.g., nco-4.6.4
+   First we create a clean source distribution of nco and place it in nco-4.6.4
    Until we know what is necessary, however, we just copy a snapshot
    
    2.1 Clean all build files from development directory
 
 cd ~/nco;make distclean;cd bld;make clean;cd ~
 tar cvzf ./nco/nco.tar.gz ./nco/*
-cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.6.3
-/bin/rm nco.tar.gz;tar cvzf nco-4.6.3.tar.gz ./nco-4.6.3/*
-cd ~/nco/nco-4.6.3
-dh_make -e zender at uci.edu -f ../nco-4.6.3.tar.gz
+cd ~/nco;tar xvzf nco.tar.gz;mv nco nco-4.6.4
+/bin/rm nco.tar.gz;tar cvzf nco-4.6.4.tar.gz ./nco-4.6.4/*
+cd ~/nco/nco-4.6.4
+dh_make -e zender at uci.edu -f ../nco-4.6.4.tar.gz
 
     2.2 The preceding steps created template debian files for a .deb,
     Those files now reside in ~/nco/debian.
@@ -55,7 +55,7 @@ dh_make -e zender at uci.edu -f ../nco-4.6.3.tar.gz
    from previous build
 
    cd ~/nco;/bin/rm *.gz
-   cd ~/nco/nco-4.6.3
+   cd ~/nco/nco-4.6.4
    dpkg-buildpackage -rfakeroot > foo 2>&1
    dpkg-buildpackage -rsudo > foo 2>&1
 
@@ -84,33 +84,33 @@ patch -p0 < nco_X.Y.Z-3.diff   # Patch destination with Debian diff
    make tags
 # Put cute version-specific string in nco_ctl.c:nco_nmn_get()
 # Install correct version numbers before updating Debian
-# tags-query replace 4.6.3 with X.Y.Z+1
+# tags-query replace 4.6.4 with X.Y.Z+1
 # If tags-query replace does not work, be sure to manually change
 # versions in configure.ac, debian/files, doc/ANNOUNCE, doc/debian.txt,
 # doc/index.shtml, doc/nco.texi, bld/nco_dst.pl, doc/VERSION
 # 20141201: Change NCO_VERSION_PATCH in src/nco.h!!!!!!!!!!!!!!!!!!!!!!
-   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.6.3-1 # Update changelog (-b forces this version number)
+   cd ~/nco/debian;dch -b --force-distribution --distribution=unstable -v 4.6.4-1 # Update changelog (-b forces this version number)
    emacs ~/nco/bld/nco.spec # Update changelog
 # For unknown reason rules file may lose its executable bit
    chmod a+x ~/nco/debian/rules
 # Rebuild autotools so new version # propagates
    cd ~/nco;aclocal;autoheader;automake --foreign;autoconf
 # Save all files in emacs before tagging
-   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.6.3
+   ${HOME}/nco/bld/nco_dst.pl --dbg=2 --bld --cln nco-4.6.4
 # Upload tarball to SF https://sourceforge.net/projects/nco/files 
-   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.6.3.tar.gz .
+   cd;scp dust.ess.uci.edu:/var/www/html/nco/src/nco-4.6.4.tar.gz .
 
 7. Ubuntu PPA
 https://help.launchpad.net/Packaging/PPA
-dput NCO nco_4.6.3-2~ppa1_source.changes
+dput NCO nco_4.6.4-2~ppa1_source.changes
 sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com
 
 # Location of build diagnostics for mentors to help 
-http://dust.ess.uci.edu/nco/src/nco_4.6.3-1.dpkg-buildpackage.txt
-http://dust.ess.uci.edu/nco/src/nco_4.6.3-1.dsc
-http://dust.ess.uci.edu/nco/src/nco_4.6.3-1_i386.changes
-http://dust.ess.uci.edu/nco/src/nco_4.6.3-1_i386.deb
-http://dust.ess.uci.edu/nco/src/nco_4.6.3.orig.tar.gz
+http://dust.ess.uci.edu/nco/src/nco_4.6.4-1.dpkg-buildpackage.txt
+http://dust.ess.uci.edu/nco/src/nco_4.6.4-1.dsc
+http://dust.ess.uci.edu/nco/src/nco_4.6.4-1_i386.changes
+http://dust.ess.uci.edu/nco/src/nco_4.6.4-1_i386.deb
+http://dust.ess.uci.edu/nco/src/nco_4.6.4.orig.tar.gz
 
 # Becoming a Debian developer
 http://www.debian.org/devel/join/newmaint
@@ -164,31 +164,31 @@ Matej Vela <vela at debian.org>, Daniel Baumann <daniel at debian.org>, Warren Turkal
 # export LD_LIBRARY_PATH=/usr/lib:/lib:/usr/X11R6/lib
 # sudo aptitude install antlr bison flex gsl-bin libgsl0-dev libantlr-dev netcdf-bin libnetcdfc7 libnetcdf-dev texinfo libcurl4-gnutls-dev libexpat1-dev libxml2-dev udunits-bin libudunits2-0 libudunits2-dev
 cd ~/nco;cvc
-sudo /bin/rm -rf ${DATA}/nco-4.6.3 ${DATA}/nco_4.6.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.6.3-1 -d nco-4.6.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.6.3 nco # Export most recent
-tar cvzf ./nco_4.6.3.orig.tar.gz --exclude='nco-4.6.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.3 
-/bin/rm -rf ${DATA}/nco-4.6.3 # Remove cvs-exported directory
-tar xvzf ./nco_4.6.3.orig.tar.gz # Untar to get directory without excluded files
-mkdir -p ${DATA}/nco-4.6.3/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.6.3/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.6.3/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
+sudo /bin/rm -rf ${DATA}/nco-4.6.4 ${DATA}/nco_4.6.4* ${DATA}/debian # Cleanup last build. sudo necessary for removal because dpkg-buildpackage uses sudo?
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.4-1 -d nco-4.6.4 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -d nco-4.6.4 nco # Export most recent
+tar cvzf ./nco_4.6.4.orig.tar.gz --exclude='nco-4.6.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.4 
+/bin/rm -rf ${DATA}/nco-4.6.4 # Remove cvs-exported directory
+tar xvzf ./nco_4.6.4.orig.tar.gz # Untar to get directory without excluded files
+mkdir -p ${DATA}/nco-4.6.4/debian/source;cd ~/nco/debian;/bin/cp changelog compat control convert copyright doc-base files info rules ${DATA}/nco-4.6.4/debian;cd ~/nco/debian/source;/bin/cp format ${DATA}/nco-4.6.4/debian/source # Replace debian directory with _CURRENT_ (main trunk) settings
 #export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-#cd ${DATA}/nco-4.6.3;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
-#cd ${DATA}/nco-4.6.3;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
-cd ${DATA}/nco-4.6.3;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
+#cd ${DATA}/nco-4.6.4;dpkg-buildpackage -rsudo -uc -us > ~/foo.nco 2>&1 # -uc -us: Do not sign changes or source files
+#cd ${DATA}/nco-4.6.4;dpkg-buildpackage -rsudo -sa > ~/foo.nco 2>&1 # -sa: Include _orig.tar.gz in .changes 
+cd ${DATA}/nco-4.6.4;dpkg-buildpackage -rsudo > ~/foo.nco 2>&1
 sudo dpkg --remove nco
-sudo dpkg --install ${DATA}/nco_4.6.3-1_*.deb
+sudo dpkg --install ${DATA}/nco_4.6.4-1_*.deb
 cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
 # http://lintian.debian.org/full/zender@uci.edu.html
-lintian ${DATA}/nco_4.6.3-1_*.deb
-ls -l ${DATA}/nco_4.6.3*
+lintian ${DATA}/nco_4.6.4-1_*.deb
+ls -l ${DATA}/nco_4.6.4*
 m ~/foo.nco
 # Upload Ubuntu (rather than Debian) packages to websites
-scp ${DATA}/nco_4.6.3* dust.ess.uci.edu:/var/www/html/nco/src
-scp ${DATA}/nco_4.6.3* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+scp ${DATA}/nco_4.6.4* dust.ess.uci.edu:/var/www/html/nco/src
+scp ${DATA}/nco_4.6.4* zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 # NB: Make sure RPMs build before uploading to debian, since changing
 # Debian versions is a PITA
 # NB: Only upload pbuilder Debian Sid (not personal Ubuntu) .deb builds to Debian mentors
-# cd ${DATA};dupload -t mentors nco_4.6.3-1_*.changes
+# cd ${DATA};dupload -t mentors nco_4.6.4-1_*.changes
 bsrc # Reset shell environment for regular development
 
 # New build system #2
@@ -202,52 +202,52 @@ DIST=sid sudo pbuilder update # Update chroot before building package in it
 # dget http://ftp.debian.org/debian/pool/main/n/nco/nco_3.9.0-1.dsc
 # dget http://ftp.debian.org/debian/pool/main/n/netcdf/netcdf_3.6.1-1.dsc
 # apt-get source nco # Get package source
-sudo /bin/rm /var/cache/pbuilder/result/nco_4.6.3* # Cleanup prior build
+sudo /bin/rm /var/cache/pbuilder/result/nco_4.6.4* # Cleanup prior build
 # To pass DEB_BUILD_OPTIONS to pbuilder while using sudo, one must first
 # modify sudoers with visudo to prevent sudo from resetting environment
 #export DEB_BUILD_OPTIONS='disable-dap-netcdf disable-netcdf4 disable-udunits2'; # Disable optional packages based on available Debian support
-cd ${DATA};DIST=sid sudo pbuilder build nco_4.6.3-1.dsc > ~/foo.nco.pbuilder 2>&1
-cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.6.3-1_*.changes
-lintian /var/cache/pbuilder/result/nco_4.6.3-1_*.deb
+cd ${DATA};DIST=sid sudo pbuilder build nco_4.6.4-1.dsc > ~/foo.nco.pbuilder 2>&1
+cd /var/cache/pbuilder/result;debsign -k6F635D10 nco_4.6.4-1_*.changes
+lintian /var/cache/pbuilder/result/nco_4.6.4-1_*.deb
 sudo dpkg --remove nco
-sudo dpkg --install /var/cache/pbuilder/result/nco_4.6.3-1_*.deb
+sudo dpkg --install /var/cache/pbuilder/result/nco_4.6.4-1_*.deb
 cd ~/nco/bld;MY_BIN_DIR=/usr/bin ../bm/nco_bm.pl --regress
 # NB: Upload pbuilder Debian Sid packages to Debian mentors, but not
 # to personal or NCO websites since most people use Ubuntu not Debian
 # NB: Debian versions are a PITA, ensure RPMs build before uploading to Debian
-cd /var/cache/pbuilder/result;dupload -t mentors nco_4.6.3-1_*.changes
+cd /var/cache/pbuilder/result;dupload -t mentors nco_4.6.4-1_*.changes
 
 # RPM builds as root
 export rpm_root='/usr/src/redhat'
 # export sudo_sng='' # sudo not-necessary when builing in user directories
 export sudo_sng='sudo' # sudo necessary when building in system directories
 cd ~/nco;cvc;cvu
-/bin/rm -rf ${DATA}/nco-4.6.3 ${DATA}/nco-4.6.3* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.6.4 ${DATA}/nco-4.6.4* # Cleanup last build
 ${sudo_sng} /bin/rm -r -f \
-${rpm_root}/BUILD/nco-4.6.3 \
-${rpm_root}/RPMS/i386/nco-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.3-?.i386.rpm \
-${rpm_root}/SOURCES/nco-4.6.3.tar.gz \
-${rpm_root}/SPECS/nco-4.6.3.spec \
-${rpm_root}/SRPMS/nco-4.6.3-?.src.rpm
-cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.3-1 -d nco-4.6.3 nco # Export based on tag
-${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.6.3.spec
-tar cvzf ./nco-4.6.3.tar.gz --exclude='nco-4.6.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.3 
-${sudo_sng} /bin/cp ${DATA}/nco-4.6.3.tar.gz ${rpm_root}/SOURCES
+${rpm_root}/BUILD/nco-4.6.4 \
+${rpm_root}/RPMS/i386/nco-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.4-?.i386.rpm \
+${rpm_root}/SOURCES/nco-4.6.4.tar.gz \
+${rpm_root}/SPECS/nco-4.6.4.spec \
+${rpm_root}/SRPMS/nco-4.6.4-?.src.rpm
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.4-1 -d nco-4.6.4 nco # Export based on tag
+${sudo_sng} ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/SPECS/nco-4.6.4.spec
+tar cvzf ./nco-4.6.4.tar.gz --exclude='nco-4.6.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.4 
+${sudo_sng} /bin/cp ${DATA}/nco-4.6.4.tar.gz ${rpm_root}/SOURCES
 cd ${rpm_root}/SPECS
-${sudo_sng} rpmbuild -ba --sign nco-4.6.3.spec > ~/foo.nco 2>&1
+${sudo_sng} rpmbuild -ba --sign nco-4.6.4.spec > ~/foo.nco 2>&1
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.3-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.3-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.4-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.6.4-?.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/RPMS/i386/nco-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-debuginfo-4.6.3-?.i386.rpm \
-${rpm_root}/RPMS/i386/nco-devel-4.6.3-?.i386.rpm \
-${rpm_root}/SRPMS/nco-4.6.3-?.src.rpm \
+${rpm_root}/RPMS/i386/nco-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-debuginfo-4.6.4-?.i386.rpm \
+${rpm_root}/RPMS/i386/nco-devel-4.6.4-?.i386.rpm \
+${rpm_root}/SRPMS/nco-4.6.4-?.src.rpm \
 zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 
 # RPM builds as user
@@ -256,33 +256,33 @@ zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 export rpm_root="${DATA}/rpm/nco"
 #cd ~/nco;cvc;cvu # This risks committing unwanted *.[ch]pp files
 mkdir -p ${DATA}/rpm/nco/TMP ${DATA}/rpm/nco/BUILD
-/bin/rm -rf ${DATA}/nco-4.6.3 ${DATA}/nco-4.6.3* # Cleanup last build
+/bin/rm -rf ${DATA}/nco-4.6.4 ${DATA}/nco-4.6.4* # Cleanup last build
 /bin/rm -r -f \
-${rpm_root}/nco-4.6.3-?.src.rpm \
-${rpm_root}/nco-4.6.3.spec \
-${rpm_root}/nco-4.6.3.tar.gz \
-${rpm_root}/*/nco-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.3-?.*.rpm
-# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.3-1 -d nco-4.6.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.6.3 nco # Export most recent and build as 4.6.3-1
-tar cvzf ./nco-4.6.3.tar.gz --exclude='nco-4.6.3/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.3 
-/bin/cp ${DATA}/nco-4.6.3.tar.gz ${rpm_root}
+${rpm_root}/nco-4.6.4-?.src.rpm \
+${rpm_root}/nco-4.6.4.spec \
+${rpm_root}/nco-4.6.4.tar.gz \
+${rpm_root}/*/nco-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.4-?.*.rpm
+# cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -r nco-4.6.4-1 -d nco-4.6.4 nco # Export based on tag
+cd ${DATA};cvs -d zender at nco.cvs.sf.net:/cvsroot/nco export -kkv -D "1 second ago" -dnco-4.6.4 nco # Export most recent and build as 4.6.4-1
+tar cvzf ./nco-4.6.4.tar.gz --exclude='nco-4.6.4/debian*' --exclude='.cvsignore' --exclude='ncap_lex.c' --exclude='ncap_yacc.[ch]' ./nco-4.6.4 
+/bin/cp ${DATA}/nco-4.6.4.tar.gz ${rpm_root}
 ln -s ${HOME}/nco/bld/nco.spec ${rpm_root}/nco.spec
 cd ${rpm_root}
 rpmbuild -ba --sign nco.spec > ~/foo.nco 2>&1
-rpmlint ${rpm_root}/*/nco-4.6.3-?.*.rpm
+rpmlint ${rpm_root}/*/nco-4.6.4-?.*.rpm
 sudo yum remove nco
-sudo yum install ${rpm_root}/*/nco-4.6.3-?.*.rpm
+sudo yum install ${rpm_root}/*/nco-4.6.4-?.*.rpm
 scp \
-${rpm_root}/*/nco-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.3-?.*.rpm \
-${rpm_root}/nco-4.6.3-?.*.src.rpm \
+${rpm_root}/*/nco-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.4-?.*.rpm \
+${rpm_root}/nco-4.6.4-?.*.src.rpm \
 dust.ess.uci.edu:/var/www/html/nco/src
 scp \
-${rpm_root}/*/nco-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-debuginfo-4.6.3-?.*.rpm \
-${rpm_root}/*/nco-devel-4.6.3-?.*.rpm \
-${rpm_root}/nco-4.6.3-?.*.src.rpm \
+${rpm_root}/*/nco-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-debuginfo-4.6.4-?.*.rpm \
+${rpm_root}/*/nco-devel-4.6.4-?.*.rpm \
+${rpm_root}/nco-4.6.4-?.*.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 1884f60..32cfcb0 100644
--- a/doc/index.shtml
+++ b/doc/index.shtml
@@ -70,7 +70,7 @@ Try to disable Spammers' machines:
 <p><h1 align="center">Bienvenue sur le netCDF Operator (NCO) site</h1>
 
 <p><h2>
-Current stable NCO version is 4.6.3 released <!--#flastmod file="src/nco-4.6.3.tar.gz"-->
+Current stable NCO version is 4.6.4 released <!--#flastmod file="src/nco-4.6.4.tar.gz"-->
 </h2>
 
 <table border=0 width=100%>
@@ -149,7 +149,9 @@ and
 <h2>Recent Releases & Milestones</h2>
 
 <ul>
-<li>2017 Jan ??: 4.6.4 (<i>In progress</i>)
+<li>2017 Mar ??: 4.6.5 (<i>In progress</i>)
+<li>2017 Feb 07: 4.6.4
+<li>2017 Jan 27: <i>Geosci. Model Dev.</i> publishes compression-error trade-off <a href="http://www.geosci-model-dev.net/10/413/2017">paper</a></li>
 <li>2016 Dec 23: 4.6.3 (Minor features)
 <li>2016 Nov 16: 4.6.2 (JSON)
 <li>2016 Sep 19: <i>Geosci. Model Dev.</i> publishes PPC <a href="http://www.geosci-model-dev.net/9/3199/2016">paper</a></li>
@@ -556,6 +558,10 @@ climate models (see <a href="#pub">publications</a>).</p>
 <dt><a name="Publications"></a><a name="pub"></a><a name="pubs"></a></dt>
 <h2>Publications and Presentations</h2>
 <ul>
+<li><!-- SiZ17 --> <a name="SiZ17"></a> <!--http://www.ess.uci.edu/~zender#SiZ17 -->
+Silver, J. D. and C. S. Zender (2017), The compression-error trade-off for large gridded data sets, <i>Geosci. Model Dev.</i>, <b>10</b>, 413–423, doi:10.5194/gmd-10-413-2017.
+<a href="http://dust.ess.uci.edu/ppr/ppr_SiZ17.pdf">PDF</a></li>
+
 <li><!-- Zen16 --> <a name="Zen16"></a> <!--http://www.ess.uci.edu/~zender#Zen16 -->
 Zender, C.  S. (2016), Bit Grooming: Statistically accurate precision-preserving quantization with compression, evaluated in the netCDF Operators (NCO, v4.4.8+), <i>Geosci. Model Dev.</i>, <b>9</b>, 3199–3211, doi:10.5194/gmd-9-3199-2016.
 <a href="http://dust.ess.uci.edu/ppr/ppr_Zen16.pdf">PDF</a></li>
@@ -618,7 +624,7 @@ Identical copies of those tarballs are also stored
 <a href="http://nco.sf.net/src">here</a> on SourceForge for historical
 continuity.
 You may retrieve the source of tagged versions directly with, e.g.,
-<tt>git clone -b 4.6.3 http://github.com/nco/nco.git nco-4.6.3</tt></a>.
+<tt>git clone -b 4.6.4 http://github.com/nco/nco.git nco-4.6.4</tt></a>.
 <ul>
 <li><b>NCO 4.6.5</b>: (<i>Future</i>) 
 <tt>ncks</tt> prints human-legible ISO8601 dates;
@@ -626,8 +632,13 @@ You may retrieve the source of tagged versions directly with, e.g.,
 extensive hashing?;
 netCDF4 compound types?;
 Optimize diskless files?;</li>
-<li><b>NCO 4.6.4</b>: (<i>In Progress, features in-progress or completed include</i>)
 <tt>ncks --xtn</tt> better extensive variable treatment;</li>
+<li><b>NCO 4.6.4</b>: (<i>In Progress, features in-progress or completed include</i>)
+<tt>ncks</tt> set chunk cache-size with <tt>--cnk_csh</tt>;
+<tt>ncremap</tt> add <tt>w_stag</tt> weights to FV output;
+<tt>ncclimo</tt> timeseries reshaping ("splitting") mode;
+Extract variables in CF <tt>formula_terms</tt> attribute;
+Fix UDUnits calendar bug introduced in 4.6.3;</li>
 <li><b>NCO 4.6.3</b>: (<i>Current Stable Release</i>)
 CMake build option;
 <tt>ncap2</tt> udunits() function;
@@ -777,7 +788,7 @@ goodies besides NCO) to your automatically-searched channels with
 ‘<tt>conda config --add channels --conda-forge</tt>’, then
 install NCO with ‘<tt>conda install nco</tt>’.
 The default NCO installed by <tt>conda</tt> is generally within a month of the latest release. 
-<li><a href="https://github.com/conda-forge/nco-feedstock">nco-4.6.3</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
+<li><a href="https://github.com/conda-forge/nco-feedstock">nco-4.6.4</a> Executables Anaconda-compatible. Maintained by Filipe Fernandes.</li>
 Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and maintaining the NCO package for conda.
 </ul>
 
@@ -786,7 +797,7 @@ Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and mainta
 <h3><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux</a></h3>
 <ul>
 <!--
-<li><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux-compatible Intel systems, prebuilt binary executable <a href="http://www.debian.org">deb</a>: <a href="http://packages.debian.org/testing/math/nco.html">nco-4.6.3</a></li>
+<li><a href="http://www.debian.org">Debian</a> and <a href="http://www.ubuntu.com">Ubuntu</a> GNU/Linux-compatible Intel systems, prebuilt binary executable <a href="http://www.debian.org">deb</a>: <a href="http://packages.debian.org/testing/math/nco.html">nco-4.6.4</a></li>
 -->
 <a href="http://packages.debian.org/unstable/science/nco">Debian NCO</a> and 
 <a href="https://launchpad.net/ubuntu/+source/nco">Ubuntu NCO</a> homepages.
@@ -794,8 +805,8 @@ Thanks to Rich Signell, Filipe Fernandes (and others?) for developing and mainta
 NCO packages in the Debian/Ubuntu repositories (e.g., Sid and Raring) generally lag the packages distributed here by 6–12 months.
 <a name="beta"></a><a name="prerelease"> <!-- http://nco.sf.net#beta -->
 Newer (beta- or pre-release) packages are often available for intrepid Debian/Ubuntu users as described <a href="https://github.com/nco/nco/tree/master/doc/beta.txt">here</a>.
-<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_4.6.3-1_i386.deb</tt>’):</dt>
-<li><a href="https://launchpad.net/ubuntu/+source/nco/4.6.3-1">nco_4.6.3-1_amd64.deb</a> : Executables AMD64-compatible</li>
+<dt>Debian package for most recent NCO release (install with, e.g., ‘<tt>dpkg --install nco_4.6.4-1_i386.deb</tt>’):</dt>
+<li><a href="https://launchpad.net/ubuntu/+source/nco/4.6.4-1">nco_4.6.4-1_amd64.deb</a> : Executables AMD64-compatible</li>
 Thanks to Daniel Baumann, Sebastian Couwenberg, Barry deFreese, Francesco Lovergine, 
 Brian Mays, Rorik Peterson, and Matej Vela for their help packaging
 NCO for Debian over the years. 
@@ -839,10 +850,10 @@ Thanks to Gavin Burris and Kyle Wilcox for documenting build procedures for RHEL
 <!-- 
 # Mac OS X 10.12 (Sierra) systems (aerosol):
 /usr/bin/scp ~/nco/doc/index.shtml zender,nco at web.sf.net:/home/project-web/nco/htdocs
-cd ~/bin;tar cvzf ${DATA}/nco-4.6.3.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.6.3.macosx.10.12.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
+cd ~/bin;tar cvzf ${DATA}/nco-4.6.4.macosx.10.12.tar.gz nc*;scp ${DATA}/nco-4.6.4.macosx.10.12.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src
 -->
 The most up-to-date executables are probably those in the tarball below. Those unfamiliar with installing executables from tarballs may try the (older) <a href="http://en.wikipedia.org/wiki/Apple_Disk_Image">DMG</a> files (you may need to add <tt>/opt/local/bin</tt> to your executable path to access those operators).
-<li><a href="src/nco-4.6.3.macosx.10.12.tar.gz">nco-4.6.3.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.6.3.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.6.3.macosx.10.12.tar.gz"-->). 
+<li><a href="src/nco-4.6.4.macosx.10.12.tar.gz">nco-4.6.4.macosx.10.12.tar.gz</a> (<!--#fsize file="src/nco-4.6.4.macosx.10.12.tar.gz"-->): Executables MacOSX 10.12-compatible (last updated <!--#flastmod file="src/nco-4.6.4.macosx.10.12.tar.gz"-->). 
 (NB: These executables require
   the <a href="http://trac.macosforge.org/projects/macports/wiki">MacPorts</a>
   <a href="#bld_macports">dependencies</a> for <a href="http://svn.macports.org/repository/macports/trunk/dports/science/nco">NCO</a>). Maintained by NCO Project.</li>
@@ -865,9 +876,8 @@ To build NCO from source yourself using MSVC or Qt, please see the <a href="nco_
 <!-- Copy files from http://glace.ess.uci.edu
 /usr/bin/scp /home/pvicente/nco/doc/index.shtml pvicente,nco at web.sf.net:/home/project-web/nco/htdocs
 /usr/bin/scp /home/pvicente/windows_setup/nco-4.6.3.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.6.2.windows.mvs.exe">nco-4.6.2.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.6.2.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.6.2.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
+<li><a href="src/nco-4.6.3.windows.mvs.exe">nco-4.6.3.windows.mvs.exe</a> (<!--#fsize file="src/nco-4.6.3.windows.mvs.exe"-->) : Windows Self-Extracting Installer (last updated <!--#flastmod file="src/nco-4.6.3.windows.mvs.exe"-->). Maintained by Pedro Vicente.</li>
 </ul>
 
 <a name="cygwin"></a> <!-- http://nco.sf.net#cygwin -->
@@ -1038,11 +1048,11 @@ site.</li>
 The simplest way to acquire the source is to download the compressed tarball:
 <ul>
 <li>
-<!-- scp ${DATA}/nco-4.6.3.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
-<a href="https://github.com/nco/nco/archive/4.6.3.tar.gz">nco-4.6.3.tar.gz</a> 
-(<!--#fsize file="src/nco-4.6.3.tar.gz"--> compressed tar-file)<br>
-<!--#exec cmd="openssl dgst -md5 src/nco-4.6.3.tar.gz"--><br>
-<!--#exec cmd="openssl dgst -sha1 src/nco-4.6.3.tar.gz"--> 
+<!-- scp ${DATA}/nco-4.6.4.tar.gz zender,nco at web.sf.net:/home/project-web/nco/htdocs/src -->
+<a href="https://github.com/nco/nco/archive/4.6.4.tar.gz">nco-4.6.4.tar.gz</a> 
+(<!--#fsize file="src/nco-4.6.4.tar.gz"--> compressed tar-file)<br>
+<!--#exec cmd="openssl dgst -md5 src/nco-4.6.4.tar.gz"--><br>
+<!--#exec cmd="openssl dgst -sha1 src/nco-4.6.4.tar.gz"--> 
 </li>
 </ul>
 
@@ -1061,8 +1071,8 @@ You may retrieve any NCO distribution you wish from
 <a href="https://help.github.com">GitHub</a>. 
 Usually you wish to retrieve a recent tagged (i.e., released) version.
 This command retrieves the entire NCO repository (< 20 MB) and
-then checks out NCO version <tt>4.6.3</tt>:
-<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.6.3</tt></p>
+then checks out NCO version <tt>4.6.4</tt>:
+<p><tt>git clone https://github.com/nco/nco.git;cd nco;git checkout 4.6.4</tt></p>
 These commands retrieve the current (“bleeding edge”)
 development version of NCO into a local directory named <tt>nco</tt>:
 <p><tt>git clone https://github.com/nco/nco.git ~/nco</tt></p> or
@@ -1070,9 +1080,9 @@ development version of NCO into a local directory named <tt>nco</tt>:
 Track changes to the development version using
 <p><tt>cd nco;git pull</tt></p>
 One difference between running a "tagged" release 
-(e.g., <tt>4.6.3</tt>) and the development version is that the
+(e.g., <tt>4.6.4</tt>) and the development version is that the
 tagged release operators will print a valid version number (e.g.,
-<tt>4.6.3</tt>) when asked to do so with the <tt>-r</tt> flag
+<tt>4.6.4</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.
@@ -1219,9 +1229,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.6.3.tar.gz</dt>
-<dt>tar xvzf 4.6.3.tar.gz</dt>
-<dt>cd nco-4.6.3</dt>
+<dt>wget https://github.com/nco/nco/archive/4.6.4.tar.gz</dt>
+<dt>tar xvzf 4.6.4.tar.gz</dt>
+<dt>cd nco-4.6.4</dt>
 <dt>./configure --prefix=/usr/local</dt>
 <dt>make</dt>
 <dt>sudo make install</dt>
@@ -1294,9 +1304,9 @@ is usually untagged.
 <li>NCAR CISL <tt>yellowstone.ucar.edu</tt>: <tt>~zender/bin</tt></li>
 <li>NCAR CISL <tt>mirage0.ucar.edu</tt>: <tt>~zender/bin</tt></li>
 <li>NERSC Cori <tt>cori.nersc.gov</tt>: <tt>~zender/bin_cori</tt></li>
-<li>NERSC Edison <tt>edison.nersc.gov</tt>: <tt>~zender/bin_edison</tt> or <tt>module load nco</tt></li>
+<li>NERSC Edison <tt>edison.nersc.gov</tt>: <tt>~zender/bin_edison</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_rhea</tt> or <tt>module load nco</tt></li>
+<li>ORNL OLCF Rhea <tt>rhea.ccs.ornl.gov</tt>: <tt>~zender/bin_rhea</tt></li>
 <li>ORNL OLCF Titan <tt>titan.ccs.ornl.gov</tt>: <tt>~zender/bin_titan</tt></li>
 <li>UCI ESS <tt>greenplanet.ps.uci.edu</tt>: <tt>~zender/bin</tt></li>
 </ul>
diff --git a/doc/nco.texi b/doc/nco.texi
index f5d9742..d751667 100644
--- a/doc/nco.texi
+++ b/doc/nco.texi
@@ -12,7 +12,7 @@ Purpose: TeXInfo documentation for netCDF Operators (NCO)
 
 URL: http://nco.sf.net/nco.texi
 
-Copyright (C) 1995--2016 Charlie Zender
+Copyright (C) 1995--2017 Charlie Zender
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3
 or any later version published by the Free Software Foundation;
@@ -118,12 +118,12 @@ Octave TeXInfo manual shows clean TeXInfo structure
 @setfilename nco.info
 
 @c Define edition, date, ...
- at set nco-edition 4.6.3
- at set doc-edition 4.6.3
- at set copyright-years 1995--2016
- at set update-year 2016
- at set update-date 23 December 2016
- at set update-month December 2016
+ at set nco-edition 4.6.4
+ at set doc-edition 4.6.4
+ at set copyright-years 1995--2017
+ at set update-year 2017
+ at set update-date 7 February 2017
+ at set update-month February 2017
 
 @settitle @acronym{NCO} @value{nco-edition} User Guide
 
@@ -554,10 +554,16 @@ Irvine, California@*
 
 @ignore
 The @acronym{DOE} @acronym{ACME} program generously supported ...
+
+Matching @acronym{NCO} against other analysis software, and often
+besting them, has been exhilirating.
+Henry Butowsky has re-joined our efforts.
+Without him, much of this work would have been impossible.
+
 @sp 1
 @noindent
 Charlie Zender@*
-November, 2016@*
+January, 2017@*
 Laguna Beach, California@*
 @end ignore
 
@@ -4610,12 +4616,18 @@ convention described in @ref{CF Conventions}.
 As of @acronym{NCO} version 4.0.8 (April, 2011) 
 both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{bounds}
 convention described in @ref{CF Conventions}. 
+As of @acronym{NCO} version 4.6.4 (January, 2017) 
+both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{cell_measures}
+convention described in @ref{CF Conventions}. 
 As of @acronym{NCO} version 4.4.9 (May, 2015) 
 both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{climatology}
 convention described in @ref{CF Conventions}. 
 As of @acronym{NCO} version 3.9.6 (January, 2009) 
 both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{coordinates}
 convention described in @ref{CF Conventions}.
+As of @acronym{NCO} version 4.6.4 (January, 2017) 
+both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{formula_terms}
+convention described in @ref{CF Conventions}. 
 As of @acronym{NCO} version 4.6.0 (May, 2016) 
 both @samp{-c} and @samp{-C} honor the @acronym{CF} @code{grid_mapping}
 convention described in @ref{CF Conventions}. 
@@ -5696,11 +5708,13 @@ ncra --mro -O -d time,,,12,12 -n 150,4,1 1850.nc 1850_2009.nc
 These operations generate and require no intermediate files.
 This contrasts to previous @acronym{NCO} methods, which require
 generating, averaging, then catenating 150 files.  
-The @samp{--mro} option has no effect on, or rather is redundant for, 
- at command{ncrcat} since @command{ncrcat} always outputs all selected
-records.
+The @samp{--mro} option only works on @command{ncra} and has no effect
+on (or rather is redundant for) @command{ncrcat}, since @command{ncrcat}
+always outputs all selected records.
 
 @html
+<a name="multislab"></a> <!-- http://nco.sf.net/nco.html#multislab -->
+<a name="multislabs"></a> <!-- http://nco.sf.net/nco.html#multislabs -->
 <a name="msa"></a> <!-- http://nco.sf.net/nco.html#msa -->
 <a name="mlt"></a> <!-- http://nco.sf.net/nco.html#mlt -->
 @end html
@@ -5812,6 +5826,7 @@ commands to gather the desired range of data.
 
 @html
 <a name="msa_usr_rdr"></a> <!-- http://nco.sf.net/nco.html#msa_usr_rdr -->
+<a name="rotate_longitude"></a> <!-- http://nco.sf.net/nco.html#rotate_longitude -->
 @end html
 The @acronym{MSA} user-order switch @samp{--msa_usr_rdr} (or
 @samp{--msa_user_order}, both of which shorten to @samp{--msa}) 
@@ -5821,9 +5836,9 @@ storage order.
 This allows the user to perform complex data re-ordering in one
 operation that would otherwise require cumbersome steps of
 hyperslabbing, concatenating, and permuting. 
-Consider the recent example of a user who needed to convert datasets
-stored with the longitude coordinate @code{Lon} ranging from
-[@minus{}180,180) to datasets that follow the [0,360) convention.
+Consider the example of converting datasets stored with the longitude
+coordinate @code{Lon} ranging from [@minus{}180,180) to datasets that
+follow the [0,360) convention.
 @example
 % ncks -H -v Lon in.nc
 Lon[0]=-180
@@ -5832,6 +5847,7 @@ Lon[2]=0
 Lon[3]=90
 @end example
 @noindent
+What is needed is a simple way to rotate longitudes.
 Although simple in theory, this task requires both mathematics to
 change the numerical value of the longitude coordinate, data
 hyperslabbing to split the input on-disk arrays at Greenwich, and data
@@ -7321,7 +7337,6 @@ also rebases the time coordinate when the unit between files differ
 For example the first file may have @code{units="days since 2014-03-01"} 
 and  the second file @code{units="hours since 2014-03-10 00:00"}.
 
-
 @html
 <a name="mrd"></a> <!-- http://nco.sf.net/nco.html#mrd -->
 @end html
@@ -9878,7 +9893,7 @@ final step.
 This ensures the standard deviation is correctly normalized by one fewer
 than the number of time samples.
 The procedure to compute the variance is identical except for the use of 
- at samp{-y var} instead of @samp{-y rmssdn} in the final step.
+ at samp{-y avgsqr} instead of @samp{-y rmssdn} in the final step.
 
 @command{ncap2} can also compute statistics like standard deviations.
 Brute-force implementation of formulae is one option, e.g.,
@@ -11071,6 +11086,97 @@ Ancillary variables are subject to the user-specified override switches
 @ref{Subsetting Coordinate Variables}. 
 
 @html
+<a name="cnv_CF_cll_msr"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_cll_msr -->
+<a name="cll_msr"></a> <!-- http://nco.sf.net/nco.html#cll_msr -->
+<a name="cell_measures"></a> <!-- http://nco.sf.net/nco.html#cell_measures -->
+<a name="no_cll_msr"></a> <!-- http://nco.sf.net/nco.html#no_cll_msr -->
+<a name="no_cell_measures"></a> <!-- http://nco.sf.net/nco.html#no_cell_measures -->
+ at end html
+ at cindex @code{cell_measures} attribute
+ at cindex cell measures convention
+As of @acronym{NCO} version 4.6.4 (January, 2017), @acronym{NCO} 
+supports the @acronym{CF} @code{cell_measures} convention 
+described 
+ at uref{http://cfconventions.org/1.6.html#cell-measures, here}.
+This convention allows variables to indicate which other variable or
+variables contains area or volume information about a gridcell.
+These measures variables are pointed to by the @code{cell_measures}
+attribute.
+The @acronym{CDL} specification of a measures variable for area looks
+like 
+ at example
+orog:cell_measures = "area: areacella"
+ at end example
+where @code{areacella} is the name of the measures variable.
+Unless the default behavior is overridden, @acronym{NCO} attaches any
+measures variables to the extraction list along with the primary
+variable and other associated variables. 
+By definition, measures variables are a subset of the rank of the
+variable they measure.
+The most common case is that the measures variable for area is the same
+size as @w{2D fields} (like surface air temperature) and much smaller
+than @w{3D fields} (like full air temperature). 
+In such cases the measures variable might occupy 50% of the space of a
+dataset consisting of only one @w{2D field}.
+Extraction of measures variables is subject to the user-specified
+override switches (including @samp{-c} and @samp{-C}) described in  
+ at ref{Subsetting Coordinate Variables}. 
+To conserve space without sacrificing too much metadata, @acronym{NCO}
+makes it possible to override the extraction of measures variables
+independent of extracting other associated variables.
+Override the default with @samp{--no_cell_measures} or
+ at samp{--no_cll_msr}. 
+These options are available in all operators that perform subsetting
+(i.e., all operators except @command{ncatted} and @command{ncrename}).
+
+ at html
+<a name="cnv_CF_frm_trm"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_frm_trm -->
+<a name="frm_trm"></a> <!-- http://nco.sf.net/nco.html#frm_trm -->
+<a name="formula_terms"></a> <!-- http://nco.sf.net/nco.html#formula_terms -->
+<a name="no_frm_trm"></a> <!-- http://nco.sf.net/nco.html#no_frm_trm -->
+<a name="no_formula_terms"></a> <!-- http://nco.sf.net/nco.html#no_formula_terms -->
+ at end html
+ at cindex @code{formula_terms} attribute
+ at cindex cell measures convention
+As of @acronym{NCO} version 4.6.4 (January, 2017), @acronym{NCO} 
+supports the @acronym{CF} @code{formula_terms} convention 
+described 
+ at uref{http://cfconventions.org/1.6.html#formula-terms, here}.
+This convention encodes formulas used to construct (usually vertical)
+coordinate grids.
+The @acronym{CDL} specification of a vertical coordinate formula for
+looks like 
+ at example
+lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate"
+lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS"
+ at end example
+where @code{standard_name} contains the standardized name of the
+formula variable and @code{formula_terms} contains a list of the
+variables used, called formula variables.
+Above the formula variables are @code{hyam}, @code{hybm}, @code{P0}, and
+ at code{PS}. 
+Unless the default behavior is overridden, @acronym{NCO} attaches any 
+formula variables to the extraction list along with the primary
+variable and other associated variables. 
+By definition, formula variables are a subset of the rank of the
+variable they define.
+One common case is that the formula variables for constructing a 
+ at w{3D height} grid involves a 2D variable (like surface pressure,
+or elevation).
+In such cases the formula variables typically constitute only a 
+small fraction of a dataset consisting of one @w{3D field}.
+Extraction of formula variables is subject to the user-specified
+override switches (including @samp{-c} and @samp{-C}) described in  
+ at ref{Subsetting Coordinate Variables}. 
+To conserve space without sacrificing too much metadata, @acronym{NCO}
+makes it possible to override the extraction of formula variables
+independent of extracting other associated variables.
+Override the default with @samp{--no_formula_terms} or
+ at samp{--no_frm_trm}. 
+These options are available in all operators that perform subsetting
+(i.e., all operators except @command{ncatted} and @command{ncrename}).
+
+ at html
 <a name="cnv_CF_grd"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_grd -->
 <a name="grd_map"></a> <!-- http://nco.sf.net/nco.html#grd_map -->
 <a name="grid_mapping"></a> <!-- http://nco.sf.net/nco.html#grid_mapping -->
@@ -11134,8 +11240,9 @@ history of a variable's analysis.
 @html
 <a name="cnv_CF_cll_mth"></a> <!-- http://nco.sf.net/nco.html#cnv_CF_cll_mth -->
 <a name="cll_mth"></a> <!-- http://nco.sf.net/nco.html#cll_mth -->
-<a name="no_cll_mth"></a> <!-- http://nco.sf.net/nco.html#no_cll_mth -->
 <a name="cell_methods"></a> <!-- http://nco.sf.net/nco.html#cell_methods -->
+<a name="no_cll_mth"></a> <!-- http://nco.sf.net/nco.html#no_cll_mth -->
+<a name="no_cell_methods"></a> <!-- http://nco.sf.net/nco.html#no_cell_methods -->
 @end html
 @cindex @code{cell_methods}
 @cindex @code{--cll_mth}
@@ -11282,8 +11389,8 @@ described in any detail in the sections below.
 * ncatted netCDF Attribute Editor::
 * ncbo netCDF Binary Operator::
 * ncclimo netCDF Climatology Generator::
-* nces netCDF Ensemble Statistics::
 * ncecat netCDF Ensemble Concatenator::
+* nces netCDF Ensemble Statistics::
 * ncflint netCDF File Interpolator::
 * ncks netCDF Kitchen Sink::
 * ncpdq netCDF Permute Dimensions Quickly::
@@ -16230,7 +16337,7 @@ ncbo [-3] [-4] [-6] [-7] [-A] [-C] [-c]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F] 
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
-[-L @var{dfl_lvl}] [-l @var{path}] [--no_tmp_fl]
+[-L @var{dfl_lvl}] [-l @var{path}] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{file_3}] [-p @var{path}] [-R] [-r] [--ram_all]
 [-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x] [-y @var{op_typ}]
 @var{file_1} @var{file_2} [@var{file_3}]
@@ -16642,8 +16749,9 @@ ncrcat t_anm_8589_??.nc t_anm_8589_0112.nc
 @page
 @html
 <a name="ncclimo"></a> <!-- http://nco.sf.net/nco.html#ncclimo -->
+<a name="ncsplit"></a> <!-- http://nco.sf.net/nco.html#ncsplit -->
 @end html
- at node ncclimo netCDF Climatology Generator, nces netCDF Ensemble Statistics, ncbo netCDF Binary Operator, Reference Manual
+ at node ncclimo netCDF Climatology Generator, ncecat netCDF Ensemble Concatenator, ncbo netCDF Binary Operator, Reference Manual
 @section @command{ncclimo} netCDF Climatology Generator
 @cindex climo
 @cindex climatology
@@ -16654,28 +16762,47 @@ SYNTAX
 @example
 ncclimo [-a @var{dec_md}] [-C @var{clm_md}] [-c @var{caseid}] [-d @var{dbg_lvl}]
 [-E @var{yr_prv}] [-e @var{yr_end}] [-f @var{fml_nm}] [-h @var{hst_nm}] [-i @var{drc_in}]
-[-l @var{lnk_flg}] [-m @var{mdl_nm}] [-n @var{nco_opt}] [-O @var{drc_rgr}] [-o @var{drc_out}]
-[-p @var{par_typ}] [-R @var{rgr_opt}] [-r @var{rgr_map}] 
-[-S @var{yr_prv}] [-s @var{yr_srt}] [-t @var{thr_nbr}] [-v @var{var_lst}] [-x @var{cf_flg}] 
-[-X @var{drc_xtn}] [-x @var{drc_prv}] [-Y @var{rgr_xtn}] [-y @var{rgr_prv}]
+[-j @var{job_nbr}] [-l @var{lnk_flg}] [-m @var{mdl_nm}] [-n @var{nco_opt}] 
+[-O @var{drc_rgr}] [-o @var{drc_out}] [-p @var{par_typ}] [-R @var{rgr_opt}] [-r @var{rgr_map}] 
+[-S @var{yr_prv}] [-s @var{yr_srt}] [--stdin] [--tpd=@var{tpd_dly}] [-t @var{thr_nbr}] [--tpd=@var{tpd_dly}] 
+[-v @var{var_lst}] [-x @var{cf_flg}] [-X @var{drc_xtn}] [-x @var{drc_prv}] [-Y @var{rgr_xtn}] [-y @var{rgr_prv}]
+[--ypf=@var{ypf_max}]
 @end example
 
 @noindent
 DESCRIPTION
 
- at command{ncclimo} produces climatological monthly means, seasonal means,
-annual mean, and optionally regrids all these files.
+In climatology generation mode, @command{ncclimo} ingests ``raw'' data
+consisting of a monthly or annual timeseries of files and from these
+produces climatological monthly means, seasonal means, and/or annual
+means.
+Alternatively, in timeseries reshaping mode, @command{ncclimo} will
+subset and temporally split the input raw data timeseries into
+per-variable files spanning the entire period. 
+ at command{ncclimo} can optionally regrid all output files in either mode. 
+
 There are five required options (@samp{-c}, @samp{-s}, @samp{-e},
- at samp{-i}, and @samp{-o})), and more options are available to customize
-the processing.
+ at samp{-i}, and @samp{-o})) to generate climatologies, and many more
+options are available to customize the processing.
 Options are similar to @command{ncremap} options.
-Standard @command{ncclimo} usage looks like
+Standard @command{ncclimo} usage for climatology generation looks like
 @example
 ncclimo            -c caseid -s srt_yr -e end_yr -i drc_in -o drc_out
 ncclimo -m mdl_nm  -c caseid -s srt_yr -e end_yr -i drc_in -o drc_out
 ncclimo -v var_lst -c caseid -s srt_yr -e end_yr -i drc_in -o drc_out
 ncclimo --case=caseid --start=srt_yr --end=end_yr --input=drc_in --output=drc_out
 @end example
+In climatology generation mode, @command{ncclimo} constructs the list of
+input filenames from the argument to the date and model-type options.
+ at cindex standard input
+ at cindex @code{stdin}
+ at command{ncclimo} automatically switches to timeseries reshaping mode
+if it receives a list of files from @code{stdin}, or, alternatively,
+placed as positional arguments (after the last command-line option), or
+if neither of these is done and no @var{caseid} is specified, in which
+case it assumes all @code{*.nc} files in @var{drc_in} constitute the
+input file list. 
+
 Options come in both short (single-letter) and long forms.
 The handful of long-option synonyms for each option allows the user 
 to imbue the commands with a level of verbosity and precision that suits
@@ -16719,6 +16846,9 @@ Use @samp{ann} if the input files are a series of annual means.
 @cindex @code{--case}
 @item -c @var{caseid} (@code{--case}, @code{--caseid}, @code{--case_id})
 Simulation name, or any input filename for non- at acronym{CESM}'ish files.  
+The use of @var{caseid} is required in climate generation mode (unless
+equivalent information is provided through other options), where
+ at var{caseid} is used to construct both input and output filenames.
 For @acronym{CESM}'ish input files like
 @file{famipc5_ne30_v0.3_00001.cam.h0.1980-01.nc}, 
 specify @samp{-c famipc5_ne30_v0.3_00001}. 
@@ -16728,7 +16858,11 @@ These can be modified via the @option{-m @var{mdl_nm}} and
 @option{-h @var{hst_nm}} switches if needed.  
 For input files like @file{merra2_198001.nc},
 specify @samp{-c merra2_198001.nc}. 
-See comments in @command{ncclimo} for further documentation.   
+In timeseries reshaping mode, @var{caseid} will be used, if supplied,
+as an additional string in the output filename.
+For example, specifying @samp{-c control} would cause
+ at file{T_000101_000912.nc} to be instead named 
+ at file{T_control_000101_000912.nc}.
 @cindex @code{-D @var{dbg_lvl}}
 @cindex @var{dbg_lvl}
 @cindex @code{--dbg_lvl}
@@ -16762,8 +16896,8 @@ specified end year.
 @cindex @code{--family_name}
 @item -f @var{fml_nm} (@code{--fml_nm}, @code{--family}, @code{--family_name})
 Family name (nickname) of output files.
-By default output climo file names are constructed from the @var{caseid}
-of the input files.
+In climate generation mode, output climo file names are constructed by
+default with the same @var{caseid} as the input files.
 The @var{fml_nm}, if supplied, replaces @var{caseid} in output climo
 names, which are of the form
 @var{fml_nm}_XX_YYYYMM_YYYYMM.nc where @var{XX} is the month or seasonal
@@ -16771,6 +16905,11 @@ abbreviation.
 Use @samp{-f @var{fml_nm}} to simplify long names, avoid overlap, etc.
 Example values of @var{fml_nm} are @samp{control}, @samp{experiment},
 and (for a single-variable climo) @samp{FSNT}.
+In timeseries reshaping mode, @var{fml_nm} will be used, if supplied,
+as an additional string in the output filename.
+For example, specifying @samp{-f control} would cause
+ at file{T_000101_000912.nc} to be instead named 
+ at file{T_control_000101_000912.nc}.
 @cindex @code{-h @var{hst_nm}}
 @cindex @var{hst_nm}
 @cindex @code{--history_name}
@@ -16794,13 +16933,61 @@ Examples include @samp{h0} (default, works for @acronym{CAM},
 @cindex @code{--input}
 @item -i @var{drc_in} (@code{--drc_in}, @code{--in_drc}, @code{--dir_in}, @code{--input})
 Directory containing all monthly mean files to read as input to the
-climatology.  
+climatology.
+The use of @var{drc_in} is mandatory in climate generation mode but is 
+optional in timeseries reshaping mode.
+In timeseries reshaping mode, @command{ncclimo} uses all netCDF files
+(meaning files with suffixes @code{.nc}, @code{.nc3}, @code{.nc4},
+ at code{.cdf}, @code{.hdf}, @code{.he5}, or @code{.h5}) in @var{drc_in} to 
+create the list of input files when no list is provided through
+ at code{stdin} or as positional arguments to the command-line. 
+ at cindex @code{-j @var{job_nbr}}
+ at cindex @var{job_nbr}
+ at cindex @code{--job_nbr}
+ at cindex @code{--job_number}
+ at cindex @code{--job_number}
+ at cindex @code{--jobs}
+ at item -j @var{job_nbr} (@code{--job_nbr}, @code{--job_number}, @code{--jobs})
+Specifies the number of simultaneous subsetting processes to spawn  
+during parallel execution for both Background and @acronym{MPI} modes. 
+This applies to timeseries reshaping mode only, and has no effect in 
+climatology generation mode.
+In both parallel modes @command{ncclimo} spawns processes in batches 
+of @var{job_nbr} jobs, then waits for those processes to complete.
+Once a batch finishes, @command{ncclimo} spawns the next batch.
+In Background mode, all jobs are spawned to the local node.
+In @acronym{MPI} mode, all jobs are spawned in round-robin fashion
+to all available nodes until @var{job_nbr} jobs are running.
+
+If subsetting consumes so much @acronym{RAM} (e.g., because
+variables are large and/or the number of threads is large) that a
+single node can perform only one subsetting job at a time, then a
+reasonable value for @var{job_nbr} is the number of nodes,
+ at var{node_nbr}. 
+Often, however, nodes can usually subset (and then regrid, if requested) 
+multiple variables simultaneously.
+
+By default @math{@var{job_nbr} = 2} in Background mode, and
+ at math{@var{job_nbr} = @var{node_nbr}} in @acronym{MPI} mode.
+This helps prevent users from overloading nodes with too many jobs.
+Subject to the availability of adequate @acronym{RAM},
+expand the number of jobs per node by increasing @var{job_nbr}
+until, ideally, each core on the node is used. 
+
+The main throughput bottleneck in timeseries reshaping mode is I/O. 
+It is possible that each node can write to only one file at a time,
+in which case increasing @var{job_nbr} may have little effect.
+Regridding requires math that can relieve some I/O contention and
+allows for some throughput gains with increasing @var{job_nbr}.
+In general, though, increasing @var{job_nbr} is expected to improve
+throughput much more in @command{ncremap} than in @command{ncclimo}. 
+
 @cindex @code{-l}
 @cindex @code{--lnk_flg}
 @cindex @code{--link_flag}
 @cindex @code{--no_amwg_links}
 @item -l (@code{--lnk_flg}, @code{--link_flag}, @code{--no_amwg_links})
-This switch (which takes no option) turns-off the default linking of
+This switch (which takes no argument) turns-off the default linking of
 @acronym{ACME}-climo to @acronym{AMWG}-climo filenames.   
 @acronym{AMWG} omits the @acronym{YYYYMM} components of climo filenames,
 resulting in shorter names.
@@ -16902,6 +17089,28 @@ be December of the year before the start year (to allow for contiguous
 @acronym{DJF} climos).   
 If @samp{-a sdd} is specified, the first month used is January of
 the specified start year. 
+ at cindex @code{--stdin}
+ at cindex @code{--inp_std}
+ at cindex @code{--std_flg}
+ at cindex @code{--redirect}
+ at cindex @code{--standard_input}
+ at item --stdin (@code{--stdin}, @code{--inp_std}, @code{--std_flg}, @code{--redirect}, @code{--standard_input})
+This switch (which takes no argument) explicitly indicates that 
+input file lists are provided via @code{stdin}, i.e., standard input.
+In interactive environments, @command{ncclimo} can automatically 
+(i.e., without any switch) detect whether input is provided via
+ at code{stdin}. 
+This switch is never required for jobs run in an interactive shell. 
+However, non-interactive batch jobs (such as those submitted to the 
+ at acronym{SLURM} and @acronym{PBS} schedulers) make it impossible to 
+unambiguously determine whether input has been provided via
+ at code{stdin}. 
+Specifically, the @samp{--stdin} switch @emph{must} be used in
+non-interactive batch jobs on @acronym{PBS} when the input files
+are piped to @code{stdin}, and on @acronym{SLURM} when the input files 
+are redirected from a file to @code{stdin}.
+Using this switch in any other context (e.g., interactive shells) is
+optional. 
 @cindex @code{-t @var{thr_nbr}}
 @cindex @var{thr_nbr}
 @cindex @code{--thr_nbr}
@@ -16915,19 +17124,92 @@ However, regridding with the maximum number of threads can interfere
 with climatology generation in parallel climatology mode (i.e., when
 @math{@var{par_typ}} = @code{mpi} or @code{bck}). 
 Hence @command{ncclimo} defaults to @var{thr_nbr}=2.
+ at cindex @code{--tpd_out @var{tpd_out}}
+ at cindex @var{tpd_out}
+ at cindex @code{--tpd_out}
+ at cindex @code{--tpd}
+ at item --tpd_out @var{tpd_out} (@code{--tpd_out}, @code{--tpd}, @code{--timesteps_per_day})
+The number of timesteps-per-day in output created by @command{ncclimo}'s
+climatology generator in daily average mode.
+The climatology output from input files at daily or sub-daily resolution
+is, by default, averaged to daily resolution, i.e., @var{tpd_out}=1. 
+If the number of timesteps per day in each input file is @var{tpd_in},
+then the user may select any value of @var{tpd_out} that is smaller 
+than and integrally divides @var{tpd_in}.
+For example, an input timeseries with @var{tpd_in}=8 (i.e., 3-hourly
+resolution), can be used to produce climatological output at 3, 6,
+or 12-hourly resolution by setting @var{tpd_out} to 8, 4, or 2,
+respectively. 
+This option only takes effect in daily-average climatology mode.
 @cindex @code{-v @var{var_lst}}
 @cindex @var{var_lst}
 @cindex @code{--var_lst}
+ at cindex @code{--var}
+ at cindex @code{--vars}
 @cindex @code{--variables}
 @cindex @code{--variable_list}
- at item -v @var{var_lst} (@code{--var_lst}, @code{--variables}, @code{--variable_list})
-Variables to subset.
+ at item -v @var{var_lst} (@code{--var_lst}, @code{--var}, @code{--vars}, @code{--variables}, @code{--variable_list})
+Variables to subset or split.
 Same behavior as @ref{Subsetting Files}.
+The use of @var{var_lst} is optional in climate generation mode but is 
+mandatory in timeseries reshaping mode (to prevent inadvertently copying 
+the results of an entire model simulation).
 Regular expressions are allowed so, e.g., @samp{PREC.?} extracts
 the variables @samp{PRECC,PRECL,PRECSC,PRECSL} if present.
+Note that in reshaping mode all matches to a regular expression are
+placed in the same output file.
+ at cindex @code{--ypf_max @var{ypf_max}}
+ at cindex @var{ypf_max}
+ at cindex @code{--ypf_max}
+ at item --ypf_max @var{ypf_max} (@code{--ypf}, @code{--years}, @code{--years_per_file})
+The maximum number of years-per-file output by @command{ncclimo}'s
+splitting operation. 
+When @command{ncclimo} subsets and splits a collection of input files
+spanning a timerseries, it places each subset variable in its own output
+file. 
+The maximum length, in years, of each output file is @var{ypf_max},
+which defaults to @var{ypf_max}=50.
+If an input timeseries spans @w{237 years} and @var{ypf_max}=50, then
+ at command{ncclimo} will generate four output files of length @w{50 years}  
+and one output file of length @w{37 years}.
+This option only takes effect in timeseries reshaping mode.
 @end table
 @noindent
 
+ at unnumberedsubsec Timeseries Reshaping mode, aka Splitting
+This section of the @command{ncclimo} documentation applies only to
+resphaping mode, whereas all subsequent sections apply to climatology
+generation mode. 
+As mentioned above, 
+ at command{ncclimo} automatically switches to timeseries reshaping mode 
+if it receives a list of files through @code{stdin}, or, alternatively,
+placed as positional arguments (after the last command-line option), or
+if neither of these is done and no @var{caseid} is specified, in which
+case it assumes all @code{*.nc} files in @var{drc_in} constitute the
+input file list. 
+These examples invoke reshaping mode in the three possible ways:
+ at example
+# Pipe list to stdin
+cd $drc_in;ls *mdl*000[1-9]*.nc | ncclimo -v T,Q,RH -s 1 -e 9 -o $drc_out
+# Redirect list from file to stdin
+cd $drc_in;ls *mdl*000[1-9]*.nc > foo;ncclimo -v T,Q,RH -s 1 -e 9 -o $drc_out < foo
+# List as positional arguments
+ncclimo -v T,Q,RH -s 1 -e 9 -o $drc_out $drc_in/*mdl*000[1-9]*.nc
+# Glob directory
+ncclimo -v T,Q,RH -s 1 -e 9 -i $drc_in -o $drc_out
+ at end example
+Assuming each input file is a monthly average comprising the variables
+ at var{T}, @var{Q}, and @var{RH}, then the output will be files
+ at file{T_000101_000912.nc}, 
+ at file{Q_000101_000912.nc}, and
+ at file{RH_000101_000912.nc}. 
+ at command{ncclimo} @emph{reshapes} the input so that the outputs are
+continuous timeseries of each variable taken from all input files. 
+When necessary, the output is split into segments each containing no
+more than @var{ypf_max} (default 50) years of input, i.e., 
+ at file{T_000101_005012.nc}, @file{T_005101_009912.nc},
+ at file{T_010001_014912.nc}, etc.
+
 @unnumberedsubsec @acronym{MPAS-O/I} considerations
 @acronym{MPAS} ocean and ice models currently have their own
 (non-CESM'ish) naming convention that guarantees output files have the
@@ -17700,236 +17982,9 @@ Moreover, the climatologies can be generated in parallel.
 
 @page
 @html
-<a name="nces"></a> <!-- http://nco.sf.net/nco.html#nces -->
-<a name="ncea"></a> <!-- http://nco.sf.net/nco.html#ncea -->
- at end html
- at node nces netCDF Ensemble Statistics, ncecat netCDF Ensemble Concatenator, ncclimo netCDF Climatology Generator, Reference Manual
- at section @command{nces} netCDF Ensemble Statistics
- at cindex averaging data
- at cindex ensemble average
- at findex nces
-
- at noindent
-SYNTAX
- at example
-nces [-3] [-4] [-6] [-7] [-A] [-C] [-c]
-[--cnk_byt @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
-[--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
-[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
-[-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}] 
-[-L @var{dfl_lvl}] [-l @var{path}] [-n @var{loop}] [--no_tmp_fl] [--nsm_fl|grp] [--nsm_sfx sfx]
-[-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] [--rth_dbl|flt]
-[-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x] [-y @var{op_typ}]
-[@var{input-files}] [@var{output-file}]
- at end example
-
- at noindent
-DESCRIPTION
-
- at command{nces} performs gridpoint statistics (including, but not limited
-to, averages) on variables across an arbitrary number (an
- at dfn{ensemble}) of @var{input-files} and/or of input groups within each
-file. 
-Each file (or group) receives an equal weight.
- at command{nces} was formerly (until @acronym{NCO} version 4.3.9,
-released December, 2013) known as @command{ncea} (netCDF Ensemble
-Averager)@footnote{
-The old ncea command was deprecated in @acronym{NCO} version 4.3.9,  
-released December, 2013.
- at acronym{NCO} will attempt to maintain back-compatibility and work
-as expected with invocations of @command{ncea} for as long as possible.
-Please replace @command{ncea} by @command{nces} in all future work.}.
- at cindex ensemble
-For example, @command{nces} will average a set of files or groups,
-weighting each file or group evenly. 
-This is distinct from @command{ncra}, which performs statistics only
-over the record dimension(s) (e.g., @var{time}), and weights each record 
-in each record dimension evenly.
-
-The file or group is the logical unit of organization for the results of
-many scientific studies.
-Often one wishes to generate a file or group which is the statistical
-product (e.g., average) of many separate files or groups. 
-This may be to reduce statistical noise by combining the results of a
-large number of experiments, or it may simply be a step in a procedure 
-whose goal is to compute anomalies from a mean state. 
-In any case, when one desires to generate a file whose statistical
-properties are equally influenced by all the inputs, then @command{nces}
-is the operator to use. 
-
-Variables in the @var{output-file} are the same size as the variable
-hyperslab in each input file or group, and each input file or group
-must be the same size after hyperslabbing
- at footnote{As of @acronym{NCO} version 4.4.2 (released February, 2014)
- at command{nces} allows hyperslabs in all dimensions so long as the
-hyperslabs resolve to the same size. 
-The fixed (i.e., non-record) dimensions should be the same size in
-all ensemble members both before and after hyperslabbing, although
-the hyperslabs may (and usually do) change the size of the dimensions
-from the input to the output files.
-Prior to this, @command{nces} was only guaranteed to work on hyperslabs
-in the record dimension that resolved to the same size.}
- at cindex record dimension
- at cindex hyperslab
- at command{nces} does allow files to differ in the record dimension size
-if the requested record hyperslab (@pxref{Hyperslabs}) resolves to the
-same size for all files.  
- at command{nces} recomputes the record dimension hyperslab limits for
-each input file so that coordinate limits may be used to select equal
-length timeseries from unequal length files.
- at cindex @acronym{IPCC}
- at cindex @acronym{AR4}
- at cindex @acronym{CMIP}
-This simplifies analysis of unequal length timeseries from simulation
-ensembles (e.g., the @acronym{CMIP3} @acronym{IPCC} @acronym{AR4}
-archive).   
-
- at html
-<a name="nsm_fl"></a> <!-- http://nco.sf.net/nco.html#nsm_fl -->
-<a name="nsm_grp"></a> <!-- http://nco.sf.net/nco.html#nsm_grp -->
-<a name="nsm_sfx"></a> <!-- http://nco.sf.net/nco.html#nsm_sfx -->
- at end html
- at cindex @code{--nsm_fl}
- at cindex @code{--nsm_grp}
- at cindex @code{--ensemble_file}
- at cindex @code{--ensemble_group}
- at cindex @code{--nsm_sfx}
- at cindex @code{--ensemble_suffix}
- at command{nces} works in one of two modes, file ensembles 
-or group ensembles.
-File ensembles are the default (equivalent to the old @command{ncea}) 
-and may also be explicitly specified by the @samp{--nsm_fl} or
- at samp{--ensemble_file} switches.
-To perform statistics on ensembles of groups, a newer feature, use
- at samp{--nsm_grp} or @samp{--ensemble_group}.
-Members of a group ensemble are groups that share the same structure,
-parent group, and nesting level. 
-Members must be @dfn{leaf groups}, i.e., not contain any sub-groups.
-Their contents usually have different values because they are
-realizations of replicated experiments.  
-In group ensemble mode @command{nces} computes the statistics across 
-the ensemble, which may span multiple input files. 
-Files may contain members of multiple, distinct ensembles. 
-However, all ensembles must have at least one member in the first input 
-file. 
-Group ensembles behave as an unlimited dimension of datasets: 
-they may contain an arbitrary and extensible number of realizations in
-each file, and may be composed from multiple files. 
-
-Output statistics in group ensemble mode are stored in the parent group
-by default. 
-If the ensemble members are @file{/cesm/cesm_01} and
- at file{/cesm/cesm_02}, then the computed statistic will be in
- at file{/cesm} in the output file.   
-The @samp{--nsm_sfx} option instructs nces to instead store output in  
-a new child group of the parent created by attaching the suffix
-to the parent group's name, e.g., @samp{--nsm_sfx='_avg'} would store
-results in the output group @file{/cesm/cesm_avg}:
- at example
-nces --nsm_grp                  mdl1.nc mdl2.nc mdl3.nc out.nc
-nces --nsm_grp --nsm_sfx='_avg' mdl1.nc mdl2.nc mdl3.nc out.nc
- at end example
-
- at xref{Statistics vs. Concatenation}, for a description of the
-distinctions between the statistics tools and concatenators. 
- at cindex multi-file operators
- at cindex standard input
- at cindex @code{stdin}
-As a multi-file operator, @command{nces} will read the list of
- at var{input-files} from @code{stdin} if they are not specified 
-as positional arguments on the command line 
-(@pxref{Large Numbers of Files}).
-
-Like @command{ncra} and @command{ncwa}, @command{nces} treats coordinate
-variables as a special case.
-Coordinate variables are assumed to be the same in all ensemble members,
-so @command{nces} simply copies the coordinate variables that appear in 
-ensemble members directly to the output file.
-This has the same effect as averaging the coordinate variable across the
-ensemble, yet does not incur the time- or precision- penalties of
-actually averaging them.
- at command{ncra} and @command{ncwa} allow coordinate variables to be
-processed only by the linear average operation, regardless of the
-arithmetic operation type performed on the non-coordinate variables
-(@pxref{Operation Types}). 
-Thus it can be said that the three operators (@command{ncra},
- at command{ncwa}, and @command{nces}) all average coordinate variables
-(even though @command{nces} simply copies them).
-All other requested arithmetic operations (e.g., maximization,
-square-root, RMS) are applied only to non-coordinate variables.
-In these cases the linear average of the coordinate variable will be
-returned.
-
- at noindent
- at html
-<a name="xmp_ncea"></a> <!-- http://nco.sf.net/nco.html#xmp_ncea -->
-<a name="xmp_nces"></a> <!-- http://nco.sf.net/nco.html#xmp_nces -->
- at end html
-EXAMPLES
-
-Consider a model experiment which generated five realizations of one
-year of data, say 1985.
-Imagine that the experimenter slightly perturbs the initial conditions
-of the problem before generating each new solution.   
-Assume each file contains all twelve months (a seasonal cycle) of data
-and we want to produce a single file containing the ensemble average
-(mean) seasonal cycle.  
-Here the numeric filename suffix denotes the realization number
-(@emph{not} the month):
- at example
-nces 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
-nces 85_0[1-5].nc 85.nc
-nces -n 5,2,1 85_01.nc 85.nc
- at end example
- at noindent
-These three commands produce identical answers.
- at xref{Specifying Input Files}, for an explanation of the distinctions
-between these methods.
-The output file, @file{85.nc}, is the same size as the inputs files.
-It contains 12 months of data (which might or might not be stored in the 
-record dimension, depending on the input files), but each value in the
-output file is the average of the five values in the input files.
-
-In the previous example, the user could have obtained the ensemble
-average values in a particular spatio-temporal region by adding a 
-hyperslab argument to the command, e.g.,
- at example
-nces -d time,0,2 -d lat,-23.5,23.5 85_??.nc 85.nc
- at end example
- at noindent
-In this case the output file would contain only three slices of data in
-the @var{time} dimension. 
-These three slices are the average of the first three slices from the
-input files.
-Additionally, only data inside the tropics is included.
-
-As of @acronym{NCO} version 4.3.9 (released December, 2013)
- at command{nces} also works with groups (rather than files) as the
-fundamental unit of the ensemble.
-Consider two ensembles, @code{/ecmwf} and @code{/cesm} stored across
-three input files @file{mdl1.nc}, @file{mdl2.nc}, and @file{mdl3.nc}.
-Ensemble members would be leaf groups with names like @code{/ecmwf/01},
- at code{/ecmwf/02} etc. and @code{/cesm/01}, @code{/cesm/02}, etc.
-These commands average both ensembles: 
- at example
-nces --nsm_grp mdl1.nc mdl2.nc mdl3.nc out.nc
-nces --nsm_grp --nsm_sfx='_min' --op_typ=min -n 3,1,1 mdl1.nc out.nc
-nces --nsm_grp -g cesm -v tas -d time,0,3 -n 3,1,1 mdl1.nc out.nc
- at end example
-The first command stores averages in the output groups @file{/cesm} and 
- at file{/ecmwf}, while the second stores minima in the output groups
- at file{/cesm/cesm_min} and @file{/ecmwf/ecmwf_min}:
-The third command demonstrates that sub-setting and hyperslabbing work
-as expected.
-Note that each input file may contain different numbers of members
-of each ensemble, as long as all distinct ensembles contain at least one
-member in the first file.
-
- at page
- at html
 <a name="ncecat"></a> <!-- http://nco.sf.net/nco.html#ncecat -->
 @end html
- at node ncecat netCDF Ensemble Concatenator, ncflint netCDF File Interpolator, nces netCDF Ensemble Statistics, Reference Manual
+ at node ncecat netCDF Ensemble Concatenator, nces netCDF Ensemble Statistics, ncclimo netCDF Climatology Generator, Reference Manual
 @section @command{ncecat} netCDF Ensemble Concatenator
 @cindex concatenation
 @cindex ensemble concatenation
@@ -17943,7 +17998,8 @@ ncecat [-3] [-4] [-6] [-7] [-A] [-C] [-c]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--gag] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}]
-[-L @var{dfl_lvl}] [-l @var{path}] [-M] [--md5_digest] [--mrd] [-n @var{loop}] [--no_tmp_fl] 
+[-L @var{dfl_lvl}] [-l @var{path}] [-M] [--md5_digest] [--mrd] [-n @var{loop}]
+[--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] 
 [-t @var{thr_nbr}] [-u @var{ulm_nm}] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x] 
 [@var{input-files}] [@var{output-file}]
@@ -18193,9 +18249,237 @@ of changing variable dimensionality, including the record dimension.
 
 @page
 @html
+<a name="nces"></a> <!-- http://nco.sf.net/nco.html#nces -->
+<a name="ncea"></a> <!-- http://nco.sf.net/nco.html#ncea -->
+ at end html
+ at node nces netCDF Ensemble Statistics, ncflint netCDF File Interpolator, ncecat netCDF Ensemble Concatenator, Reference Manual
+ at section @command{nces} netCDF Ensemble Statistics
+ at cindex averaging data
+ at cindex ensemble average
+ at findex nces
+
+ at noindent
+SYNTAX
+ at example
+nces [-3] [-4] [-6] [-7] [-A] [-C] [-c]
+[--cnk_byt @var{sz_byt}] [--cnk_dmn @var{nm}, at var{sz_lmn}] [--cnk_map @var{map}]
+[--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
+[-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
+[-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}] 
+[-L @var{dfl_lvl}] [-l @var{path}] [-n @var{loop}]
+[--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [--nsm_fl|grp] [--nsm_sfx sfx]
+[-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] [--rth_dbl|flt]
+[-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x] [-y @var{op_typ}]
+[@var{input-files}] [@var{output-file}]
+ at end example
+
+ at noindent
+DESCRIPTION
+
+ at command{nces} performs gridpoint statistics (including, but not limited
+to, averages) on variables across an arbitrary number (an
+ at dfn{ensemble}) of @var{input-files} and/or of input groups within each
+file. 
+Each file (or group) receives an equal weight.
+ at command{nces} was formerly (until @acronym{NCO} version 4.3.9,
+released December, 2013) known as @command{ncea} (netCDF Ensemble
+Averager)@footnote{
+The old ncea command was deprecated in @acronym{NCO} version 4.3.9,  
+released December, 2013.
+ at acronym{NCO} will attempt to maintain back-compatibility and work
+as expected with invocations of @command{ncea} for as long as possible.
+Please replace @command{ncea} by @command{nces} in all future work.}.
+ at cindex ensemble
+For example, @command{nces} will average a set of files or groups,
+weighting each file or group evenly. 
+This is distinct from @command{ncra}, which performs statistics only
+over the record dimension(s) (e.g., @var{time}), and weights each record 
+in each record dimension evenly.
+
+The file or group is the logical unit of organization for the results of
+many scientific studies.
+Often one wishes to generate a file or group which is the statistical
+product (e.g., average) of many separate files or groups. 
+This may be to reduce statistical noise by combining the results of a
+large number of experiments, or it may simply be a step in a procedure 
+whose goal is to compute anomalies from a mean state. 
+In any case, when one desires to generate a file whose statistical
+properties are equally influenced by all the inputs, then @command{nces}
+is the operator to use. 
+
+Variables in the @var{output-file} are the same size as the variable
+hyperslab in each input file or group, and each input file or group
+must be the same size after hyperslabbing
+ at footnote{As of @acronym{NCO} version 4.4.2 (released February, 2014)
+ at command{nces} allows hyperslabs in all dimensions so long as the
+hyperslabs resolve to the same size. 
+The fixed (i.e., non-record) dimensions should be the same size in
+all ensemble members both before and after hyperslabbing, although
+the hyperslabs may (and usually do) change the size of the dimensions
+from the input to the output files.
+Prior to this, @command{nces} was only guaranteed to work on hyperslabs
+in the record dimension that resolved to the same size.}
+ at cindex record dimension
+ at cindex hyperslab
+ at command{nces} does allow files to differ in the record dimension size
+if the requested record hyperslab (@pxref{Hyperslabs}) resolves to the
+same size for all files.  
+ at command{nces} recomputes the record dimension hyperslab limits for
+each input file so that coordinate limits may be used to select equal
+length timeseries from unequal length files.
+ at cindex @acronym{IPCC}
+ at cindex @acronym{AR4}
+ at cindex @acronym{CMIP}
+This simplifies analysis of unequal length timeseries from simulation
+ensembles (e.g., the @acronym{CMIP3} @acronym{IPCC} @acronym{AR4}
+archive).   
+
+ at html
+<a name="nsm_fl"></a> <!-- http://nco.sf.net/nco.html#nsm_fl -->
+<a name="nsm_grp"></a> <!-- http://nco.sf.net/nco.html#nsm_grp -->
+<a name="nsm_sfx"></a> <!-- http://nco.sf.net/nco.html#nsm_sfx -->
+ at end html
+ at cindex @code{--nsm_fl}
+ at cindex @code{--nsm_grp}
+ at cindex @code{--ensemble_file}
+ at cindex @code{--ensemble_group}
+ at cindex @code{--nsm_sfx}
+ at cindex @code{--ensemble_suffix}
+ at command{nces} works in one of two modes, file ensembles 
+or group ensembles.
+File ensembles are the default (equivalent to the old @command{ncea}) 
+and may also be explicitly specified by the @samp{--nsm_fl} or
+ at samp{--ensemble_file} switches.
+To perform statistics on ensembles of groups, a newer feature, use
+ at samp{--nsm_grp} or @samp{--ensemble_group}.
+Members of a group ensemble are groups that share the same structure,
+parent group, and nesting level. 
+Members must be @dfn{leaf groups}, i.e., not contain any sub-groups.
+Their contents usually have different values because they are
+realizations of replicated experiments.  
+In group ensemble mode @command{nces} computes the statistics across 
+the ensemble, which may span multiple input files. 
+Files may contain members of multiple, distinct ensembles. 
+However, all ensembles must have at least one member in the first input 
+file. 
+Group ensembles behave as an unlimited dimension of datasets: 
+they may contain an arbitrary and extensible number of realizations in
+each file, and may be composed from multiple files. 
+
+Output statistics in group ensemble mode are stored in the parent group
+by default. 
+If the ensemble members are @file{/cesm/cesm_01} and
+ at file{/cesm/cesm_02}, then the computed statistic will be in
+ at file{/cesm} in the output file.   
+The @samp{--nsm_sfx} option instructs nces to instead store output in  
+a new child group of the parent created by attaching the suffix
+to the parent group's name, e.g., @samp{--nsm_sfx='_avg'} would store
+results in the output group @file{/cesm/cesm_avg}:
+ at example
+nces --nsm_grp                  mdl1.nc mdl2.nc mdl3.nc out.nc
+nces --nsm_grp --nsm_sfx='_avg' mdl1.nc mdl2.nc mdl3.nc out.nc
+ at end example
+
+ at xref{Statistics vs. Concatenation}, for a description of the
+distinctions between the statistics tools and concatenators. 
+ at cindex multi-file operators
+ at cindex standard input
+ at cindex @code{stdin}
+As a multi-file operator, @command{nces} will read the list of
+ at var{input-files} from @code{stdin} if they are not specified 
+as positional arguments on the command line 
+(@pxref{Large Numbers of Files}).
+
+Like @command{ncra} and @command{ncwa}, @command{nces} treats coordinate
+variables as a special case.
+Coordinate variables are assumed to be the same in all ensemble members,
+so @command{nces} simply copies the coordinate variables that appear in 
+ensemble members directly to the output file.
+This has the same effect as averaging the coordinate variable across the
+ensemble, yet does not incur the time- or precision- penalties of
+actually averaging them.
+ at command{ncra} and @command{ncwa} allow coordinate variables to be
+processed only by the linear average operation, regardless of the
+arithmetic operation type performed on the non-coordinate variables
+(@pxref{Operation Types}). 
+Thus it can be said that the three operators (@command{ncra},
+ at command{ncwa}, and @command{nces}) all average coordinate variables
+(even though @command{nces} simply copies them).
+All other requested arithmetic operations (e.g., maximization,
+square-root, RMS) are applied only to non-coordinate variables.
+In these cases the linear average of the coordinate variable will be
+returned.
+
+ at noindent
+ at html
+<a name="xmp_ncea"></a> <!-- http://nco.sf.net/nco.html#xmp_ncea -->
+<a name="xmp_nces"></a> <!-- http://nco.sf.net/nco.html#xmp_nces -->
+ at end html
+EXAMPLES
+
+Consider a model experiment which generated five realizations of one
+year of data, say 1985.
+Imagine that the experimenter slightly perturbs the initial conditions
+of the problem before generating each new solution.   
+Assume each file contains all twelve months (a seasonal cycle) of data
+and we want to produce a single file containing the ensemble average
+(mean) seasonal cycle.  
+Here the numeric filename suffix denotes the realization number
+(@emph{not} the month):
+ at example
+nces 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
+nces 85_0[1-5].nc 85.nc
+nces -n 5,2,1 85_01.nc 85.nc
+ at end example
+ at noindent
+These three commands produce identical answers.
+ at xref{Specifying Input Files}, for an explanation of the distinctions
+between these methods.
+The output file, @file{85.nc}, is the same size as the inputs files.
+It contains 12 months of data (which might or might not be stored in the 
+record dimension, depending on the input files), but each value in the
+output file is the average of the five values in the input files.
+
+In the previous example, the user could have obtained the ensemble
+average values in a particular spatio-temporal region by adding a 
+hyperslab argument to the command, e.g.,
+ at example
+nces -d time,0,2 -d lat,-23.5,23.5 85_??.nc 85.nc
+ at end example
+ at noindent
+In this case the output file would contain only three slices of data in
+the @var{time} dimension. 
+These three slices are the average of the first three slices from the
+input files.
+Additionally, only data inside the tropics is included.
+
+As of @acronym{NCO} version 4.3.9 (released December, 2013)
+ at command{nces} also works with groups (rather than files) as the
+fundamental unit of the ensemble.
+Consider two ensembles, @code{/ecmwf} and @code{/cesm} stored across
+three input files @file{mdl1.nc}, @file{mdl2.nc}, and @file{mdl3.nc}.
+Ensemble members would be leaf groups with names like @code{/ecmwf/01},
+ at code{/ecmwf/02} etc. and @code{/cesm/01}, @code{/cesm/02}, etc.
+These commands average both ensembles: 
+ at example
+nces --nsm_grp mdl1.nc mdl2.nc mdl3.nc out.nc
+nces --nsm_grp --nsm_sfx='_min' --op_typ=min -n 3,1,1 mdl1.nc out.nc
+nces --nsm_grp -g cesm -v tas -d time,0,3 -n 3,1,1 mdl1.nc out.nc
+ at end example
+The first command stores averages in the output groups @file{/cesm} and 
+ at file{/ecmwf}, while the second stores minima in the output groups
+ at file{/cesm/cesm_min} and @file{/ecmwf/ecmwf_min}:
+The third command demonstrates that sub-setting and hyperslabbing work
+as expected.
+Note that each input file may contain different numbers of members
+of each ensemble, as long as all distinct ensembles contain at least one
+member in the first file.
+
+ at page
+ at html
 <a name="ncflint"></a> <!-- http://nco.sf.net/nco.html#ncflint -->
 @end html
- at node ncflint netCDF File Interpolator, ncks netCDF Kitchen Sink, ncecat netCDF Ensemble Concatenator, Reference Manual
+ at node ncflint netCDF File Interpolator, ncks netCDF Kitchen Sink, nces netCDF Ensemble Statistics, Reference Manual
 @section @command{ncflint} netCDF File Interpolator
 @cindex interpolation
 @cindex adding data
@@ -18211,7 +18495,8 @@ ncflint [-3] [-4] [-6] [-7] [-A] [-C] [-c]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]]
 [-F] [--fix_rec_crd] [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
-[-i @var{var}, at var{val3}] [-L @var{dfl_lvl}] [-l @var{path}] [-N] [--no_tmp_fl] 
+[-i @var{var}, at var{val3}] [-L @var{dfl_lvl}] [-l @var{path}] [-N]
+[--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{file_3}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] 
 [-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-w @var{wgt1}[, at var{wgt2}]] [-X ...] [-x]
 @var{file_1} @var{file_2} [@var{file_3}]
@@ -18507,7 +18792,7 @@ ncks [-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b @var{fl_bnr}] [-C] [-c] [--cdl]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [--grp_xtr_var_xcl]
 [-H] [-h] [--hdn] [--hdr_pad @var{nbr}] [--jsn] [--jsn_fmt @var{lvl}] 
 [-L @var{dfl_lvl}] [-l @var{path}] [-M] [-m] [--map @var{map-file}] 
-[--md5] [--mk_rec_dmn @var{dim}] [--no_blank] [--no_tmp_fl] 
+[--md5] [--mk_rec_dmn @var{dim}] [--no_blank] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-P] [-p @var{path}] [--ppc ...]
 [-Q] [-q] [-R] [-r] [--rad] [--ram_all] [--rgr ...] [--rnr=wgt] [-s @var{format}] 
 [-u] [--unn] [-V] [-v @var{var}[, at dots{}]] [-X ...] [-x] [--xml]
@@ -18690,6 +18975,27 @@ coordinates to the binary file:
 40
 @end example
 
+
+ at html
+<a name="chunk_cache"></a> <!-- http://nco.sf.net/nco.html#chunk_cache -->
+<a name="cnk_csh"></a> <!-- http://nco.sf.net/nco.html#cnk_csh -->
+<a name="cache"></a> <!-- http://nco.sf.net/nco.html#cache -->
+<a name="csh"></a> <!-- http://nco.sf.net/nco.html#csh -->
+ at end html
+ at cindex chunk cache size
+ at cindex cache size
+ at cindex @code{--cnk_csh @var{sz}}
+ at cindex @code{--chunk_cache @var{sz}}
+Set the per-variable chunk cache size to @var{sz} bytes.
+By default, the per-variable cache size is set (by the 
+ at code{--with-chunk-cache-size} option to @command{configure}) at netCDF
+compile time. 
+This option changes the per-variable cache size.
+When the debugging level is set (with @code{-D @var{dbg_lvl}}) to three
+or higher, @acronym{NCO} prints the current value of the cache settings
+for informational purposes. 
+Also @samp{--chunk_cache}.
+
 @html
 <a name="dmn_fix_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_fix_mk -->
 <a name="fix_rec_dmn"></a> <!-- http://nco.sf.net/nco.html#fix_rec_dmn -->
@@ -19589,6 +19895,16 @@ Shell commands may be re-used when they are defined in shell
 configuration files.
 These files are usually named @file{.bashrc}, @file{.cshrc}, and
 @file{.profile} for the Bash, Csh, and Sh shells, respectively.
+ at cindex minimum
+ at cindex maximum
+ at cindex median
+ at cindex mode
+ at cindex range
+ at html
+<a name="median"></a> <!-- http://nco.sf.net/nco.html#median -->
+<a name="mode"></a> <!-- http://nco.sf.net/nco.html#mode -->
+<a name="range"></a> <!-- http://nco.sf.net/nco.html#range -->
+ at end html
 @example
 @verbatim
 # NB: Untested on Csh, Ksh, Sh, Zsh! Send us feedback!
@@ -19927,7 +20243,8 @@ ncpdq [-3] [-4] [-6] [-7] [-A] [-a [-]@var{dim}[, at dots{}]] [-C] [-c]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]]
 [-F] [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}]
-[-L @var{dfl_lvl}] [-l @var{path}] [-M @var{pck_map}] [--mrd] [--no_tmp_fl] 
+[-L @var{dfl_lvl}] [-l @var{path}] [-M @var{pck_map}] [--mrd]
+[--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-P @var{pck_plc}] [-p @var{path}] [--ppc ...]
 [-R] [-r] [--ram_all] [-t @var{thr_nbr}] [-U] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x]
 @var{input-file} [@var{output-file}]
@@ -20525,7 +20842,8 @@ ncra [-3] [-4] [-6] [-7] [-A] [-C] [-c] [--cb]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdf] [--hdr_pad @var{nbr}] 
-[-L @var{dfl_lvl}] [-l @var{path}] [--mro] [-N] [-n @var{loop}] [--no_tmp_fl]
+[-L @var{dfl_lvl}] [-l @var{path}] [--mro] [-N] [-n @var{loop}] 
+[--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn] [--rth_dbl|flt]
 [-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-w wgt] [-X ...] [-x] [-y @var{op_typ}]
 [@var{input-files}] [@var{output-file}]
@@ -20773,7 +21091,8 @@ ncrcat [-3] [-4] [-6] [-7] [-A] [-C] [-c]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}][,[@var{subcycle}]]]] [-F]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}]
-[-L @var{dfl_lvl}] [-l @var{path}] [--md5_digest] [-n @var{loop}] [--no_tmp_fl]
+[-L @var{dfl_lvl}] [-l @var{path}] [--md5_digest] [-n @var{loop}]
+[--no_tmp_fl] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn]
 [-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-X ...] [-x] 
 [@var{input-files}] [@var{output-file}]
@@ -21231,7 +21550,7 @@ until, ideally, each core on the node is used.
 Remember that processes and threading are multiplicative in core use.
 Four jobs each with four threads consumes sixteen cores.
 
-As an example, consider regridding 100 files with a single map.
+As an example, consider regridding @w{100 files} with a single map.
 Say you have a five-node cluster, and each node has @w{16 cores}
 and can simultaneously regrid two files using eight threads each.
 (One needs to test a bit to determine these parameters.)
@@ -21546,9 +21865,11 @@ If @var{unq_sfx} is @samp{noclean} then @command{ncremap} retains
 @cindex @code{-v @var{var_lst}}
 @cindex @var{var_lst}
 @cindex @code{--var_lst}
- at cindex @code{--variable_list}
+ at cindex @code{--var}
+ at cindex @code{--vars}
 @cindex @code{--variables}
- at item -v @var{var_lst} (@code{--var_lst}, @code{--variable_list}, @code{--variables})
+ at cindex @code{--variable_list}
+ at item -v @var{var_lst} (@code{--var_lst}, @code{--var}, @code{--vars}, @code{--variables}, @code{--variable_list})
 The @samp{-v} option causes @command{ncremap} to regrid only the
 variables in @var{var_lst}. 
 It behaves like subsetting (@pxref{Subsetting Files}) in the rest of
@@ -22253,7 +22574,8 @@ ncwa [-3] [-4] [-6] [-7] [-A] [-a @var{dim}[, at dots{}]] [-B @var{mask_cond}] [-b]
 [--cnk_min @var{sz_byt}] [--cnk_plc @var{plc}] [--cnk_scl @var{sz_lmn}]
 [-D @var{dbg}] [-d @var{dim},[@var{min}][,[@var{max}][,[@var{stride}]]] [-F]
 [-G @var{gpe_dsc}] [-g @var{grp}[, at dots{}]] [--glb ...] [-h] [--hdr_pad @var{nbr}] [-I]
-[-L @var{dfl_lvl}] [-l @var{path}] [-M @var{mask_val}] [-m @var{mask_var}] [-N] [--no_tmp_fl]
+[-L @var{dfl_lvl}] [-l @var{path}] [-M @var{mask_val}] [-m @var{mask_var}] [-N] 
+[--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] 
 [-O] [-o @var{output-file}] [-p @var{path}] [--ppc ...] [-R] [-r] [--ram_all] [--rth_dbl|flt]
 [-T @var{mask_comp}] [-t @var{thr_nbr}] [--unn] [-v @var{var}[, at dots{}]] [-w @var{weight}]
 [-X ...] [-x] [-y @var{op_typ}]
diff --git a/man/ncap.1 b/man/ncap.1
index 5cceb51..8b6d172 100644
--- a/man/ncap.1
+++ b/man/ncap.1
@@ -108,7 +108,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncap2.1 b/man/ncap2.1
index 821594c..8a7b507 100644
--- a/man/ncap2.1
+++ b/man/ncap2.1
@@ -112,7 +112,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncatted.1 b/man/ncatted.1
index 1380288..0143f3e 100644
--- a/man/ncatted.1
+++ b/man/ncatted.1
@@ -507,7 +507,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncbo.1 b/man/ncbo.1
index 4ec1162..98de5cb 100644
--- a/man/ncbo.1
+++ b/man/ncbo.1
@@ -37,7 +37,7 @@ ncbo [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR dfl_lvl ] 
 [\-l 
 .IR path ]
-[\-\-msa] [\-\-no_tmp_fl] [\-O] [\-p 
+[\-\-msa] [\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-p 
 .IR path ]
 [\-R] [\-r] [\-\-ram_all] [\-t
 .IR thr_nbr ]
@@ -355,7 +355,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncclimo.1 b/man/ncclimo.1
index 81b1470..64220b5 100644
--- a/man/ncclimo.1
+++ b/man/ncclimo.1
@@ -25,6 +25,8 @@ ncclimo
 .IR hst_nm ] 
 [\-i
 .IR drc_in ] 
+[\-j
+.IR job_nbr ] 
 [\-l
 .IR lnk_flg ] 
 [\-m
@@ -57,6 +59,8 @@ ncclimo
 .IR rgr_xtn ] 
 [\-y
 .IR rgr_prv ] 
+[\--ypf_max
+.IR ypf_max ] 
 
 .SH DESCRIPTION
 .PP
@@ -78,7 +82,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncecat.1 b/man/ncecat.1
index ad91183..4b13bf8 100644
--- a/man/ncecat.1
+++ b/man/ncecat.1
@@ -39,7 +39,7 @@ ncecat [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR path ]
 [\-M] [\-\-mrd] [\-\-msa] [\-n 
 .IR loop ]
-[\-\-no_tmp_fl] [\-O] [\-p 
+[\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-p 
 .IR path ]
 [\-\-ppc 
 .IR var1 [,
@@ -141,7 +141,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/nces.1 b/man/nces.1
index c686f8b..0f7e11f 100644
--- a/man/nces.1
+++ b/man/nces.1
@@ -35,7 +35,7 @@ nces [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR path ]
 [\-\-msa] [\-N] [\-n 
 .IR loop ]
-[\-\-no_tmp_fl] [\-\-nsm_sfx
+[\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-\-nsm_sfx
 .IR grp_sfx ]
 [\-O] [\-p 
 .IR path ]
@@ -154,7 +154,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncflint.1 b/man/ncflint.1
index 830242c..b678281 100644
--- a/man/ncflint.1
+++ b/man/ncflint.1
@@ -36,7 +36,7 @@ ncflint [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR var, val3 ] [\-L 
 .IR dfl_lvl ] [\-l 
 .IR path ]
-[\-\-msa] [\-N] [\-\-no_tmp_fl] [\-O] [\-p 
+[\-\-msa] [\-N] [\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-p 
 .IR path ]
 [\-\-ppc 
 .IR var1 [,
@@ -191,7 +191,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncks.1 b/man/ncks.1
index c4ded6a..c5e73d2 100644
--- a/man/ncks.1
+++ b/man/ncks.1
@@ -11,6 +11,7 @@ ncks [\-3] [\-4] [\-5] [\-6] [\-7] [\-A] [\-a] [\-b
 [\-\-bfr
 .IR sz_byt ] [\-C] [\-c] 
 [\-\-cdl] [\-\-cnk_byt
+.IR sz_byt ] [\-\-cnk_csh
 .IR sz_byt ] [\-\-cnk_dmn 
 .IR nm,sz_lmn ]
 [\-\-cnk_map 
@@ -49,7 +50,7 @@ dbg_lvl]
 .IR map-file ]
 [\-\-md5] [\-\-mk_rec_dmn
 .IR dim ]
-[\-\-msa] [\-\-no_blank] [\-\-no_tmp_fl] [\-O] [\-o 
+[\-\-msa] [\-\-no_blank] [\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-o 
 .IR output-file ] 
 [\-P] [\-p 
 .IR path ]
@@ -623,7 +624,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/nco.1 b/man/nco.1
index 1213a22..ab9ed41 100644
--- a/man/nco.1
+++ b/man/nco.1
@@ -126,7 +126,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncpdq.1 b/man/ncpdq.1
index 2eb5335..5040e01 100644
--- a/man/ncpdq.1
+++ b/man/ncpdq.1
@@ -40,7 +40,7 @@ ncpdq [\-3] [\-4] [\-6] [\-7] [\-A] [\-a
 .IR path ]
 [\-M 
 .IR pck_map ]
-[\-\-mrd] [\-\-msa] [\-\-no_tmp_fl] [\-O] [\-o 
+[\-\-mrd] [\-\-msa] [\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-o 
 .IR output-file ]
 [\-P 
 .IR pck_plc ]
@@ -139,7 +139,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncra.1 b/man/ncra.1
index 671adb1..efbad39 100644
--- a/man/ncra.1
+++ b/man/ncra.1
@@ -40,7 +40,7 @@ ncra [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR path ]
 [\-\-mro] [\-\-msa] [\-N] [\-n 
 .IR loop ]
-[\-\-no_cll_mth] [\-\-no_tmp_fl] [\-O] [\-p 
+[\-\-no_cll_msr] [\-\-no_cll_mth] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-p 
 .IR path ]
 [\-\-ppc 
 .IR var1 [,
@@ -168,7 +168,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncrcat.1 b/man/ncrcat.1
index 4a5186d..389e2bf 100644
--- a/man/ncrcat.1
+++ b/man/ncrcat.1
@@ -40,7 +40,7 @@ ncrcat [\-3] [\-4] [\-6] [\-7] [\-A] [\-\-bfr
 .IR path ]
 [\-\-mro] [\-\-msa] [\-n
 .IR loop]
-[\-\-no_tmp_fl] [\-O] [\-p
+[\-\-no_cll_msr] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-p
 .IR path ]
 [\-\-ppc 
 .IR var1 [,
@@ -185,7 +185,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncremap.1 b/man/ncremap.1
index 2af97fb..3ceaa97 100644
--- a/man/ncremap.1
+++ b/man/ncremap.1
@@ -86,7 +86,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncrename.1 b/man/ncrename.1
index 10dfe79..0dcacec 100644
--- a/man/ncrename.1
+++ b/man/ncrename.1
@@ -208,7 +208,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/man/ncwa.1 b/man/ncwa.1
index 263b003..685d9ed 100644
--- a/man/ncwa.1
+++ b/man/ncwa.1
@@ -43,7 +43,7 @@ ncwa [\-3] [\-4] [\-6] [\-7] [\-A] [\-a
 .IR val ]
 [\-m 
 .IR mask ]
-[\-N] [\-\-no_cll_mth] [\-\-no_tmp_fl] [\-O] [\-o 
+[\-N] [\-\-no_cll_msr] [\-\-no_cll_mth] [\-\-no_frm_trm] [\-\-no_tmp_fl] [\-O] [\-o 
 .IR output-file ]
 [\-p 
 .IR path ]
@@ -224,7 +224,7 @@ manual pages written by Charlie Zender and originally formatted by Brian Mays.
 Report bugs to <http://sf.net/bugs/?group_id=3331>.
 
 .SH COPYRIGHT
-Copyright \(co 1995-2016 Charlie Zender
+Copyright \(co 1995-2017 Charlie Zender
 .br
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/src/nco++/ExitException.hpp b/src/nco++/ExitException.hpp
new file mode 100644
index 0000000..e6935fd
--- /dev/null
+++ b/src/nco++/ExitException.hpp
@@ -0,0 +1,34 @@
+#ifndef INC_ExitException_hpp__
+#define INC_ExitException_hpp__
+
+#include <antlr/config.hpp>
+#include <antlr/ANTLRException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Baseclass for exceptions thrown by classes implementing the Exit
+ * interface.
+ * @see Exit
+ */
+class ANTLR_API ExitException : public ANTLRException {
+public:
+	ExitException() 
+	: ANTLRException()	
+	{
+	}
+	ExitException(const ANTLR_USE_NAMESPACE(std)string& s)
+	: ANTLRException(s)
+	{
+	}
+	virtual ~ExitException() throw()
+	{
+	}
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ExitException_hpp__
diff --git a/src/nco++/Invoke.cc b/src/nco++/Invoke.cc
index 99cd5a3..2cb1651 100644
--- a/src/nco++/Invoke.cc
+++ b/src/nco++/Invoke.cc
@@ -17,6 +17,8 @@
 #include <antlr/CharStreamException.hpp>
 #include <antlr/TokenStreamException.hpp>
 #include "antlr/TokenStreamSelector.hpp"
+#include "ExitException.hpp"
+
 #include "Invoke.hh"
 
 #include "sdo_utl.hh" // SDO stand-alone utilities: dbg/err/wrn_prn()
@@ -126,7 +128,8 @@ int parse_antlr(std::vector<prs_cls> &prs_vtr,char *fl_spt_usr,char *cmd_ln_sng)
   ANTLR_USING_NAMESPACE(antlr);
   
   const std::string fnc_nm("parse_antlr"); // [sng] Function name
-
+  bool bExit=false;
+  int iret;
   int idx;
   int thd_nbr=(int)prs_vtr.size();  
   std::string filename(fl_spt_usr);
@@ -212,9 +215,11 @@ int parse_antlr(std::vector<prs_cls> &prs_vtr,char *fl_spt_usr,char *cmd_ln_sng)
   
   t=a;
   
-  try {   
+  try 
+  {   
     ncoTree* wlk_obj;    
-    for(idx=0 ; idx< thd_nbr; idx++){
+    for(idx=0 ; idx< thd_nbr; idx++)
+    {
       wlk_obj=new ncoTree(&prs_vtr[idx]);  
       wlk_obj->initializeASTFactory(ast_factory);
       wlk_obj->setASTFactory(&ast_factory);
@@ -226,9 +231,19 @@ int parse_antlr(std::vector<prs_cls> &prs_vtr,char *fl_spt_usr,char *cmd_ln_sng)
     if(nco_dbg_lvl_get() >= nco_dbg_fl) dbg_prn(fnc_nm,"Walkers initialized");
   
     wlk_vtr[0]->run_exe(t,0);
-  }  catch(std::exception& e) {
-    cerr << "exception: " << e.what() << endl;
-  }	
+  }  
+    catch (ExitException &strExit)   
+    {
+      bExit=true;
+      // remember ExitEXception ONLY returns an int in a string
+      iret=atoi(strExit.getMessage().c_str());
+      if(nco_dbg_lvl_get() >= nco_dbg_fl) 
+         cerr<<"Exit Exception "<<iret<< endl;
+    }
+    catch(std::exception& e) 
+    {
+      cerr << "exception: " << e.what() << endl;
+    } 
   
   if(nco_dbg_lvl_get() >= nco_dbg_fl) dbg_prn(fnc_nm,"Walkers completed");
   
@@ -242,5 +257,9 @@ int parse_antlr(std::vector<prs_cls> &prs_vtr,char *fl_spt_usr,char *cmd_ln_sng)
 
   //(void)nco_free(filename);
   
-  return 1;
+  if(bExit)
+    return iret;
+  else
+    return 0;  
+
 } /* end parse_antlr() */
diff --git a/src/nco++/Makefile.am b/src/nco++/Makefile.am
index 45d01aa..d02243a 100644
--- a/src/nco++/Makefile.am
+++ b/src/nco++/Makefile.am
@@ -23,6 +23,7 @@ ANTLR = runantlr
 ncap2_SOURCES = Invoke.cc \
 ncap2.cc \
 ncap2_utl.cc \
+ncap2_att.cc \
 sdo_utl.cc \
 sym_cls.cc \
 fmc_cls.cc \
diff --git a/src/nco++/Makefile.in b/src/nco++/Makefile.in
index 925db47..902e848 100644
--- a/src/nco++/Makefile.in
+++ b/src/nco++/Makefile.in
@@ -111,11 +111,11 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_ncap2_OBJECTS = Invoke.$(OBJEXT) ncap2.$(OBJEXT) \
-	ncap2_utl.$(OBJEXT) sdo_utl.$(OBJEXT) sym_cls.$(OBJEXT) \
-	fmc_cls.$(OBJEXT) fmc_all_cls.$(OBJEXT) fmc_gsl_cls.$(OBJEXT) \
-	prs_cls.$(OBJEXT) NcapVar.$(OBJEXT) NcapVarVector.$(OBJEXT) \
-	ncoLexer.$(OBJEXT) ncoParser.$(OBJEXT) ncoTree.$(OBJEXT) \
-	nco_gsl.$(OBJEXT)
+	ncap2_utl.$(OBJEXT) ncap2_att.$(OBJEXT) sdo_utl.$(OBJEXT) \
+	sym_cls.$(OBJEXT) fmc_cls.$(OBJEXT) fmc_all_cls.$(OBJEXT) \
+	fmc_gsl_cls.$(OBJEXT) prs_cls.$(OBJEXT) NcapVar.$(OBJEXT) \
+	NcapVarVector.$(OBJEXT) ncoLexer.$(OBJEXT) ncoParser.$(OBJEXT) \
+	ncoTree.$(OBJEXT) nco_gsl.$(OBJEXT)
 ncap2_OBJECTS = $(am_ncap2_OBJECTS)
 ncap2_LDADD = $(LDADD)
 AM_V_lt = $(am__v_lt_ at AM_V@)
@@ -370,6 +370,7 @@ ANTLR = runantlr
 ncap2_SOURCES = Invoke.cc \
 ncap2.cc \
 ncap2_utl.cc \
+ncap2_att.cc \
 sdo_utl.cc \
 sym_cls.cc \
 fmc_cls.cc \
@@ -510,6 +511,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fmc_cls.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fmc_gsl_cls.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ncap2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ncap2_att.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ncap2_utl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ncoLexer.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ncoParser.Po at am__quote@
diff --git a/src/nco++/Makefile.old b/src/nco++/Makefile.old
index f51e11a..262bc7a 100644
--- a/src/nco++/Makefile.old
+++ b/src/nco++/Makefile.old
@@ -3,7 +3,7 @@
 # Purpose: Makefile for NCO C++ directory nco++
 # Requires GNU Make---AT&T Make chokes on GNU syntax
 
-# Copyright (C) 1994--2016 Charlie Zender
+# Copyright (C) 1994--2017 Charlie Zender
 # License: GNU General Public License (GPL) Version 3
 # See http://www.gnu.org/copyleft/gpl.html for full license text
 
@@ -1389,6 +1389,7 @@ $(libnco++).a : inc $(libnco++).a(${MY_OBJ_DIR}/sym_cls.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/Invoke.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/NcapVar.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/NcapVarVector.o) \
+	$(libnco++).a(${MY_OBJ_DIR}/ncap2_att.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/ncap2_utl.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/ncoLexer.o) \
 	$(libnco++).a(${MY_OBJ_DIR}/ncoParser.o) \
diff --git a/src/nco++/fmc_all_cls.cc b/src/nco++/fmc_all_cls.cc
index 8ed0a23..62c9ce5 100644
--- a/src/nco++/fmc_all_cls.cc
+++ b/src/nco++/fmc_all_cls.cc
@@ -2,13 +2,12 @@
 
 /* Purpose: netCDF arithmetic processor class methods: families of functions/methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
 
 #include "fmc_all_cls.hh"
-
 //Conversion Functions /***********************************/
  
   cnv_cls::cnv_cls(bool flg_dbg){
@@ -3246,19 +3245,27 @@ double bil_cls::clc_lin_ipl(double x1,double x2, double x, double Q0,double Q1){
   var2=walker.out(args_vtr[1]);  
 
   
-  if(prs_arg->ntl_scn  ){
+  var_ret=nco_var_dpl(var2);     
+  
+  if(!var_ret->undefined)
+      var_ret=nco_var_cnf_typ(NC_INT,var_ret);
+  
+  if(prs_arg->ntl_scn  )
+  {
     nco_var_free(var1);
     nco_var_free(var2);
-    return ncap_sclr_var_mk(SCS("~coord_function"),(nc_type)NC_INT,false);  ;
+    return var_ret;
   }
 
-
+  // do heavy lifting 
   {
     bool bInc;
     long idx;
-    long sz;
+    long jdx;
+    long c_sz;
+    long r_sz;  
+    nco_int *ip;
     double dval;
-    double dmin; 
     double *dp_crd; 
     
     var1=nco_var_cnf_typ(NC_DOUBLE,var1);
@@ -3267,37 +3274,54 @@ double bil_cls::clc_lin_ipl(double x1,double x2, double x, double Q0,double Q1){
     // convert everything to type double         
     (void)cast_void_nctype(NC_DOUBLE,&(var1->val));
     (void)cast_void_nctype(NC_DOUBLE,&(var2->val));
+    (void)cast_void_nctype(NC_INT,&(var_ret->val));
 
+    r_sz=var_ret->sz;
+    ip=var_ret->val.ip;  
+
+    c_sz=var1->sz;  
     dp_crd=var1->val.dp;  
-    dval=var2->val.dp[0];   
-    sz=var1->sz;  
+       
+    // dval=var2->val.dp[0];   
+
     
     // determine if co-ord is montonic increasing or decreasing 
     // true if increasing 
     bInc= ( dp_crd[1] > dp_crd[0]); 
         
-    lret=-1; // set to not in range
     // check limits co-ord increasing 
     if(bInc){
-      if(dval>=dp_crd[0] && dval<=dp_crd[sz-1] )
-         for(idx=0 ; idx<sz-1 ; idx++)
-           if( dval >= dp_crd[idx] && dval <= dp_crd[idx+1] ){  
-	      lret=(dval-dp_crd[idx]<= dp_crd[idx+1]-dval ? idx: idx+1 );    
-              break;
-	   }  
-    }  
+      for(idx=0;idx<r_sz;idx++){ 
+	 dval=var2->val.dp[idx]; 
+         /* default set to out of range */   
+         ip[idx]=-1;  
+         if(dval>=dp_crd[0] && dval<=dp_crd[c_sz-1] )
+           for(jdx=0 ; jdx<c_sz-1 ; jdx++)
+             if( dval >= dp_crd[jdx] && dval <= dp_crd[jdx+1] )
+             {  
+	        ip[idx]=(dval-dp_crd[jdx]<= dp_crd[jdx+1]-dval ? jdx: jdx+1 );    
+                break;
+	     }  
+      }
+    }
     // check limits co-ord decreasing
     if(!bInc){
-      if(dval<=dp_crd[0] && dval>=dp_crd[sz-1] )
-         for(idx=0 ; idx<sz-1 ; idx++)
-           if( dval <= dp_crd[idx] && dval >= dp_crd[idx+1] ){  
-	      lret=(dp_crd[idx]-dval <= dval-dp_crd[idx+1] ? idx: idx+1 );    
-              break;
-	   }  
-    }  
-                  
-     (void)cast_nctype_void(NC_DOUBLE,&var1->val);
+      for(idx=0;idx<r_sz;idx++){  
+	 dval=var2->val.dp[idx]; 
+         /* default set to out of range */   
+         ip[idx]=-1;  
+         if(dval<=dp_crd[0] && dval>=dp_crd[c_sz-1] )
+           for(jdx=0 ; jdx<c_sz-1 ; jdx++)
+             if( dval <= dp_crd[jdx] && dval >= dp_crd[jdx+1] )
+             {  
+	        ip[idx]=(dp_crd[jdx]-dval <= dval-dp_crd[jdx+1] ? jdx: jdx+1 );    
+                break;
+	     }  
+      }  
+    }              
+    (void)cast_nctype_void(NC_DOUBLE,&var1->val);
     (void)cast_nctype_void(NC_DOUBLE,&var2->val);
+    (void)cast_nctype_void(NC_INT,&var_ret->val);
   
    
   }
@@ -3305,7 +3329,7 @@ double bil_cls::clc_lin_ipl(double x1,double x2, double x, double Q0,double Q1){
   nco_var_free(var1);   
   nco_var_free(var2);
 
-  return ncap_sclr_var_mk(SCS("~coord_function"),(nco_int)lret);        
+  return var_ret;        
   }
 
 
@@ -4799,7 +4823,7 @@ var_sct *vlist_cls::push_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_cl
 
     #ifdef ENABLE_UDUNITS
     # ifdef HAVE_UDUNITS2_H
-       rcd=nco_cln_clc_dbl_var_dff(units_in_sng,units_out_sng,cln_typ,(double*)NULL, var); 
+       rcd=nco_cln_clc_dbl_var_dff(units_in_sng,units_out_sng,cln_typ,(double*)NULL, var);
     #endif
     #endif
    
@@ -4819,7 +4843,12 @@ var_sct *vlist_cls::push_fnd(bool &is_mtd, std::vector<RefAST> &vtr_args, fmc_cl
     nco_var_cnf_typ(lcl_typ,var);
  
 
-  nco_var_free(var_ud_in); 
+  if(var_cln)
+    var_cln=nco_var_free(var_cln);
+
+  if(var_ud_in)
+    var_ud_in=nco_var_free(var_ud_in); 
+  
 
   return var;
 
diff --git a/src/nco++/fmc_all_cls.hh b/src/nco++/fmc_all_cls.hh
index 90510e7..2b73b1a 100644
--- a/src/nco++/fmc_all_cls.hh
+++ b/src/nco++/fmc_all_cls.hh
@@ -1,6 +1,6 @@
 /* Purpose: netCDF arithmetic processor class methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/fmc_cls.hh b/src/nco++/fmc_cls.hh
index 942a69c..90890e0 100644
--- a/src/nco++/fmc_cls.hh
+++ b/src/nco++/fmc_cls.hh
@@ -1,6 +1,6 @@
 /* Purpose: netCDF arithmetic processor class methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/fmc_gsl_cls.cc b/src/nco++/fmc_gsl_cls.cc
index f6b86ef..e5c75a1 100644
--- a/src/nco++/fmc_gsl_cls.cc
+++ b/src/nco++/fmc_gsl_cls.cc
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF arithmetic processor class methods for GSL */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/fmc_gsl_cls.hh b/src/nco++/fmc_gsl_cls.hh
index 022c65c..e587ce7 100644
--- a/src/nco++/fmc_gsl_cls.hh
+++ b/src/nco++/fmc_gsl_cls.hh
@@ -1,6 +1,6 @@
 /* Purpose: netCDF arithmetic processor class methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/libnco++.hh b/src/nco++/libnco++.hh
index 55e6fb0..5715413 100644
--- a/src/nco++/libnco++.hh
+++ b/src/nco++/libnco++.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Prototypes, typedefs, and global variables for libnco++
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -28,6 +28,7 @@
 #include "NcapVar.hh"
 #include "NcapVarVector.hh"
 #include "ncap2_utl.hh"
+#include "ncap2_att.hh"
 #include "prs_cls.hh"
 #include "sdo_utl.hh"
 #include "ncap2_utl.hh"
diff --git a/src/nco++/ncap2.cc b/src/nco++/ncap2.cc
index 9ee489c..4332e6f 100644
--- a/src/nco++/ncap2.cc
+++ b/src/nco++/ncap2.cc
@@ -4,7 +4,7 @@
 
 /* Purpose: Compute user-defined derived fields using forward algebraic notation applied to netCDF files */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -165,6 +165,7 @@ main(int argc,char **argv)
   int opt;
   int out_id;  
   int rcd=NC_NOERR; /* [rcd] Return code */
+  int antlr_ret=EXIT_SUCCESS; /* exit return code from script */
   int var_id;
   int thr_nbr=int_CEWI; /* [nbr] Thread number Option t */
   
@@ -808,7 +809,7 @@ main(int argc,char **argv)
         (void)fprintf(stderr,"spt_arg[%d] = %s\n",idx,spt_arg[idx]);
     } /* endif debug */
      /* Invoke ANTLR parser */
-    rcd=parse_antlr(prs_vtr,fl_cmd_usr,spt_arg_cat);
+    antlr_ret=parse_antlr(prs_vtr,fl_cmd_usr,spt_arg_cat);
   }
   
   // execute in ANTLR user specified script 
@@ -817,7 +818,7 @@ main(int argc,char **argv)
       err_prn(fnc_nm,"Unable to open script file "+std::string(fl_spt_usr));
     fclose(yyin); 
     /* Invoke ANTLR parser */
-    rcd=parse_antlr(prs_vtr,fl_spt_usr,(char *)NULL);
+    antlr_ret=parse_antlr(prs_vtr,fl_spt_usr,(char *)NULL);
   }
 
 
@@ -1105,8 +1106,13 @@ main(int argc,char **argv)
     var_fix_out=(var_sct **)nco_free(var_fix_out);
   } /* !flg_cln */
   
-  nco_exit_gracefully();
-  return EXIT_SUCCESS;
+  // nco_exit_gracefully();
+  (void)fclose(stderr);
+  (void)fclose(stdin);
+  (void)fclose(stdout);
+  (void)nco_free(nco_prg_nm_get());
+
+  nco_exit(antlr_ret);
 } /* end main() */
 
 // Copy vector elements
@@ -1125,6 +1131,9 @@ void
 ram_vars_add
 (prs_cls *prs_arg)
 {
+  char buff[20]={0};
+  double dnan;
+
   var_sct *var1;
   
   var1=ncap_sclr_var_mk(std::string("NC_BYTE"),nco_int(NC_NAT));
@@ -1184,8 +1193,6 @@ ram_vars_add
   prs_arg->ncap_var_write(var1,true);
 #endif // !HUGE_VAL
 
-  char buff[20];
-  double dnan;
 #ifndef _MSC_VER
   if((dnan=nan(buff))){
     var1=ncap_sclr_var_mk(std::string("nan"),dnan); // double
diff --git a/src/nco++/ncap2_att.cc b/src/nco++/ncap2_att.cc
new file mode 100644
index 0000000..395bc6b
--- /dev/null
+++ b/src/nco++/ncap2_att.cc
@@ -0,0 +1,783 @@
+#include "ncap2_att.hh"
+
+
+nco_bool              // O [flg] true if var has an att name                         
+ncap_var_is_att(      //   [fnc] check var          
+var_sct *var)         // I [sct] var to check
+{
+  if( strchr(var->nm,'@') !=NULL_CEWI ) 
+    return True;
+  return False;
+}
+
+
+std::string           // O [sng] text of va
+ncap_att2var          //   [fnc] return text content of var
+( prs_cls *prs_arg,   // I [cls] var/att symbol tables
+  std::string att_nm) // I [sn]  contains var name to read
+{
+
+  std::string fnc_nm("ncap_att2var");
+  std::string sn; 
+  var_sct *var_att=NULL_CEWI; 
+  NcapVar *Nvar=NULL;
+
+  if(prs_arg->ntl_scn)
+    Nvar=prs_arg->int_vtr.find(att_nm);
+
+  if(Nvar==NULL) 
+    Nvar=prs_arg->var_vtr.find(att_nm);
+
+  if(Nvar !=NULL)
+    var_att=nco_var_dpl(Nvar->var);
+  else    
+    var_att=ncap_att_init(att_nm,prs_arg);
+
+  if(prs_arg->ntl_scn==False  && var_att==NULL_CEWI )
+    err_prn(fnc_nm,"Unable to locate attribute " +att_nm+ " in input or output files.");
+
+            
+  /* empty so return empty string */ 
+  if(var_att==NULL_CEWI )
+    return sn;
+
+  /* cant resolve pointer here */
+  if(var_att->val.vp==NULL_CEWI)
+  {
+    nco_var_free(var_att);      
+    return sn;
+  }
+
+  if(var_att->type !=NC_STRING && var_att->type !=NC_CHAR )
+    err_prn("To use that attribute "+ att_nm +" as a variable pointer it must be a text type  NC_CHAR or NC_STRING"); 
+    
+  cast_void_nctype(var_att->type, &var_att->val );
+  if(var_att->type == NC_STRING)
+  {
+      sn=var_att->val.sngp[0];
+  }
+  else if( var_att->type==NC_CHAR)
+  {        
+      char buffer[100]={'\0'};
+      strncpy(buffer, var_att->val.cp, var_att->sz);
+      sn=buffer;  
+  } 
+ 
+  cast_nctype_void(var_att->type, &var_att->val);
+  nco_var_free(var_att);  
+
+  return sn;
+
+}
+
+
+
+
+var_sct *                    // O [sct] variable containing attribute 
+ncap_att_init                //   [fnc] Grab an attribute from input file or symbol table
+(const std::string s_va_nm,  // I [sng] att name of form var_nm&att_nm */ 
+ prs_cls *prs_arg)           // I/O [vec]  of atts & vars 
+{
+  int rcd;
+  int var_id;
+  
+  std::string var_nm;
+  std::string att_nm;
+  size_t  att_char_posn;
+  
+  var_sct *var_ret;
+  
+  //check if we have an attribute
+  if( (att_char_posn =s_va_nm.find("@")) ==std::string::npos )
+    return NULL_CEWI; 
+  
+  var_nm=s_va_nm.substr(0,att_char_posn);
+  att_nm=s_va_nm.substr(att_char_posn+1);
+  
+  if(var_nm == "global"){
+    var_id=NC_GLOBAL;
+  }else{
+    rcd=nco_inq_varid_flg(prs_arg->in_id,var_nm.c_str(),&var_id);
+    if(rcd != NC_NOERR) return NULL_CEWI;
+  }
+  
+  var_ret=ncap_att_get(var_id,var_nm.c_str(),att_nm.c_str(),1,prs_arg);
+  return var_ret;
+}
+
+
+
+var_sct*                      // O [sct] variable containing attribute 
+ncap_att_get                   
+(int var_id,
+ const char *var_nm,
+ const char *att_nm,
+ int location, /* I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
+ prs_cls *prs_arg)
+{
+  int rcd;
+  int fl_id=int_CEWI;
+  long sz;
+  
+  char *ln_nm;
+  
+  nc_type type;
+  var_sct *var_ret;
+  
+  if(location == 1) fl_id=prs_arg->in_id;  
+  if(location == 2) fl_id=prs_arg->out_id;  
+  
+  rcd=nco_inq_att_flg(fl_id,var_id,att_nm,&type,&sz);
+  if(rcd == NC_ENOTATT) return NULL_CEWI;
+  
+  var_ret=(var_sct*)nco_malloc(sizeof(var_sct));
+  (void)var_dfl_set(var_ret);
+  
+  // Make name of the form var_nm at att_nm
+  ln_nm=(char *)nco_malloc((strlen(var_nm)+strlen(att_nm)+2)*sizeof(char));
+  strcpy(ln_nm,var_nm);strcat(ln_nm,"@");strcat(ln_nm,att_nm);
+  
+  var_ret->nm=ln_nm;
+  var_ret->id=var_id;
+  var_ret->nc_id=prs_arg->in_id;
+  var_ret->type=type;
+  var_ret->sz=sz;
+  // maybe needed ?
+  var_ret->nbr_dim=0;
+  
+  // Fill with data if NOT an initial scan
+  if(!prs_arg->ntl_scn){
+    var_ret->val.vp=(void *)nco_malloc(sz*nco_typ_lng(type));
+    rcd=nco_get_att(fl_id,var_id,att_nm,var_ret->val.vp,type);
+    if (rcd != NC_NOERR) {
+      var_ret=nco_var_free(var_ret);
+      return NULL_CEWI;
+    }
+  }
+  return var_ret; 
+}
+
+
+int
+ncap_att_gnrl
+(const std::string s_dst,
+ const std::string s_src,
+ int location, /* I [flg] 1: attributes from INPUT file, 2: attributes from OUTPUT file */
+ prs_cls  *prs_arg){
+  int idx;
+  int srt_idx;
+  int sz;
+  int rcd;
+  int var_id; 
+  int nbr_att;
+  int fl_id=int_CEWI;
+  char att_nm[NC_MAX_NAME]; 
+  const char *tmp_att_nm;
+  const char scl_fct_sng[]="scale_factor"; /* [sng] Unidata standard string for scale factor */
+  const char add_fst_sng[]="add_offset"; /* [sng] Unidata standard string for add offset */
+  
+  var_sct *var_att;
+  
+  std::string s_fll;
+  
+  NcapVar *Nvar;
+  
+  // De-reference 
+  NcapVarVector &var_vtr=prs_arg->var_vtr;
+  NcapVarVector att_vtr; // hold new attributes.
+  
+  if(location == 1) fl_id=prs_arg->in_id;  
+  if(location == 2) fl_id=prs_arg->out_id;  
+  
+  // get var_id
+  rcd=nco_inq_varid_flg(fl_id,s_src.c_str(),&var_id);
+  
+  if(rcd == NC_NOERR){
+    (void)nco_inq_varnatts(fl_id,var_id,&nbr_att);
+    // loop though attributes
+    for(idx=0; idx <nbr_att ; idx++){
+      (void)nco_inq_attname(fl_id,var_id,idx,att_nm);
+      //skip missing value, scale_factor , add_offset
+      if(!strcmp(att_nm,nco_mss_val_sng_get()) || !strcmp(att_nm,scl_fct_sng) || !strcmp(att_nm,add_fst_sng))
+        continue;
+      var_att=ncap_att_get(var_id,s_src.c_str(),att_nm,location,prs_arg);
+      // Add to list (change the name!)
+      if(var_att){ 
+	s_fll=s_dst+"@"+std::string(att_nm);
+        Nvar=new NcapVar(var_att,s_fll);
+	att_vtr.push_back(Nvar);
+      } 
+    } // end for
+  }// end rcd
+  
+  sz=var_vtr.size();
+  if(s_dst != s_src && (srt_idx=var_vtr.find_lwr(s_src+"@")) != -1){  
+    
+    for(idx=srt_idx;idx<sz;idx++){ 
+      if(s_src != var_vtr[idx]->getVar()) break;
+      if((var_vtr)[idx]->xpr_typ != ncap_att) continue;
+      tmp_att_nm=var_vtr[idx]->getAtt().c_str();
+      // skip missing value, scale_factor, add_offset
+      if(!strcmp(tmp_att_nm,nco_mss_val_sng_get()) || !strcmp(tmp_att_nm,scl_fct_sng) || !strcmp(tmp_att_nm,add_fst_sng))
+        continue;
+
+      // Create string for new attribute
+      s_fll=s_dst+"@"+(var_vtr[idx]->getAtt());
+      var_att=nco_var_dpl(var_vtr[idx]->var);
+      Nvar=new NcapVar(var_att,s_fll);
+      att_vtr.push_back(Nvar);
+    }
+  }
+  
+  sz=att_vtr.size();
+  // add new att to list;
+  for(idx=0;idx< sz;idx++){
+    
+#ifdef _OPENMP
+    if(omp_in_parallel())
+      prs_arg->thr_vtr.push_back(att_vtr[idx]);
+    else
+      var_vtr.push_ow(att_vtr[idx]);         
+#else
+    var_vtr.push_ow(att_vtr[idx]);         
+#endif
+  }
+  return sz;
+  
+} /* end ncap_att_gnrl() */
+
+
+nco_bool /* O [flg] true if var has been stretched */
+ncap_att_stretch /* stretch a single valued attribute from 1 to sz */
+(var_sct* var, /* I/O [sct] variable */       
+ long nw_sz) /* I [nbr] new var size */
+{
+  long  idx;
+  long  var_typ_sz;  
+  void* vp;
+  char *cp;
+
+  
+  if(var->sz > 1L || nw_sz <1) return false; 
+  if(nw_sz==1) return true;
+  var_typ_sz=nco_typ_lng(var->type);
+
+  // shouldnt really use this function with NC_STRING
+  // All it does is free exising single string
+  // and and calloc space for new ones
+  if(var->type == (nc_type)NC_STRING)
+  {
+    
+    (void)cast_void_nctype((nc_type)NC_STRING,&var->val);    
+    
+    nco_free(var->val.sngp[0]);  
+    nco_free(var->val.sngp);     
+    
+    var->val.sngp=(char**)nco_calloc(nw_sz,var_typ_sz);         
+    (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
+
+    
+  }
+  else
+  {
+    vp=(void*)nco_malloc(nw_sz*var_typ_sz);    
+    for(idx=0;idx<nw_sz;idx++){
+      cp=(char*)vp+(ptrdiff_t)(idx*var_typ_sz);
+      memcpy(cp,var->val.vp,var_typ_sz);
+    }
+
+    var->val.vp=(void*)nco_free(var->val.vp);
+    var->sz=nw_sz;
+    var->val.vp=vp;
+
+  }
+  
+  return true;
+} /* end ncap_att_stretch */
+
+
+int 
+ncap_att_cpy_sct
+(var_sct *var1,
+ var_sct *var2,
+ prs_cls  *prs_arg){
+  
+  NcapVar *Nvar=prs_arg->var_vtr.find(var1->nm);
+  // Do attribute propagation only if
+  // var doesn't already exist 
+  
+  if(!Nvar ||  Nvar->flg_stt==1)
+    (void)ncap_att_cpy(var1->nm,var2->nm,prs_arg);
+  
+  return 0;
+  
+} 	
+
+
+int
+ncap_att_cpy
+(const std::string s_dst,
+ const std::string s_src,
+ prs_cls  *prs_arg)
+{
+  
+  int nbr_att=0;
+  //Don't propagate if s_src is a tree-parser generated var
+  if(prs_arg->ATT_PROPAGATE && s_dst != s_src && s_src[0]!='~' )
+    nbr_att=ncap_att_gnrl(s_dst,s_src,1,prs_arg);
+  
+  if(prs_arg->ATT_INHERIT)
+    nbr_att=ncap_att_gnrl(s_dst,s_dst,1,prs_arg);
+  
+  return nbr_att;
+}
+
+void 
+ncap_att_prn     /* [fnc] Print a single attribute*/
+(var_sct *var,   /* I Variable containing att */
+ char *const att_in_sng) /* user defined format string */
+{
+  char dlm_sng[3];
+  char att_sng[NCO_MAX_LEN_FMT_SNG];
+  
+  long att_lmn;
+  long att_sz;
+  
+  /* Copy value to avoid indirection in loop over att_sz */
+  att_sz=var->sz;
+  
+  if(att_in_sng ==(char*)NULL) {        
+    if(var->type != NC_CHAR && var->type != NC_STRING)
+       (void)fprintf(stdout,"%s, size = %li %s, value = ",var->nm,att_sz,nco_typ_sng(var->type));
+    /* Typecast pointer to values before access */
+    (void)cast_void_nctype(var->type,&var->val);
+    (void)strcpy(dlm_sng,", ");
+    (void)sprintf(att_sng,"%s%%s",nco_typ_fmt_sng(var->type));
+    /* user defined format string */ 
+  } else {
+    (void)strcpy(att_sng,att_in_sng);
+    (void)strcpy(dlm_sng,"");
+  }
+  
+  switch(var->type){
+  case NC_FLOAT:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.fp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_DOUBLE:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.dp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_SHORT:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.sp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_INT:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,(long)var->val.ip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_CHAR:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++){
+      char char_foo;
+      /* Assume \0 is string terminator and do not print it */
+      if((char_foo=var->val.cp[att_lmn]) != '\0') (void)fprintf(stdout,"%c",char_foo);
+    } /* end loop over element */
+    break;
+  case NC_BYTE:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.bp[att_lmn]);
+    break;
+  case NC_UBYTE:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.ubp[att_lmn]);
+    break;
+  case NC_USHORT:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.usp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_UINT:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.uip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_INT64:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.i64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_UINT64:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.ui64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  case NC_STRING:
+    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.sngp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
+    break;
+  default: nco_dfl_case_nc_type_err();
+    break;
+  } /* end switch */
+
+  /* only print if format string NOT user defined  */
+  if(att_in_sng ==(char*)NULL && var->type != NC_CHAR && var->type != NC_STRING )
+      (void)fprintf(stdout,"\n");
+  
+  (void)cast_nctype_void(var->type,&var->val);
+  
+  (void)fflush(stdout);
+  
+} /* end ncap_att_prn() */
+
+
+char * 
+ncap_att_sprn     /* [fnc] Print a single attribute*/
+(var_sct *var,   /* I Variable containing att */
+ char *const att_in_sng) /* user defined format string */
+{
+
+  char char_foo;
+  char dlm_sng[3];
+  char att_sng[NCO_MAX_LEN_FMT_SNG];
+   
+  char *tp;
+  char *cp;    
+  char *cp_max;  
+
+  long att_lmn;
+  long att_sz; 
+  long max_sz;
+  
+  /* Copy value to avoid indirection in loop over att_sz */
+  att_sz=var->sz;
+  
+  cp=(char*)nco_calloc(sizeof(char),(NC_MAX_ATTRS+100)); 
+  tp=cp;  
+  cp_max=cp+ (size_t)(NC_MAX_ATTRS+100); 
+
+
+
+  if(att_in_sng ==(char*)NULL) {        
+    /* default dont bother if att info if type is text */
+    if(var->type != NC_CHAR && var->type != NC_STRING)
+    {     
+      (void)sprintf(tp,"%s, size = %li %s, value = ",var->nm,att_sz,nco_typ_sng(var->type));
+      tp+=strlen(tp); 
+    }
+    /* Typecast pointer to values before access */
+    (void)strcpy(dlm_sng,", ");
+    (void)sprintf(att_sng,"%s%%s",nco_typ_fmt_sng(var->type));
+    /* user defined format string */ 
+  } else {
+    (void)strcpy(att_sng,att_in_sng);
+    (void)strcpy(dlm_sng,"");
+  }
+      
+  (void)cast_void_nctype(var->type,&var->val);
+
+  
+  switch(var->type){
+  case NC_FLOAT:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++) { (void)sprintf(tp,att_sng,var->val.fp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_DOUBLE:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++) { (void)sprintf(tp,att_sng,var->val.dp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");  tp+=strlen(tp); }
+    break;
+  case NC_SHORT:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.sp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_INT:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,(long)var->val.ip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_CHAR:
+    if(att_in_sng ==(char*)NULL)    
+      /* remember string initialized to nulls */
+      strncpy(tp,var->val.cp,att_sz);
+    else          
+    {
+      for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++)
+        /* Assume \0 is string terminator and do not print it */
+        if((char_foo=var->val.cp[att_lmn]) != '\0') 
+	{ 
+           (void)sprintf(tp,att_sng,char_foo);   
+           tp+=strlen(tp); 
+        } 
+    } /* end loop over element */
+
+    break;
+  case NC_BYTE:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.bp[att_lmn], (att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_UBYTE:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.ubp[att_lmn], (att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_USHORT:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.usp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_UINT:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.uip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_INT64:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.i64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_UINT64:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.ui64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
+    break;
+  case NC_STRING:
+    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ; att_lmn++) { (void)sprintf(tp,att_sng,var->val.sngp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");tp+=strlen(tp); }
+    break;
+  default: nco_dfl_case_nc_type_err();
+    break;
+  } /* end switch */
+  
+  (void)cast_nctype_void(var->type,&var->val);
+  
+  if( tp >= cp_max )
+  {
+    cp=(char*)nco_realloc(cp, NC_MAX_ATTRS*sizeof(char));     
+    cp[NC_MAX_ATTRS-1]='\0';
+  }
+  else
+  {
+    cp=(char*)nco_realloc(cp, sizeof(char) * (strlen(cp)+1));     
+  }       
+  
+  return cp;
+
+} /* end ncap_att_prn() */
+
+
+int          /* number appended */ 
+ncap_att_str /* extract string(s) from a NC_CHAR or NC_STRING type attribute */
+(var_sct *var_att, 
+ std::vector<std::string> &str_vtr)
+{
+  int idx;
+  int srt_size=str_vtr.size();  
+  char *cstr;
+  
+  (void)cast_void_nctype((nc_type)var_att->type,&var_att->val);
+
+  if(var_att->type==NC_STRING)
+  {
+
+    for(idx=0;idx<var_att->sz;idx++)
+    {  
+      cstr=var_att->val.sngp[idx];
+      str_vtr.push_back(cstr);
+    }     
+
+  }
+
+  if(var_att->type==NC_CHAR)
+  { 
+    char buffer[NC_MAX_NAME+1];
+    strncpy(buffer, var_att->val.cp, var_att->sz);        
+    buffer[var_att->sz+1]='\0'; 
+    str_vtr.push_back(buffer);
+  } 
+  (void)cast_nctype_void((nc_type)var_att->type,&var_att->val);
+  
+  return (str_vtr.size() - srt_size);  
+
+
+
+}
+
+
+char *          /* new malloc'ed string */ 
+ncap_att_char  /* extract string from a NC_CHAR or first NC_STRING */
+(var_sct *var_att)
+{
+  int idx;
+  char *cstr;
+  
+  (void)cast_void_nctype((nc_type)var_att->type,&var_att->val);
+
+  if(var_att->type==NC_STRING)
+  {
+    /* grab only first string */
+    cstr=strdup(var_att->val.sngp[0]);
+
+  }
+
+  if(var_att->type==NC_CHAR)
+  { 
+    cstr=(char*)nco_malloc( (var_att->sz+1) *sizeof(char));
+    strncpy(cstr, var_att->val.cp, var_att->sz);        
+    cstr[var_att->sz]='\0'; 
+  } 
+  (void)cast_nctype_void((nc_type)var_att->type,&var_att->val);
+  
+  return cstr;  
+
+}
+
+
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nc_type type,
+ bool bfll)
+{
+  /* Purpose: Create a scalar variable of type, if bfll then malloc ptr_unn */
+  var_sct *var;
+  var=(var_sct *)nco_malloc(sizeof(var_sct));
+  /* Set defaults */
+  (void)var_dfl_set(var); 
+  /* Overwrite with variable expression information */
+  var->nm=strdup(var_nm.c_str());
+  var->nbr_dim=0;
+  var->sz=1;
+  var->type=type;
+  var->typ_dsk=type;
+  
+  if(bfll) var->val=nco_mss_val_mk(type);  
+  
+  return var;
+} // end ncap_sclr_var_mk<string,int,bool>()
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ float val_float)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_FLOAT,true);
+  (void)cast_void_nctype((nc_type)NC_FLOAT,&var->val);
+  *var->val.fp=val_float;
+  (void)cast_nctype_void((nc_type)NC_FLOAT,&var->val);
+  return var;
+} // end ncap_sclr_var_mk<float>()
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ double val_double)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_DOUBLE,true);
+  (void)cast_void_nctype((nc_type)NC_DOUBLE,&var->val);
+  *var->val.dp=val_double;
+  (void)cast_nctype_void((nc_type)NC_DOUBLE,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_int val_int)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_INT,true);
+  (void)cast_void_nctype((nc_type)NC_INT,&var->val);
+  *var->val.ip=val_int;
+
+  (void)cast_nctype_void((nc_type)NC_INT,&var->val);
+  return var;
+}
+ 
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_short val_short)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_SHORT,true);
+  (void)cast_void_nctype((nc_type)NC_SHORT,&var->val);
+  *var->val.sp=val_short;
+  (void)cast_nctype_void((nc_type)NC_SHORT,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_char val_char)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_CHAR,true);
+  (void)cast_void_nctype((nc_type)NC_CHAR,&var->val);
+  *var->val.cp=val_char;
+  (void)cast_nctype_void((nc_type)NC_CHAR,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_byte val_byte)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_BYTE,true);
+  (void)cast_void_nctype((nc_type)NC_BYTE,&var->val);
+  *var->val.bp=val_byte;
+  (void)cast_nctype_void((nc_type)NC_BYTE,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_ubyte val_ubyte)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UBYTE,true);
+  (void)cast_void_nctype((nc_type)NC_UBYTE,&var->val);
+  *var->val.ubp=val_ubyte;
+  (void)cast_nctype_void((nc_type)NC_UBYTE,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_ushort val_ushort)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_USHORT,true);
+  (void)cast_void_nctype((nc_type)NC_USHORT,&var->val);
+  *var->val.usp=val_ushort;
+  (void)cast_nctype_void((nc_type)NC_USHORT,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_uint val_uint)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UINT,true);
+  (void)cast_void_nctype((nc_type)NC_UINT,&var->val);
+  *var->val.uip=val_uint;
+  (void)cast_nctype_void((nc_type)NC_UINT,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_int64 val_int64)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_INT64,true);
+  (void)cast_void_nctype((nc_type)NC_INT64,&var->val);
+  *var->val.i64p=val_int64;
+  (void)cast_nctype_void((nc_type)NC_INT64,&var->val);
+  return var;
+}
+
+var_sct *
+ncap_sclr_var_mk
+(const std::string var_nm,
+ nco_uint64 val_uint64)
+{
+  var_sct *var;
+  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UINT64,true);
+  (void)cast_void_nctype((nc_type)NC_UINT64,&var->val);
+  *var->val.ui64p=val_uint64;
+  (void)cast_nctype_void((nc_type)NC_UINT64,&var->val);
+  return var;
+}
+
+/* fxm: Allow ncap2 to instantiate NC_STRINGs */
+   var_sct *
+   ncap_sclr_var_mk(
+   const std::string var_nm,
+   nco_string val_string)
+   {
+   var_sct *var;
+   var=ncap_sclr_var_mk(var_nm,(nc_type)NC_STRING,true);
+   (void)cast_void_nctype((nc_type)NC_STRING,&var->val);
+   *var->val.sngp=val_string;
+   (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
+   return var;
+   } 
+
diff --git a/src/nco++/ncap2_att.hh b/src/nco++/ncap2_att.hh
new file mode 100644
index 0000000..52f7324
--- /dev/null
+++ b/src/nco++/ncap2_att.hh
@@ -0,0 +1,203 @@
+#ifndef NCAP2_ATT_HH /* Header file has not yet been defined in current source file */
+#define NCAP2_ATT_HH
+
+#ifdef HAVE_CONFIG_H
+#include <config.h> /* Autotools tokens */
+#endif /* !HAVE_CONFIG_H */
+
+/* Standard header files */
+#include <string>
+#include <math.h> /* sin cos cos sin 3.14159 */
+#include <stdio.h> /* stderr, FILE, NULL, etc. */
+#include <stdlib.h> /* atof, atoi, malloc, getopt */
+#include <string.h> /* strcmp. . . */
+#include <time.h> /* machine time */
+#ifndef _MSC_VER
+#include <unistd.h> /* POSIX stuff */
+#endif
+#if !(defined __xlC__) && !(defined SGIMP64) // C++ compilers that do not allow stdint.h
+#include <stdint.h> // Required by g++ for LLONG_MAX, ULLONG_MAX, by icpc for int64_t
+#endif // C++ compilers that do not allow stdint.h
+
+#include <assert.h>
+#include <cmath> // sin cos cos sin 3.14159
+#include <ctype.h>
+
+// Standard C++ headers
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+
+/* 3rd party vendors */
+#include <netcdf.h> /* netCDF definitions and C library */
+#include "nco_netcdf.h" /* NCO wrappers for libnetcdf.a */
+//#include <antlr/AST.hpp> /* nneeded for ast_ind struct */
+//#include "ncoParserTokenTypes.hpp"
+
+
+/* Personal headers */
+#include "libnco.h" /* netCDF Operator (NCO) library */
+#include "ncap2_utl.hh"
+#include "prs_cls.hh"
+
+
+
+nco_bool        /* Reurns True if var has attribute style name */
+ncap_var_is_att( 
+var_sct *var);
+
+std::string ncap_att2var
+( prs_cls *prs_arg,   
+  std::string att_nm);
+
+
+var_sct * /* O [sct] variable containing attribute */
+ncap_att_init /* [fnc] Grab an attribute from input file */
+(const std::string s_va_nm, /* I [sng] att name of form var_nm&att_nm */ 
+ prs_cls *prs_arg); /* I/O vectors of atts & vars & file names */
+
+
+var_sct*               /* O [sct] variable containing attribute */
+ncap_att_get	       /*   [fnc] Grab an attribute from input file */	
+(int var_id,           /*   I  var id        */ 
+ const char *var_nm,   /*   I [sng] var name */
+ const char *att_nm,   /*   I [sng] att name */
+ int location,         /*   I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
+ prs_cls *prs_arg);    /* I/O vectors of atts & vars & file names  */
+
+
+var_sct *                /* O [sct] variable containing attribute */
+ncap_att_init(           /*   [fnc] Grab an attribute from input file */
+std::string va_nm,       /* I [sng] att name of form var_nm&att_nm */ 
+prs_cls *prs_arg);       /* I/O vectors of atts & vars & file names  */
+
+
+
+int
+ncap_att_gnrl
+(const std::string s_dst,
+ const std::string s_src,
+ int location,         /*   I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
+ prs_cls  *prs_arg);
+
+
+
+nco_bool                /* O [flg] true if var has been stretched */
+ncap_att_stretch    /* stretch a single valued attribute from 1 to sz */
+(var_sct* var,      /* I/O [sct] variable */       
+ long nw_sz);       /* I [nbr] new var size */
+
+
+int 
+ncap_att_cpy_sct
+(var_sct *var1,
+ var_sct *var2,
+ prs_cls  *prs_arg);
+
+int             
+ncap_att_cpy
+(const std::string s_dst,
+ const std::string s_src,
+ prs_cls  *prs_arg);
+
+void 
+ncap_att_prn   
+(var_sct *var, 
+ char *const att_in_sng);
+
+char *            /* [0] sng - malloced inside function */
+ncap_att_sprn     /* [fnc] Print a single attribute*/
+(var_sct *var,   /* I Variable containing att */
+ char *const att_in_sng); /* user defined format string */
+
+
+int                 /* number appended */ 
+ncap_att_str        /* extract string(s) from a NC_CHAR or NC_STRING type attribute */
+(var_sct *var_att,  /* I [sct] input attribute */
+ std::vector<std::string> &str_vtr);
+
+char *            /* new malloc'ed string */ 
+ncap_att_char    /* extract string from a NC_CHAR or first NC_STRING */
+(var_sct *var_att);
+
+
+/*********************** make scalar vars/atts ********************************************/
+
+// ncap_sclr_var_mk() overloads
+/* Create a scalar variable of type, if bfill then malloc ptr_unn */
+var_sct*
+ncap_sclr_var_mk(
+const std::string var_nm,
+nc_type type,
+//bool bfll=false); fxm csz
+bool bfll);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+float val_float);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+double val_double);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_int val_int);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_short val_short);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_char val_char);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_byte val_byte);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_ubyte val_ubyte);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_ushort val_ushort);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_uint val_uint);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_int64 val_int64);
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_uint64 val_uint64);
+
+
+
+var_sct *
+ncap_sclr_var_mk(
+const std::string var_nm,
+nco_string val_string);
+
+/******************************************************************************************/
+
+
+
+#endif  /* NCAP2_ATT_HH */
diff --git a/src/nco++/ncap2_utl.cc b/src/nco++/ncap2_utl.cc
index ca256f3..de5a814 100644
--- a/src/nco++/ncap2_utl.cc
+++ b/src/nco++/ncap2_utl.cc
@@ -2,20 +2,13 @@
 
 /* Purpose: netCDF arithmetic processor */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
 
 #include "ncap2_utl.hh"
 
-// check if var is really an attribute
-nco_bool 
-ncap_var_is_att( var_sct *var) {
-  if( strchr(var->nm,'@') !=NULL_CEWI ) 
-    return True;
-  return False;
-}
 
 std::vector<std::string> /* [O] [vector] array of files paths to be used to locate include files */
 ncap_make_include_paths(const char *spaths)       /* list of file path(s) delimited by ':' */
@@ -93,594 +86,6 @@ ncap_var_is_op_doable( var_sct *var1, var_sct *var2)
 
 
 
-var_sct*
-ncap_att_get
-(int var_id,
- const char *var_nm,
- const char *att_nm,
- int location, /* I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
- prs_cls *prs_arg)
-{
-  int rcd;
-  int fl_id=int_CEWI;
-  long sz;
-  
-  char *ln_nm;
-  
-  nc_type type;
-  var_sct *var_ret;
-  
-  if(location == 1) fl_id=prs_arg->in_id;  
-  if(location == 2) fl_id=prs_arg->out_id;  
-  
-  rcd=nco_inq_att_flg(fl_id,var_id,att_nm,&type,&sz);
-  if(rcd == NC_ENOTATT) return NULL_CEWI;
-  
-  var_ret=(var_sct*)nco_malloc(sizeof(var_sct));
-  (void)var_dfl_set(var_ret);
-  
-  // Make name of the form var_nm at att_nm
-  ln_nm=(char *)nco_malloc((strlen(var_nm)+strlen(att_nm)+2)*sizeof(char));
-  strcpy(ln_nm,var_nm);strcat(ln_nm,"@");strcat(ln_nm,att_nm);
-  
-  var_ret->nm=ln_nm;
-  var_ret->id=var_id;
-  var_ret->nc_id=prs_arg->in_id;
-  var_ret->type=type;
-  var_ret->sz=sz;
-  // maybe needed ?
-  var_ret->nbr_dim=0;
-  
-  // Fill with data if NOT an initial scan
-  if(!prs_arg->ntl_scn){
-    var_ret->val.vp=(void *)nco_malloc(sz*nco_typ_lng(type));
-    rcd=nco_get_att(fl_id,var_id,att_nm,var_ret->val.vp,type);
-    if (rcd != NC_NOERR) {
-      var_ret=nco_var_free(var_ret);
-      return NULL_CEWI;
-    }
-  }
-  return var_ret; 
-}
-
-
-
-std::string ncap_att2var
-( prs_cls *prs_arg,   
-  std::string att_nm)
-{
-
-  std::string fnc_nm("ncap_att2var");
-  std::string sn; 
-  var_sct *var_att=NULL_CEWI; 
-  NcapVar *Nvar=NULL;
-
-  if(prs_arg->ntl_scn)
-    Nvar=prs_arg->int_vtr.find(att_nm);
-
-  if(Nvar==NULL) 
-    Nvar=prs_arg->var_vtr.find(att_nm);
-
-  if(Nvar !=NULL)
-    var_att=nco_var_dpl(Nvar->var);
-  else    
-    var_att=ncap_att_init(att_nm,prs_arg);
-
-  if(prs_arg->ntl_scn==False  && var_att==NULL_CEWI )
-    err_prn(fnc_nm,"Unable to locate attribute " +att_nm+ " in input or output files.");
-
-            
-  /* empty so return empty string */ 
-  if(var_att==NULL_CEWI )
-    return sn;
-
-  /* cant resolve pointer here */
-  if(var_att->val.vp==NULL_CEWI)
-  {
-    nco_var_free(var_att);      
-    return sn;
-  }
-
-  if(var_att->type !=NC_STRING && var_att->type !=NC_CHAR )
-    err_prn("To use that attribute "+ att_nm +" as a variable pointer it must be a text type  NC_CHAR or NC_STRING"); 
-    
-  cast_void_nctype(var_att->type, &var_att->val );
-  if(var_att->type == NC_STRING)
-  {
-      sn=var_att->val.sngp[0];
-  }
-  else if( var_att->type==NC_CHAR)
-  {        
-      char buffer[100]={'\0'};
-      strncpy(buffer, var_att->val.cp, var_att->sz);
-      sn=buffer;  
-  } 
- 
-  cast_nctype_void(var_att->type, &var_att->val);
-  nco_var_free(var_att);  
-
-  return sn;
-
-}
-
-
-
-var_sct * /* O [sct] variable containing attribute */
-ncap_att_init /* [fnc] Grab an attribute from input file */
-(const std::string s_va_nm, /* I [sng] att name of form var_nm&att_nm */ 
- prs_cls *prs_arg) /* I/O vectors of atts & vars & file names */
-{
-  int rcd;
-  int var_id;
-  
-  std::string var_nm;
-  std::string att_nm;
-  size_t  att_char_posn;
-  
-  var_sct *var_ret;
-  
-  //check if we have an attribute
-  if( (att_char_posn =s_va_nm.find("@")) ==std::string::npos )
-    return NULL_CEWI; 
-  
-  var_nm=s_va_nm.substr(0,att_char_posn);
-  att_nm=s_va_nm.substr(att_char_posn+1);
-  
-  if(var_nm == "global"){
-    var_id=NC_GLOBAL;
-  }else{
-    rcd=nco_inq_varid_flg(prs_arg->in_id,var_nm.c_str(),&var_id);
-    if(rcd != NC_NOERR) return NULL_CEWI;
-  }
-  
-  var_ret=ncap_att_get(var_id,var_nm.c_str(),att_nm.c_str(),1,prs_arg);
-  return var_ret;
-}
-
-nco_bool /* O [flg] true if var has been stretched */
-ncap_att_stretch /* stretch a single valued attribute from 1 to sz */
-(var_sct* var, /* I/O [sct] variable */       
- long nw_sz) /* I [nbr] new var size */
-{
-  long  idx;
-  long  var_typ_sz;  
-  void* vp;
-  char *cp;
-
-  
-  if(var->sz > 1L || nw_sz <1) return false; 
-  if(nw_sz==1) return true;
-  var_typ_sz=nco_typ_lng(var->type);
-
-  // shouldnt really use this function with NC_STRING
-  // All it does is free exising single string
-  // and and calloc space for new ones
-  if(var->type == (nc_type)NC_STRING)
-  {
-    
-    (void)cast_void_nctype((nc_type)NC_STRING,&var->val);    
-    
-    nco_free(var->val.sngp[0]);  
-    nco_free(var->val.sngp);     
-    
-    var->val.sngp=(char**)nco_calloc(nw_sz,var_typ_sz);         
-    (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
-
-    
-  }
-  else
-  {
-    vp=(void*)nco_malloc(nw_sz*var_typ_sz);    
-    for(idx=0;idx<nw_sz;idx++){
-      cp=(char*)vp+(ptrdiff_t)(idx*var_typ_sz);
-      memcpy(cp,var->val.vp,var_typ_sz);
-    }
-
-    var->val.vp=(void*)nco_free(var->val.vp);
-    var->sz=nw_sz;
-    var->val.vp=vp;
-
-  }
-  
-  return true;
-} /* end ncap_att_stretch */
-
-int
-ncap_att_gnrl
-(const std::string s_dst,
- const std::string s_src,
- int location, /* I [flg] 1: attributes from INPUT file, 2: attributes from OUTPUT file */
- prs_cls  *prs_arg){
-  int idx;
-  int srt_idx;
-  int sz;
-  int rcd;
-  int var_id; 
-  int nbr_att;
-  int fl_id=int_CEWI;
-  char att_nm[NC_MAX_NAME]; 
-  const char *tmp_att_nm;
-  const char scl_fct_sng[]="scale_factor"; /* [sng] Unidata standard string for scale factor */
-  const char add_fst_sng[]="add_offset"; /* [sng] Unidata standard string for add offset */
-  
-  var_sct *var_att;
-  
-  std::string s_fll;
-  
-  NcapVar *Nvar;
-  
-  // De-reference 
-  NcapVarVector &var_vtr=prs_arg->var_vtr;
-  NcapVarVector att_vtr; // hold new attributes.
-  
-  if(location == 1) fl_id=prs_arg->in_id;  
-  if(location == 2) fl_id=prs_arg->out_id;  
-  
-  // get var_id
-  rcd=nco_inq_varid_flg(fl_id,s_src.c_str(),&var_id);
-  
-  if(rcd == NC_NOERR){
-    (void)nco_inq_varnatts(fl_id,var_id,&nbr_att);
-    // loop though attributes
-    for(idx=0; idx <nbr_att ; idx++){
-      (void)nco_inq_attname(fl_id,var_id,idx,att_nm);
-      //skip missing value, scale_factor , add_offset
-      if(!strcmp(att_nm,nco_mss_val_sng_get()) || !strcmp(att_nm,scl_fct_sng) || !strcmp(att_nm,add_fst_sng))
-        continue;
-      var_att=ncap_att_get(var_id,s_src.c_str(),att_nm,location,prs_arg);
-      // Add to list (change the name!)
-      if(var_att){ 
-	s_fll=s_dst+"@"+std::string(att_nm);
-        Nvar=new NcapVar(var_att,s_fll);
-	att_vtr.push_back(Nvar);
-      } 
-    } // end for
-  }// end rcd
-  
-  sz=var_vtr.size();
-  if(s_dst != s_src && (srt_idx=var_vtr.find_lwr(s_src+"@")) != -1){  
-    
-    for(idx=srt_idx;idx<sz;idx++){ 
-      if(s_src != var_vtr[idx]->getVar()) break;
-      if((var_vtr)[idx]->xpr_typ != ncap_att) continue;
-      tmp_att_nm=var_vtr[idx]->getAtt().c_str();
-      // skip missing value, scale_factor, add_offset
-      if(!strcmp(tmp_att_nm,nco_mss_val_sng_get()) || !strcmp(tmp_att_nm,scl_fct_sng) || !strcmp(tmp_att_nm,add_fst_sng))
-        continue;
-
-      // Create string for new attribute
-      s_fll=s_dst+"@"+(var_vtr[idx]->getAtt());
-      var_att=nco_var_dpl(var_vtr[idx]->var);
-      Nvar=new NcapVar(var_att,s_fll);
-      att_vtr.push_back(Nvar);
-    }
-  }
-  
-  sz=att_vtr.size();
-  // add new att to list;
-  for(idx=0;idx< sz;idx++){
-    
-#ifdef _OPENMP
-    if(omp_in_parallel())
-      prs_arg->thr_vtr.push_back(att_vtr[idx]);
-    else
-      var_vtr.push_ow(att_vtr[idx]);         
-#else
-    var_vtr.push_ow(att_vtr[idx]);         
-#endif
-  }
-  return sz;
-  
-} /* end ncap_att_gnrl() */
-
-int 
-ncap_att_cpy_sct
-(var_sct *var1,
- var_sct *var2,
- prs_cls  *prs_arg){
-  
-  NcapVar *Nvar=prs_arg->var_vtr.find(var1->nm);
-  // Do attribute propagation only if
-  // var doesn't already exist 
-  
-  if(!Nvar ||  Nvar->flg_stt==1)
-    (void)ncap_att_cpy(var1->nm,var2->nm,prs_arg);
-  
-  return 0;
-  
-} 	
-
-int
-ncap_att_cpy
-(const std::string s_dst,
- const std::string s_src,
- prs_cls  *prs_arg)
-{
-  
-  int nbr_att=0;
-  //Don't propagate if s_src is a tree-parser generated var
-  if(prs_arg->ATT_PROPAGATE && s_dst != s_src && s_src[0]!='~' )
-    nbr_att=ncap_att_gnrl(s_dst,s_src,1,prs_arg);
-  
-  if(prs_arg->ATT_INHERIT)
-    nbr_att=ncap_att_gnrl(s_dst,s_dst,1,prs_arg);
-  
-  return nbr_att;
-}
-
-void 
-ncap_att_prn     /* [fnc] Print a single attribute*/
-(var_sct *var,   /* I Variable containing att */
- char *const att_in_sng) /* user defined format string */
-{
-  char dlm_sng[3];
-  char att_sng[NCO_MAX_LEN_FMT_SNG];
-  
-  long att_lmn;
-  long att_sz;
-  
-  /* Copy value to avoid indirection in loop over att_sz */
-  att_sz=var->sz;
-  
-  if(att_in_sng ==(char*)NULL) {        
-    if(var->type != NC_CHAR && var->type != NC_STRING)
-       (void)fprintf(stdout,"%s, size = %li %s, value = ",var->nm,att_sz,nco_typ_sng(var->type));
-    /* Typecast pointer to values before access */
-    (void)cast_void_nctype(var->type,&var->val);
-    (void)strcpy(dlm_sng,", ");
-    (void)sprintf(att_sng,"%s%%s",nco_typ_fmt_sng(var->type));
-    /* user defined format string */ 
-  } else {
-    (void)strcpy(att_sng,att_in_sng);
-    (void)strcpy(dlm_sng,"");
-  }
-  
-  switch(var->type){
-  case NC_FLOAT:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.fp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_DOUBLE:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.dp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_SHORT:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.sp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_INT:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,(long)var->val.ip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_CHAR:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++){
-      char char_foo;
-      /* Assume \0 is string terminator and do not print it */
-      if((char_foo=var->val.cp[att_lmn]) != '\0') (void)fprintf(stdout,"%c",char_foo);
-    } /* end loop over element */
-    break;
-  case NC_BYTE:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.bp[att_lmn]);
-    break;
-  case NC_UBYTE:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.ubp[att_lmn]);
-    break;
-  case NC_USHORT:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.usp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_UINT:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.uip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_INT64:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.i64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_UINT64:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.ui64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  case NC_STRING:
-    for(att_lmn=0;att_lmn<att_sz;att_lmn++) (void)fprintf(stdout,att_sng,var->val.sngp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");
-    break;
-  default: nco_dfl_case_nc_type_err();
-    break;
-  } /* end switch */
-
-  /* only print if format string NOT user defined  */
-  if(att_in_sng ==(char*)NULL && var->type != NC_CHAR && var->type != NC_STRING )
-      (void)fprintf(stdout,"\n");
-  
-  (void)cast_nctype_void(var->type,&var->val);
-  
-  (void)fflush(stdout);
-  
-} /* end ncap_att_prn() */
-
-
-char * 
-ncap_att_sprn     /* [fnc] Print a single attribute*/
-(var_sct *var,   /* I Variable containing att */
- char *const att_in_sng) /* user defined format string */
-{
-
-  char char_foo;
-  char dlm_sng[3];
-  char att_sng[NCO_MAX_LEN_FMT_SNG];
-   
-  char *tp;
-  char *cp;    
-  char *cp_max;  
-
-  long att_lmn;
-  long att_sz; 
-  long max_sz;
-  
-  /* Copy value to avoid indirection in loop over att_sz */
-  att_sz=var->sz;
-  
-  cp=(char*)nco_calloc(sizeof(char),(NC_MAX_ATTRS+100)); 
-  tp=cp;  
-  cp_max=cp+ (size_t)(NC_MAX_ATTRS+100); 
-
-
-
-  if(att_in_sng ==(char*)NULL) {        
-    /* default dont bother if att info if type is text */
-    if(var->type != NC_CHAR && var->type != NC_STRING)
-    {     
-      (void)sprintf(tp,"%s, size = %li %s, value = ",var->nm,att_sz,nco_typ_sng(var->type));
-      tp+=strlen(tp); 
-    }
-    /* Typecast pointer to values before access */
-    (void)strcpy(dlm_sng,", ");
-    (void)sprintf(att_sng,"%s%%s",nco_typ_fmt_sng(var->type));
-    /* user defined format string */ 
-  } else {
-    (void)strcpy(att_sng,att_in_sng);
-    (void)strcpy(dlm_sng,"");
-  }
-      
-  (void)cast_void_nctype(var->type,&var->val);
-
-  
-  switch(var->type){
-  case NC_FLOAT:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++) { (void)sprintf(tp,att_sng,var->val.fp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_DOUBLE:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++) { (void)sprintf(tp,att_sng,var->val.dp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");  tp+=strlen(tp); }
-    break;
-  case NC_SHORT:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.sp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_INT:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,(long)var->val.ip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_CHAR:
-    if(att_in_sng ==(char*)NULL)    
-      /* remember string initialized to nulls */
-      strncpy(tp,var->val.cp,att_sz);
-    else          
-    {
-      for(att_lmn=0;att_lmn<att_sz && tp<cp_max ;att_lmn++)
-        /* Assume \0 is string terminator and do not print it */
-        if((char_foo=var->val.cp[att_lmn]) != '\0') 
-	{ 
-           (void)sprintf(tp,att_sng,char_foo);   
-           tp+=strlen(tp); 
-        } 
-    } /* end loop over element */
-
-    break;
-  case NC_BYTE:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.bp[att_lmn], (att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_UBYTE:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.ubp[att_lmn], (att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_USHORT:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.usp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_UINT:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.uip[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_INT64:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.i64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_UINT64:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max;att_lmn++) { (void)sprintf(tp,att_sng,var->val.ui64p[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : ""); tp+=strlen(tp); }
-    break;
-  case NC_STRING:
-    for(att_lmn=0;att_lmn<att_sz && tp<cp_max ; att_lmn++) { (void)sprintf(tp,att_sng,var->val.sngp[att_lmn],(att_lmn != att_sz-1) ? dlm_sng : "");tp+=strlen(tp); }
-    break;
-  default: nco_dfl_case_nc_type_err();
-    break;
-  } /* end switch */
-  
-  (void)cast_nctype_void(var->type,&var->val);
-  
-  if( tp >= cp_max )
-  {
-    cp=(char*)nco_realloc(cp, NC_MAX_ATTRS*sizeof(char));     
-    cp[NC_MAX_ATTRS-1]='\0';
-  }
-  else
-  {
-    cp=(char*)nco_realloc(cp, sizeof(char) * (strlen(cp)+1));     
-  }       
-  
-  return cp;
-
-} /* end ncap_att_prn() */
-
-
-
-
-int          /* number appended */ 
-ncap_att_str /* extract string(s) from a NC_CHAR or NC_STRING type attribute */
-(var_sct *var_att, 
- std::vector<std::string> &str_vtr)
-{
-  int idx;
-  int srt_size=str_vtr.size();  
-  char *cstr;
-  
-  (void)cast_void_nctype((nc_type)var_att->type,&var_att->val);
-
-  if(var_att->type==NC_STRING)
-  {
-
-    for(idx=0;idx<var_att->sz;idx++)
-    {  
-      cstr=var_att->val.sngp[idx];
-      str_vtr.push_back(cstr);
-    }     
-
-  }
-
-  if(var_att->type==NC_CHAR)
-  { 
-    char buffer[NC_MAX_NAME+1];
-    strncpy(buffer, var_att->val.cp, var_att->sz);        
-    buffer[var_att->sz+1]='\0'; 
-    str_vtr.push_back(buffer);
-  } 
-  (void)cast_nctype_void((nc_type)var_att->type,&var_att->val);
-  
-  return (str_vtr.size() - srt_size);  
-
-
-
-}
-
-
-char *          /* new malloc'ed string */ 
-ncap_att_char  /* extract string from a NC_CHAR or first NC_STRING */
-(var_sct *var_att)
-{
-  int idx;
-  char *cstr;
-  
-  (void)cast_void_nctype((nc_type)var_att->type,&var_att->val);
-
-  if(var_att->type==NC_STRING)
-  {
-    /* grab only first string */
-    cstr=strdup(var_att->val.sngp[0]);
-
-  }
-
-  if(var_att->type==NC_CHAR)
-  { 
-    cstr=(char*)nco_malloc( (var_att->sz+1) *sizeof(char));
-    strncpy(cstr, var_att->val.cp, var_att->sz);        
-    cstr[var_att->sz]='\0'; 
-  } 
-  (void)cast_nctype_void((nc_type)var_att->type,&var_att->val);
-  
-  return cstr;  
-
-}
-
-
-
-
-
-
 
 
 
@@ -788,57 +193,6 @@ ncap_var_abs /* Purpose: Find absolute value of each element of var */
   return var;
 } /* end ncap_var_abs */
 
-var_sct * /* O [sct] Empowerment of input variables (var1^var_2) */
-ncap_var_var_pwr_old /* [fnc] Empowerment of two variables */ 
-(var_sct *var1, /* I [sct] Variable structure containing base */
- var_sct *var2) /* I [sct] Variable structure containing exponent */
-{
-  char *swp_nm;
-  
-  /* Purpose: Empower two variables (var1^var2) */
-  
-  /* Temporary fix */ 
-  /* Swap names about so attribute propagation works */
-  /* most operations unlike this one put results in left operand */
-  if(!ncap_var_is_att(var1) && isalpha(var1->nm[0])){
-    swp_nm=var1->nm;
-    var1->nm=var2->nm;
-    var2->nm=swp_nm;
-  }  
-  
-  if(var1->undefined){ 
-    var2->undefined=True;
-    var1=nco_var_free(var1);
-    return var2;
-  }
-  
-  /* Make sure variables are at least float */
-  if(nco_rth_prc_rnk(var1->type) < nco_rth_prc_rnk_float && nco_rth_prc_rnk(var2->type) < nco_rth_prc_rnk_float)
-    var1=nco_var_cnf_typ((nc_type)NC_FLOAT,var1);
-  
-  (void)ncap_var_retype(var1,var2);   
-  
-  /* Handle initial scan */
-  if(var1->val.vp==(void*)NULL){
-    if(var1->nbr_dim > var2->nbr_dim){
-      var2=nco_var_free(var2);
-      return var1;
-    }else{
-      var1=nco_var_free(var1);
-      return var2;
-    }
-  } 
-  
-  (void)ncap_var_cnf_dmn(&var1,&var2);
-  if(var1->has_mss_val){
-    (void)nco_var_pwr(var1->type,var1->sz,var1->has_mss_val,var1->mss_val,var1->val,var2->val);
-  }else{
-    (void)nco_var_pwr(var1->type,var1->sz,var2->has_mss_val,var2->mss_val,var1->val,var2->val);
-  } /* end else */
-  
-  var1=nco_var_free(var1);
-  return var2;
-} /* end ncap_var_var_pwr() */
 
 var_sct * /* O [sct] Empowerment of input variables (var1^var_2) */
 ncap_var_var_pwr  /* [fnc] Empowerment of two variables */ 
@@ -1634,6 +988,63 @@ nco_shp_chk
   if(idx==nbr_cmp) return True; else return False;
 }
 
+nco_bool       /* returns true if order and size of dims match exactly */
+ncap_top_shp_chk(
+var_sct* var1, 
+var_sct* var2)
+{ 
+  int idx;
+  int sz;
+    
+  if(var1->sz !=var2->sz)
+    return False;
+
+  sz=var1->nbr_dim;
+
+  if(sz==0) 
+    return True;
+
+  for(idx=0; idx<sz;idx++)  
+    if( var1->cnt[idx] != var2->cnt[idx]) 
+      return False;
+
+  return True;
+}
+
+nco_bool       /* true if order & size of dims match (after removing (degenerate) size 1 dims */
+ncap_norm_shp_chk(
+var_sct* var1, 
+var_sct* var2)
+{ 
+  int idx;
+  int sz1=0;
+  int sz2=0;
+
+  long cnt1[NC_MAX_DIMS];
+  long cnt2[NC_MAX_DIMS];
+  
+  for(idx=0; idx<var1->nbr_dim; idx++)
+    if( var1->cnt[idx]>1 )
+      cnt1[sz1++]=var1->cnt[idx];    
+
+  for(idx=0; idx<var2->nbr_dim; idx++)
+    if( var2->cnt[idx]>1 )
+      cnt2[sz2++]=var2->cnt[idx];    
+
+  if(sz1 != sz2 )
+     return False;  
+
+  if(sz1==0)
+     return True;   
+   
+
+  for(idx=0; idx<sz1; idx++) 
+    if( cnt1[idx] != cnt2[idx] )
+      return False; 
+
+  return True;
+}
+
 /* This file is generated in makefile from ncoParserTokenTypes.hpp */ 
 #include "ncoEnumTokenTypes.hpp"
 
@@ -1993,7 +1404,8 @@ ncap_var_var_op   /* [fnc] Add two variables */
   }
   
   // Deal with pwr_in fuction
-  if( (op == CARET ) && nco_rth_prc_rnk(var1->type) < nco_rth_prc_rnk_float &&  nco_rth_prc_rnk(var2->type) < nco_rth_prc_rnk_float) var1=nco_var_cnf_typ((nc_type)NC_FLOAT,var1);
+  if( (op == CARET ) && nco_rth_prc_rnk(var1->type) < nco_rth_prc_rnk_float &&  nco_rth_prc_rnk(var2->type) < nco_rth_prc_rnk_float) 
+    var1=nco_var_cnf_typ((nc_type)NC_FLOAT,var1);
   
   //Deal with atan2 function
   if(op==ATAN2 ){
@@ -2010,10 +1422,10 @@ ncap_var_var_op   /* [fnc] Add two variables */
     (void)ncap_var_retype(var1,var2);
     
     // can we do the op without any stretching or conformance ?
-    if( ncap_var_is_op_doable(var1,var2) ) 
+    if( var1->sz==1 || var2->sz==1 ) 
       ; 
     // if hyperslabs then check they conform
-    else if( (var1->has_dpl_dmn ==-1 || var2->has_dpl_dmn==-1) && var1->sz >1 && var2->sz>1)
+    else if( var1->has_dpl_dmn ==-1 || var2->has_dpl_dmn ==-1 )
     {  
 	  if(var1->sz != var2->sz) 
 	  {
@@ -2022,7 +1434,7 @@ ncap_var_var_op   /* [fnc] Add two variables */
 	    err_prn(fnc_nm,os.str());
 	  }
 
-	  if( nco_shp_chk(var1,var2)==False)
+	  if( ncap_top_shp_chk(var1,var2)==False &&  ncap_norm_shp_chk(var1,var2)==False  )
 	  { 
 	    std::ostringstream os;
 	    os<<"Hyperslabbed variable:"<<var1->nm <<" and variable:"<<var2->nm <<" have same  number of elements, but different shapes.";
@@ -2030,9 +1442,9 @@ ncap_var_var_op   /* [fnc] Add two variables */
 	  }
     }
     else
-    {   
+      { // try and mamke vars conform  
       (void)ncap_var_cnf_dmn(&var1,&var2);
-    }
+      }
     // Bare numbers have name prefixed with"_"
     // for attribute propagation to work we need
     // to swap names about if first operand is a bare number
@@ -2090,6 +1502,9 @@ ncap_var_var_op   /* [fnc] Add two variables */
   }
   
   // Deal with pwr fuction ( nb pwr function can't be templated )
+  // if var1 and var2 are the same size then results of operation ar put in var1
+  // if var1->sz >1 and var2->sz==1 then data is data in var1
+  // if var1->sz==1  and var2->sz>1 then data is data in var2
   if(op==CARET)
      ncap_var_var_pwr(var1,var2);
   else if (op==MOD)
@@ -2100,7 +1515,8 @@ ncap_var_var_op   /* [fnc] Add two variables */
      ncap_var_var_stc(var1,var2,op);
 
   // swap var data about -results of an asymetrical operation
-  if( var1->sz ==1 && var2->sz >1)
+  // nb the output data in this case is in var2 
+  if( var1->sz ==1 && var2->sz >1  )
   {
     char *cswp; 
     var_sct *var_swp;      
@@ -2116,6 +1532,28 @@ ncap_var_var_op   /* [fnc] Add two variables */
 
 
   }
+  // Deal with case where var1 and var2 same size but 
+  // but var2 has more dims - eg multiple dims of size 1 (degenerate)
+  // so we wnat the data from var1 but the "shape" from var2
+  else if( var1->sz==var2->sz && var1->nbr_dim< var2->nbr_dim)    
+  {
+    char *cswp; 
+    var_sct *var_swp;      
+    ptr_unn val_swp;
+
+    var_swp=var1;     
+    var1=var2;
+    var2=var_swp;
+
+    // swap names about to preserve att propagation
+    cswp=var1->nm;
+    var1->nm=var2->nm;
+    var2->nm=cswp;           
+   
+    val_swp=var1->val;
+    var1->val=var2->val;
+    var2->val=val_swp;       
+  }
 
   // swap about names so attribute propagation works 
   if( ncap_var_is_att(var1) &&  !ncap_var_is_att(var2)) 
@@ -2329,40 +1767,6 @@ ncap_var_var_inc   /* [fnc] Add two variables */
   return var_ret;
 }
 
-bool            /* O [flg] true if all var elemenst are true */
-ncap_var_lgcl1   /* [fnc] calculate a aggregate bool value from a variable */
-(var_sct* var)  /* I [sct] input variable */
-{
-  int idx;
-  int sz;
-  nc_type type;
-  bool bret=true;
-  ptr_unn op1;
-  
-  // Convert to type SHORT
-  var=nco_var_cnf_typ((nc_type)NC_SHORT,var);  
-  
-  type=NC_SHORT;
-  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){
-    for(idx=0;idx<sz;idx++) 
-      if(!op1.sp[idx]) break;
-  }else{
-    const short mss_val_short=*(var->mss_val.sp);
-    for(idx=0;idx<sz;idx++) 
-      if(!op1.sp[idx] && op1.sp[idx] != mss_val_short) break; 
-  }
-  if(idx < sz) bret=false;
-  
-  if(var->has_mss_val) (void)cast_nctype_void(type,&var->mss_val);
-  
-  return bret;
-}
 
 bool            /* O [flg] true if all var elemenst are true */
 ncap_var_lgcl   /* [fnc] calculate a aggregate bool value from a variable */
@@ -2740,187 +2144,6 @@ ncap_dmn_mtd
   return dmn_vtr;  
 }
 
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nc_type type,
- bool bfll)
-{
-  /* Purpose: Create a scalar variable of type, if bfll then malloc ptr_unn */
-  var_sct *var;
-  var=(var_sct *)nco_malloc(sizeof(var_sct));
-  /* Set defaults */
-  (void)var_dfl_set(var); 
-  /* Overwrite with variable expression information */
-  var->nm=strdup(var_nm.c_str());
-  var->nbr_dim=0;
-  var->sz=1;
-  var->type=type;
-  var->typ_dsk=type;
-  
-  if(bfll) var->val=nco_mss_val_mk(type);  
-  
-  return var;
-} // end ncap_sclr_var_mk<string,int,bool>()
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- float val_float)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_FLOAT,true);
-  (void)cast_void_nctype((nc_type)NC_FLOAT,&var->val);
-  *var->val.fp=val_float;
-  (void)cast_nctype_void((nc_type)NC_FLOAT,&var->val);
-  return var;
-} // end ncap_sclr_var_mk<float>()
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- double val_double)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_DOUBLE,true);
-  (void)cast_void_nctype((nc_type)NC_DOUBLE,&var->val);
-  *var->val.dp=val_double;
-  (void)cast_nctype_void((nc_type)NC_DOUBLE,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_int val_int)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_INT,true);
-  (void)cast_void_nctype((nc_type)NC_INT,&var->val);
-  *var->val.ip=val_int;
-
-  (void)cast_nctype_void((nc_type)NC_INT,&var->val);
-  return var;
-}
- 
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_short val_short)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_SHORT,true);
-  (void)cast_void_nctype((nc_type)NC_SHORT,&var->val);
-  *var->val.sp=val_short;
-  (void)cast_nctype_void((nc_type)NC_SHORT,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_char val_char)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_CHAR,true);
-  (void)cast_void_nctype((nc_type)NC_CHAR,&var->val);
-  *var->val.cp=val_char;
-  (void)cast_nctype_void((nc_type)NC_CHAR,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_byte val_byte)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_BYTE,true);
-  (void)cast_void_nctype((nc_type)NC_BYTE,&var->val);
-  *var->val.bp=val_byte;
-  (void)cast_nctype_void((nc_type)NC_BYTE,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_ubyte val_ubyte)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UBYTE,true);
-  (void)cast_void_nctype((nc_type)NC_UBYTE,&var->val);
-  *var->val.ubp=val_ubyte;
-  (void)cast_nctype_void((nc_type)NC_UBYTE,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_ushort val_ushort)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_USHORT,true);
-  (void)cast_void_nctype((nc_type)NC_USHORT,&var->val);
-  *var->val.usp=val_ushort;
-  (void)cast_nctype_void((nc_type)NC_USHORT,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_uint val_uint)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UINT,true);
-  (void)cast_void_nctype((nc_type)NC_UINT,&var->val);
-  *var->val.uip=val_uint;
-  (void)cast_nctype_void((nc_type)NC_UINT,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_int64 val_int64)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_INT64,true);
-  (void)cast_void_nctype((nc_type)NC_INT64,&var->val);
-  *var->val.i64p=val_int64;
-  (void)cast_nctype_void((nc_type)NC_INT64,&var->val);
-  return var;
-}
-
-var_sct *
-ncap_sclr_var_mk
-(const std::string var_nm,
- nco_uint64 val_uint64)
-{
-  var_sct *var;
-  var=ncap_sclr_var_mk(var_nm,(nc_type)NC_UINT64,true);
-  (void)cast_void_nctype((nc_type)NC_UINT64,&var->val);
-  *var->val.ui64p=val_uint64;
-  (void)cast_nctype_void((nc_type)NC_UINT64,&var->val);
-  return var;
-}
-
-/* fxm: Allow ncap2 to instantiate NC_STRINGs */
-   var_sct *
-   ncap_sclr_var_mk(
-   const std::string var_nm,
-   nco_string val_string)
-   {
-   var_sct *var;
-   var=ncap_sclr_var_mk(var_nm,(nc_type)NC_STRING,true);
-   (void)cast_void_nctype((nc_type)NC_STRING,&var->val);
-   *var->val.sngp=val_string;
-   (void)cast_nctype_void((nc_type)NC_STRING,&var->val);
-   return var;
-   } 
-
 // Do an in-memory hyperslab !!
 void 
 ncap_get_var_mem
diff --git a/src/nco++/ncap2_utl.hh b/src/nco++/ncap2_utl.hh
index d3f5ffe..a5865bb 100644
--- a/src/nco++/ncap2_utl.hh
+++ b/src/nco++/ncap2_utl.hh
@@ -57,7 +57,7 @@
 #include "sdo_utl.hh"
 #include "VarOpNew.hh" 
 #include "prs_cls.hh"
-
+#include "ncap2_att.hh"
 
 /* Don't know what Charlies done to the bools */
 /* Temporary fix for now !!*/
@@ -74,85 +74,65 @@
   std::vector<exp_sct_tag**> srp_vtr; //self reverential pointer
 } exp_sct ;	
 
-/* Begin funtions in ncap2_utl.cc */
-
-std::string ncap_att2var
-( prs_cls *prs_arg,   
-  std::string att_nm);
-
-
-var_sct*               /* O [sct] variable containing attribute */
-ncap_att_get	       /*   [fnc] Grab an attribute from input file */	
-(int var_id,           /*   I  var id        */ 
- const char *var_nm,   /*   I [sng] var name */
- const char *att_nm,   /*   I [sng] att name */
- int location,         /*   I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
- prs_cls *prs_arg);    /* I/O vectors of atts & vars & file names  */
-
-
-var_sct *                /* O [sct] variable containing attribute */
-ncap_att_init(           /*   [fnc] Grab an attribute from input file */
-std::string va_nm,       /* I [sng] att name of form var_nm&att_nm */ 
-prs_cls *prs_arg);       /* I/O vectors of atts & vars & file names  */
 
+/***************  misc functions ********************************************************/
 
 std::vector<std::string> /* [O] [vector] list of files paths to be used to locate include files */
 ncap_make_include_paths  
 (const char *sin);       /* list of file path(s) delimited by ':' */
 
-int
-ncap_att_gnrl
-(const std::string s_dst,
- const std::string s_src,
- int location,         /*   I [flg] 1 - att from INPUT file  2 - att from OUTPUT file */
- prs_cls  *prs_arg);
 
+nco_bool
+ncap_def_dim(
+std::string dmn_nm,
+long sz,
+bool ltype,
+prs_cls *prs_arg);
 
+void
+nco_get_var_mem(
+var_sct *var_rhs,
+NcapVector<dmn_sct*> &dmn_vtr);
 
-nco_bool                /* O [flg] true if var has been stretched */
-ncap_att_stretch    /* stretch a single valued attribute from 1 to sz */
-(var_sct* var,      /* I/O [sct] variable */       
- long nw_sz);       /* I [nbr] new var size */
+void
+nco_put_var_mem(
+var_sct *var_in,
+var_sct *var_nw,
+NcapVector<lmt_sct*> &lmt_vtr);
+
+nco_bool         /* Returns True if shape of vars match (using cnt vectors */
+nco_shp_chk(
+var_sct* var1, 
+var_sct* var2); 
 
 var_sct *      /* initialize var to defaults & undefined to true */
 ncap_var_udf
 (const char *var_nm);
  
 
-int 
-ncap_att_cpy_sct
-(var_sct *var1,
- var_sct *var2,
- prs_cls  *prs_arg);
 
-int             
-ncap_att_cpy
-(const std::string s_dst,
- const std::string s_src,
- prs_cls  *prs_arg);
+nco_bool 
+ncap_var_is_op_doable( 
+var_sct *var1, 
+var_sct *var2); 
 
-void 
-ncap_att_prn   
-(var_sct *var, 
- char *const att_in_sng);
 
-char *            /* [0] sng - malloced inside function */
-ncap_att_sprn     /* [fnc] Print a single attribute*/
-(var_sct *var,   /* I Variable containing att */
- char *const att_in_sng); /* user defined format string */
+nco_bool       /* returns true if order and size of dims match exactly */
+ncap_top_shp_chk(
+var_sct* var1, 
+var_sct* var2); 
 
+nco_bool       /* true if oder & size of dims match (after removing (degenerate) size 1 dims */
+ncap_norm_shp_chk(
+var_sct* var1, 
+var_sct* var2); 
 
 
 
-int                 /* number appended */ 
-ncap_att_str        /* extract string(s) from a NC_CHAR or NC_STRING type attribute */
-(var_sct *var_att,  /* I [sct] input attribute */
- std::vector<std::string> &str_vtr);
+/***************************************************************************************/
 
-char *            /* new malloc'ed string */ 
-ncap_att_char    /* extract string from a NC_CHAR or first NC_STRING */
-(var_sct *var_att);
 
+/*************** custom math functions *********************************************************/
 
 
 var_sct *   /* O [sct] Remainder of modulo operation of input variables (var_1%var_2) */
@@ -186,6 +166,17 @@ var_sct *         /* O [sct] Resultant variable (actually is var) */
 ncap_var_abs(     /* Purpose: Find absolute value of each element of var */
 var_sct *var);    /* I/O [sct] input variable */
 
+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 */
+
+
+
+/******************************************************************************************/
+
+
+/******************  list functions **********************************************************/
+
 nm_id_sct *            /* O [sct] new copy of xtr_lst */
 nco_var_lst_copy(      /*   [fnc] Purpose: Copy xtr_lst and return new list */
 nm_id_sct *xtr_lst,    /* I  [sct] input list */ 
@@ -217,13 +208,56 @@ nco_att_lst_mk
  NcapVarVector &var_vtr,  /* I [vec] vector of vars & att */
  int *nbr_lst);            /* O [ptr] size of output list */
 
-nco_bool
-ncap_def_dim(
-std::string dmn_nm,
-long sz,
-bool ltype,
+/******************************************************************************************/
+
+
+/************************ casting functions ***********************************************/
+
+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 */
+prs_cls *prs_arg);
+
+var_sct*
+ncap_cst_do(
+var_sct* var,
+var_sct* var_cst,
+bool bntlscn);
+
+NcapVector<dmn_sct*>                /* O [sct] list of new dims to limit over */ 
+ncap_dmn_mtd(
+var_sct *var,                       /*  [sct] create casting var from a list of dims */
+std::vector<std::string> &str_vtr);  /* I [sng] list of dimension names */
+
+
+/******************************************************************************************/
+
+/************************************AST (tree) functions ************************************/
+
+bool           /* Returns true if expression contains a utility fuction */ 
+ncap_fnc_srh(
+RefAST ntr
+);
+
+void ncap_mpi_get_id  /* Extract all VAR_ID & ATT_ID from an Expression */
+(
+RefAST ntr,
+std::vector<std::string> &str_vtr);
+
+
+int            /* Sort expressions for MPI Optimization */  
+ncap_mpi_srt(
+RefAST ntr,
+int icnt,
+std::vector< std::vector<RefAST> > &all_ast_vtr, // Return a Vector of Vectors
 prs_cls *prs_arg);
 
+
+/******************************************************************************************/
+
+/********************** var/var conformance  *********************************************/
+
+
 nco_bool /* O [flg] Variables now conform */
 ncap_var_stretch /* [fnc] Stretch variables */
 (var_sct **var_1, /* I/O [ptr] First variable */
@@ -281,150 +315,9 @@ ncap_var_var_inc    /* [fnc] Add two variables */
  prs_cls *prs_arg);
 
 
-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 */
-
-
-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 */
-prs_cls *prs_arg);
-
-var_sct*
-ncap_cst_do(
-var_sct* var,
-var_sct* var_cst,
-bool bntlscn);
-
-/* End funtions in ncap_utl.c */
-
-/* Let function live here for now */
-
-nco_bool         /* Returns True if shape of vars match (using cnt vectors */
-nco_shp_chk(
-var_sct* var1, 
-var_sct* var2); 
-
-nco_bool        /* Reurns True if var has attribute style name */
-ncap_var_is_att( 
-var_sct *var);
-
-nco_bool 
-ncap_var_is_op_doable( 
-var_sct *var1, 
-var_sct *var2); 
-
-
-bool           /* Returns true if expression contains a utility fuction */ 
-ncap_fnc_srh(
-RefAST ntr
-);
-
-void ncap_mpi_get_id  /* Extract all VAR_ID & ATT_ID from an Expression */
-(
-RefAST ntr,
-std::vector<std::string> &str_vtr);
+/******************************************************************************************/
 
 
-int            /* Sort expressions for MPI Optimization */  
-ncap_mpi_srt(
-RefAST ntr,
-int icnt,
-std::vector< std::vector<RefAST> > &all_ast_vtr, // Return a Vector of Vectors
-prs_cls *prs_arg);
-
-
-NcapVector<dmn_sct*>                /* O [sct] list of new dims to limit over */ 
-ncap_dmn_mtd(
-var_sct *var,                       /*  [sct] create casting var from a list of dims */
-std::vector<std::string> &str_vtr);  /* I [sng] list of dimension names */
-
-// ncap_sclr_var_mk() overloads
-/* Create a scalar variable of type, if bfill then malloc ptr_unn */
-var_sct*
-ncap_sclr_var_mk(
-const std::string var_nm,
-nc_type type,
-//bool bfll=false); fxm csz
-bool bfll);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-float val_float);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-double val_double);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_int val_int);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_short val_short);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_char val_char);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_byte val_byte);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_ubyte val_ubyte);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_ushort val_ushort);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_uint val_uint);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_int64 val_int64);
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_uint64 val_uint64);
-
-
-
-var_sct *
-ncap_sclr_var_mk(
-const std::string var_nm,
-nco_string val_string);
-
-
-// end ncap_sclr_var_mk() overloads
-
-void
-nco_get_var_mem(
-var_sct *var_rhs,
-NcapVector<dmn_sct*> &dmn_vtr);
-
-void
-nco_put_var_mem(
-var_sct *var_in,
-var_sct *var_nw,
-NcapVector<lmt_sct*> &lmt_vtr);
-
 #endif  /* NCAP2_UTL_HH */
 
 
diff --git a/src/nco++/ncoEnumTokenTypes.hpp b/src/nco++/ncoEnumTokenTypes.hpp
index 6f0a620..d05a372 100644
--- a/src/nco++/ncoEnumTokenTypes.hpp
+++ b/src/nco++/ncoEnumTokenTypes.hpp
@@ -42,86 +42,87 @@
 		NSTRING = 34,
 		COMMA = 35,
 		RPAREN = 36,
-		WHILE = 37,
-		BREAK = 38,
-		CONTINUE = 39,
-		IF = 40,
-		ELSE = 41,
-		WHERE = 42,
-		ELSEWHERE = 43,
-		LCURL = 44,
-		RCURL = 45,
-		FOR = 46,
-		COLON = 47,
-		LSQUARE = 48,
-		VAR_ID = 49,
-		DIM_ID = 50,
-		RSQUARE = 51,
-		DIVIDE = 52,
-		DIM_MTD_ID = 53,
-		ATT_ID = 54,
-		CALL_REF = 55,
-		TIMES = 56,
-		DOT = 57,
-		FUNC = 58,
-		INC = 59,
-		DEC = 60,
-		LNOT = 61,
-		PLUS = 62,
-		MINUS = 63,
-		CARET = 64,
-		MOD = 65,
-		FLTHAN = 66,
-		FGTHAN = 67,
-		LTHAN = 68,
-		GTHAN = 69,
-		GEQ = 70,
-		LEQ = 71,
-		EQ = 72,
-		NEQ = 73,
-		LAND = 74,
-		LOR = 75,
-		QUESTION = 76,
-		ASSIGN = 77,
-		PLUS_ASSIGN = 78,
-		MINUS_ASSIGN = 79,
-		TIMES_ASSIGN = 80,
-		DIVIDE_ASSIGN = 81,
-		NCAP_FLOAT = 82,
-		NCAP_DOUBLE = 83,
-		NCAP_INT = 84,
-		NCAP_BYTE = 85,
-		NCAP_UBYTE = 86,
-		NCAP_SHORT = 87,
-		NCAP_USHORT = 88,
-		NCAP_UINT = 89,
-		NCAP_INT64 = 90,
-		NCAP_UINT64 = 91,
-		N4STRING = 92,
-		DIM_ID_SIZE = 93,
-		NRootAST = 94,
-		SHIFTL = 95,
-		SHIFTR = 96,
-		QUOTE = 97,
-		DGT = 98,
-		LPH = 99,
-		LPHDGT = 100,
-		XPN = 101,
-		VAR_NM_QT = 102,
-		BLASTOUT = 103,
-		UNUSED_OPS = 104,
-		WS = 105,
-		CXX_COMMENT = 106,
-		C_COMMENT = 107,
-		NUMBER_DOT = 108,
-		NUMBER = 109,
-		VAR_ATT = 110,
-		VAR_ATT_QT = 111,
-		STR_ATT_QT = 112,
-		DIM_QT = 113,
-		DIM_VAL = 114,
-		INCLUDE = 115,
-		LMT_DMN = 116,
+		EXIT = 37,
+		WHILE = 38,
+		BREAK = 39,
+		CONTINUE = 40,
+		IF = 41,
+		ELSE = 42,
+		WHERE = 43,
+		ELSEWHERE = 44,
+		LCURL = 45,
+		RCURL = 46,
+		FOR = 47,
+		COLON = 48,
+		LSQUARE = 49,
+		VAR_ID = 50,
+		DIM_ID = 51,
+		RSQUARE = 52,
+		DIVIDE = 53,
+		DIM_MTD_ID = 54,
+		ATT_ID = 55,
+		CALL_REF = 56,
+		TIMES = 57,
+		DOT = 58,
+		FUNC = 59,
+		INC = 60,
+		DEC = 61,
+		LNOT = 62,
+		PLUS = 63,
+		MINUS = 64,
+		CARET = 65,
+		MOD = 66,
+		FLTHAN = 67,
+		FGTHAN = 68,
+		LTHAN = 69,
+		GTHAN = 70,
+		GEQ = 71,
+		LEQ = 72,
+		EQ = 73,
+		NEQ = 74,
+		LAND = 75,
+		LOR = 76,
+		QUESTION = 77,
+		ASSIGN = 78,
+		PLUS_ASSIGN = 79,
+		MINUS_ASSIGN = 80,
+		TIMES_ASSIGN = 81,
+		DIVIDE_ASSIGN = 82,
+		NCAP_FLOAT = 83,
+		NCAP_DOUBLE = 84,
+		NCAP_INT = 85,
+		NCAP_BYTE = 86,
+		NCAP_UBYTE = 87,
+		NCAP_SHORT = 88,
+		NCAP_USHORT = 89,
+		NCAP_UINT = 90,
+		NCAP_INT64 = 91,
+		NCAP_UINT64 = 92,
+		N4STRING = 93,
+		DIM_ID_SIZE = 94,
+		NRootAST = 95,
+		SHIFTL = 96,
+		SHIFTR = 97,
+		QUOTE = 98,
+		DGT = 99,
+		LPH = 100,
+		LPHDGT = 101,
+		XPN = 102,
+		VAR_NM_QT = 103,
+		BLASTOUT = 104,
+		UNUSED_OPS = 105,
+		WS = 106,
+		CXX_COMMENT = 107,
+		C_COMMENT = 108,
+		NUMBER_DOT = 109,
+		NUMBER = 110,
+		VAR_ATT = 111,
+		VAR_ATT_QT = 112,
+		STR_ATT_QT = 113,
+		DIM_QT = 114,
+		DIM_VAL = 115,
+		INCLUDE = 116,
+		LMT_DMN = 117,
 		NULL_TREE_LOOKAHEAD = 3
 	};
 #endif /*INC_ncoEnumTokenTypes_hpp_*/
diff --git a/src/nco++/ncoGrammer.g b/src/nco++/ncoGrammer.g
index 6666087..e64e7f5 100644
--- a/src/nco++/ncoGrammer.g
+++ b/src/nco++/ncoGrammer.g
@@ -3,7 +3,7 @@ header {
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -24,9 +24,12 @@ header {
     #include <fstream>
     #include <string>
   
+    // custom exception -used for "exit" function
+    #include "ExitException.hpp" 
     // Custom Headers
     #include "prs_cls.hh"
     #include "ncap2_utl.hh"
+    #include "ncap2_att.hh"
     #include "fmc_cls.hh"
     #include "NcapVar.hh"
     #include "NcapVarVector.hh"
@@ -108,6 +111,8 @@ statement:
              if( #def2 ){  #def2->setType(DEFDIM);#def2->setText("0");}
  
         }
+        //exit statement 
+        | EXIT^ LPAREN! expr RPAREN! SEMI!
         // while loop
         | WHILE^ LPAREN! expr RPAREN! statement 
         // for statement
@@ -117,7 +122,7 @@ statement:
         | CONTINUE SEMI!        
         //deal with empty statement
         | SEMI! { #statement = #([ NULL_NODE, "null_stmt"]); } 
-
+         
         // if statement
         | IF^ LPAREN! expr RPAREN! statement 
          ( //standard if-else ambiguity
@@ -325,6 +330,7 @@ tokens {
    
     DEFDIMA="defdim";
     DEFDIMU="defdimunlim";
+    EXIT="exit";
  
     /*
 
@@ -1114,7 +1120,7 @@ if( nbr_dmn!=lmt_init(lmt,ast_lmt_vtr) )
     for(idx=0 ; idx < nbr_stmt; idx++){
       ntyp=ntr->getType();
       // we have hit an IF or a basic block
-      if(ntyp==BLOCK || ntyp==IF ||ntyp==DEFDIM || ntyp==WHILE ||ntyp==FOR || ntyp==FEXPR ||ntyp==WHERE) {
+      if(ntyp==BLOCK || ntyp==IF ||ntyp==DEFDIM || ntyp==WHILE ||ntyp==FOR || ntyp==FEXPR ||ntyp==WHERE || ntyp==EXIT) {
       //  if(ntyp != EXPR ){ 
         if(icnt>0) 
          (void)run_dbl(etr,icnt);
@@ -1368,6 +1374,23 @@ static std::vector<std::string> lpp_vtr;
         
     } // end  for action
 
+    // throw a custom ExitException 
+    | #(EXIT var=out ) { 
+      int sret;
+      ostringstream os;       
+      
+      // convert to INT   
+      nco_var_cnf_typ(NC_INT,var);  
+      cast_void_nctype(NC_INT,&var->val);
+      sret=var->val.ip[0];
+      cast_nctype_void(NC_INT,&var->val);
+      var=nco_var_free(var); 
+      
+      iret=EXIT; 
+      os<<sret;
+      throw  ANTLR_USE_NAMESPACE(antlr)ExitException(os.str());
+
+    }
     | ELSE { iret=ELSE;}
     | BREAK { iret=BREAK;}
     | CONTINUE {iret=CONTINUE;} 
@@ -3756,7 +3779,7 @@ var=NULL_CEWI;
            // copy lmt_sct to dmn_sct;
            for(idx=0 ;idx <nbr_dmn ; idx++){
               dmn_sct *dmn_nw;
-              dmn_nw=(dmn_sct*)nco_malloc(sizeof(dmn_sct));
+              dmn_nw=(dmn_sct*)nco_calloc(1,sizeof(dmn_sct));
               dmn_nw->nm=strdup(lmt_vtr[idx]->nm);
 
               // Fudge -if the variable is from input then nco_lmt_evl
diff --git a/src/nco++/ncoLexer.cpp b/src/nco++/ncoLexer.cpp
index b117203..c139f30 100644
--- a/src/nco++/ncoLexer.cpp
+++ b/src/nco++/ncoLexer.cpp
@@ -30,17 +30,18 @@ ncoLexer::ncoLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state)
 
 void ncoLexer::initLiterals()
 {
-	literals["<<"] = 95;
-	literals["for"] = 46;
+	literals["<<"] = 96;
+	literals["for"] = 47;
+	literals["exit"] = 37;
 	literals["defdimunlim"] = 32;
-	literals["where"] = 42;
-	literals["elsewhere"] = 43;
-	literals["continue"] = 39;
-	literals["while"] = 37;
-	literals[">>"] = 96;
-	literals["break"] = 38;
-	literals["if"] = 40;
-	literals["else"] = 41;
+	literals["where"] = 43;
+	literals["elsewhere"] = 44;
+	literals["continue"] = 40;
+	literals["while"] = 38;
+	literals[">>"] = 97;
+	literals["break"] = 39;
+	literals["if"] = 41;
+	literals["else"] = 42;
 	literals["defdim"] = 31;
 }
 
@@ -1339,7 +1340,7 @@ void ncoLexer::mBLASTOUT(bool _createToken) {
 	ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
 	
 	matchNot(EOF/*_CHAR*/);
-#line 470 "ncoGrammer.g"
+#line 476 "ncoGrammer.g"
 	
 	// blast out of lexer & parser
 	// Can't use RecognitionException() as 
@@ -1354,7 +1355,7 @@ void ncoLexer::mBLASTOUT(bool _createToken) {
 	ANTLR_USE_NAMESPACE(antlr)RecognitionException re(os.str());
 	throw  ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(re);
 	
-#line 1358 "ncoLexer.cpp"
+#line 1359 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -1396,7 +1397,7 @@ void ncoLexer::mUNUSED_OPS(bool _createToken) {
 	}
 	}
 	}
-#line 486 "ncoGrammer.g"
+#line 492 "ncoGrammer.g"
 	
 	
 	ostringstream os;
@@ -1406,7 +1407,7 @@ void ncoLexer::mUNUSED_OPS(bool _createToken) {
 	ANTLR_USE_NAMESPACE(antlr)RecognitionException re(os.str());
 	throw  ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(re);
 	
-#line 1410 "ncoLexer.cpp"
+#line 1411 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -1430,9 +1431,9 @@ void ncoLexer::mWS(bool _createToken) {
 	case 0x9 /* '\t' */ :
 	{
 		match('\t' /* charlit */ );
-#line 499 "ncoGrammer.g"
+#line 505 "ncoGrammer.g"
 		tab();
-#line 1436 "ncoLexer.cpp"
+#line 1437 "ncoLexer.cpp"
 		break;
 	}
 	case 0xc /* '\14' */ :
@@ -1443,9 +1444,9 @@ void ncoLexer::mWS(bool _createToken) {
 	case 0xa /* '\n' */ :
 	{
 		match('\n' /* charlit */ );
-#line 499 "ncoGrammer.g"
+#line 505 "ncoGrammer.g"
 		newline();
-#line 1449 "ncoLexer.cpp"
+#line 1450 "ncoLexer.cpp"
 		break;
 	}
 	default:
@@ -1454,9 +1455,9 @@ void ncoLexer::mWS(bool _createToken) {
 	}
 	}
 	}
-#line 500 "ncoGrammer.g"
+#line 506 "ncoGrammer.g"
 	_ttype = antlr::Token::SKIP;
-#line 1460 "ncoLexer.cpp"
+#line 1461 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -1484,9 +1485,9 @@ void ncoLexer::mCXX_COMMENT(bool _createToken) {
 	_loop154:;
 	} // ( ... )*
 	match('\n' /* charlit */ );
-#line 505 "ncoGrammer.g"
+#line 511 "ncoGrammer.g"
 	_ttype = antlr::Token::SKIP; newline();
-#line 1490 "ncoLexer.cpp"
+#line 1491 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -1525,9 +1526,9 @@ void ncoLexer::mC_COMMENT(bool _createToken) {
 			}
 			}
 			}
-#line 512 "ncoGrammer.g"
+#line 518 "ncoGrammer.g"
 			newline();
-#line 1531 "ncoLexer.cpp"
+#line 1532 "ncoLexer.cpp"
 		}
 		else if ((_tokenSet_4.member(LA(1)))) {
 			{
@@ -1542,9 +1543,9 @@ void ncoLexer::mC_COMMENT(bool _createToken) {
 	_loop159:;
 	} // ( ... )*
 	match("*/");
-#line 516 "ncoGrammer.g"
+#line 522 "ncoGrammer.g"
 	_ttype = antlr::Token::SKIP;
-#line 1548 "ncoLexer.cpp"
+#line 1549 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -1581,9 +1582,9 @@ void ncoLexer::mNUMBER_DOT(bool _createToken) {
 	}
 	
 	}
-#line 523 "ncoGrammer.g"
+#line 529 "ncoGrammer.g"
 	_ttype = NCAP_DOUBLE;
-#line 1587 "ncoLexer.cpp"
+#line 1588 "ncoLexer.cpp"
 	{
 	switch ( LA(1)) {
 	case 0x44 /* 'D' */ :
@@ -1607,9 +1608,9 @@ void ncoLexer::mNUMBER_DOT(bool _createToken) {
 		}
 		}
 		}
-#line 524 "ncoGrammer.g"
+#line 530 "ncoGrammer.g"
 		_ttype = NCAP_DOUBLE;
-#line 1613 "ncoLexer.cpp"
+#line 1614 "ncoLexer.cpp"
 		break;
 	}
 	case 0x46 /* 'F' */ :
@@ -1633,9 +1634,9 @@ void ncoLexer::mNUMBER_DOT(bool _createToken) {
 		}
 		}
 		}
-#line 525 "ncoGrammer.g"
+#line 531 "ncoGrammer.g"
 		_ttype = NCAP_FLOAT;
-#line 1639 "ncoLexer.cpp"
+#line 1640 "ncoLexer.cpp"
 		break;
 	}
 	case 0x4c /* 'L' */ :
@@ -1659,9 +1660,9 @@ void ncoLexer::mNUMBER_DOT(bool _createToken) {
 		}
 		}
 		}
-#line 526 "ncoGrammer.g"
+#line 532 "ncoGrammer.g"
 		_ttype = NCAP_DOUBLE;
-#line 1665 "ncoLexer.cpp"
+#line 1666 "ncoLexer.cpp"
 		break;
 	}
 	default:
@@ -1696,9 +1697,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 	}
 	_loop170:;
 	}  // ( ... )+
-#line 531 "ncoGrammer.g"
+#line 537 "ncoGrammer.g"
 	_ttype = NCAP_INT;
-#line 1702 "ncoLexer.cpp"
+#line 1703 "ncoLexer.cpp"
 	{
 	switch ( LA(1)) {
 	case 0x2e /* '.' */ :
@@ -1751,9 +1752,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		
 		}
 		}
-#line 532 "ncoGrammer.g"
+#line 538 "ncoGrammer.g"
 		_ttype = NCAP_DOUBLE;
-#line 1757 "ncoLexer.cpp"
+#line 1758 "ncoLexer.cpp"
 		break;
 	}
 	case 0x45 /* 'E' */ :
@@ -1762,9 +1763,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		{
 		mXPN(false);
 		}
-#line 533 "ncoGrammer.g"
+#line 539 "ncoGrammer.g"
 		_ttype = NCAP_DOUBLE;
-#line 1768 "ncoLexer.cpp"
+#line 1769 "ncoLexer.cpp"
 		break;
 	}
 	case 0x53 /* 'S' */ :
@@ -1788,9 +1789,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		}
 		}
 		}
-#line 535 "ncoGrammer.g"
+#line 541 "ncoGrammer.g"
 		_ttype = NCAP_SHORT;
-#line 1794 "ncoLexer.cpp"
+#line 1795 "ncoLexer.cpp"
 		break;
 	}
 	case 0x42 /* 'B' */ :
@@ -1814,9 +1815,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		}
 		}
 		}
-#line 536 "ncoGrammer.g"
+#line 542 "ncoGrammer.g"
 		_ttype = NCAP_BYTE;
-#line 1820 "ncoLexer.cpp"
+#line 1821 "ncoLexer.cpp"
 		break;
 	}
 	default:
@@ -1839,9 +1840,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			}
 			}
-#line 541 "ncoGrammer.g"
+#line 547 "ncoGrammer.g"
 			_ttype = NCAP_UINT64;
-#line 1845 "ncoLexer.cpp"
+#line 1846 "ncoLexer.cpp"
 		}
 		else if ((LA(1) == 0x55 /* 'U' */  || LA(1) == 0x75 /* 'u' */ ) && (LA(2) == 0x42 /* 'B' */  || LA(2) == 0x62 /* 'b' */ )) {
 			{
@@ -1862,9 +1863,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			}
 			}
-#line 537 "ncoGrammer.g"
+#line 543 "ncoGrammer.g"
 			_ttype = NCAP_UBYTE;
-#line 1868 "ncoLexer.cpp"
+#line 1869 "ncoLexer.cpp"
 		}
 		else if ((LA(1) == 0x55 /* 'U' */  || LA(1) == 0x75 /* 'u' */ ) && (LA(2) == 0x53 /* 'S' */  || LA(2) == 0x73 /* 's' */ )) {
 			{
@@ -1885,9 +1886,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			}
 			}
-#line 538 "ncoGrammer.g"
+#line 544 "ncoGrammer.g"
 			_ttype = NCAP_USHORT;
-#line 1891 "ncoLexer.cpp"
+#line 1892 "ncoLexer.cpp"
 		}
 		else if ((LA(1) == 0x4c /* 'L' */  || LA(1) == 0x6c /* 'l' */ ) && (LA(2) == 0x4c /* 'L' */  || LA(2) == 0x6c /* 'l' */ )) {
 			{
@@ -1908,9 +1909,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			}
 			}
-#line 540 "ncoGrammer.g"
+#line 546 "ncoGrammer.g"
 			_ttype = NCAP_INT64;
-#line 1914 "ncoLexer.cpp"
+#line 1915 "ncoLexer.cpp"
 		}
 		else if ((LA(1) == 0x4c /* 'L' */  || LA(1) == 0x6c /* 'l' */ ) && (true)) {
 			{
@@ -1931,9 +1932,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			}
 			}
-#line 534 "ncoGrammer.g"
+#line 540 "ncoGrammer.g"
 			_ttype = NCAP_INT;
-#line 1937 "ncoLexer.cpp"
+#line 1938 "ncoLexer.cpp"
 		}
 		else if ((LA(1) == 0x55 /* 'U' */  || LA(1) == 0x75 /* 'u' */ ) && (true) && (true)) {
 			{
@@ -1954,9 +1955,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 			}
 			
 			}
-#line 539 "ncoGrammer.g"
+#line 545 "ncoGrammer.g"
 			_ttype = NCAP_UINT;
-#line 1960 "ncoLexer.cpp"
+#line 1961 "ncoLexer.cpp"
 		}
 		else {
 		}
@@ -1985,9 +1986,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		}
 		}
 		}
-#line 543 "ncoGrammer.g"
+#line 549 "ncoGrammer.g"
 		_ttype = NCAP_FLOAT;
-#line 1991 "ncoLexer.cpp"
+#line 1992 "ncoLexer.cpp"
 		break;
 	}
 	case 0x44 /* 'D' */ :
@@ -2011,9 +2012,9 @@ void ncoLexer::mNUMBER(bool _createToken) {
 		}
 		}
 		}
-#line 544 "ncoGrammer.g"
+#line 550 "ncoGrammer.g"
 		_ttype = NCAP_DOUBLE;
-#line 2017 "ncoLexer.cpp"
+#line 2018 "ncoLexer.cpp"
 		break;
 	}
 	default:
@@ -2119,7 +2120,7 @@ void ncoLexer::mVAR_ATT(bool _createToken) {
 	}
 	_loop193:;
 	} // ( ... )*
-#line 554 "ncoGrammer.g"
+#line 560 "ncoGrammer.g"
 	
 	// try to intelligently guess the type to avoid un-necessary function search    
 	bool bDoSearch;
@@ -2156,7 +2157,7 @@ void ncoLexer::mVAR_ATT(bool _createToken) {
 	}             
 	} 
 	
-#line 2160 "ncoLexer.cpp"
+#line 2161 "ncoLexer.cpp"
 	{
 	if ((LA(1) == 0x40 /* '@' */ )) {
 		match('@' /* charlit */ );
@@ -2245,9 +2246,9 @@ void ncoLexer::mVAR_ATT(bool _createToken) {
 		}
 		_loop197:;
 		} // ( ... )*
-#line 590 "ncoGrammer.g"
+#line 596 "ncoGrammer.g"
 		_ttype = ATT_ID;
-#line 2251 "ncoLexer.cpp"
+#line 2252 "ncoLexer.cpp"
 	}
 	else {
 	}
@@ -2273,18 +2274,18 @@ void ncoLexer::mVAR_ATT_QT(bool _createToken) {
 	text.erase(_saveIndex);
 	}
 	mVAR_NM_QT(false);
-#line 596 "ncoGrammer.g"
+#line 602 "ncoGrammer.g"
 	_ttype = VAR_ID;
-#line 2279 "ncoLexer.cpp"
+#line 2280 "ncoLexer.cpp"
 	{
 	switch ( LA(1)) {
 	case 0x40 /* '@' */ :
 	{
 		match('@' /* charlit */ );
 		mVAR_NM_QT(false);
-#line 597 "ncoGrammer.g"
+#line 603 "ncoGrammer.g"
 		_ttype = ATT_ID;
-#line 2288 "ncoLexer.cpp"
+#line 2289 "ncoLexer.cpp"
 		break;
 	}
 	case 0x27 /* '\'' */ :
@@ -2401,9 +2402,9 @@ void ncoLexer::mATT_ID(bool _createToken) {
 	}
 	_loop205:;
 	} // ( ... )*
-#line 602 "ncoGrammer.g"
+#line 608 "ncoGrammer.g"
 	string an=text.substr(_begin,text.length()-_begin);{ text.erase(_begin); text += "global"+an; };_ttype = ATT_ID;
-#line 2407 "ncoLexer.cpp"
+#line 2408 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -2424,9 +2425,9 @@ void ncoLexer::mSTR_ATT_QT(bool _createToken) {
 	}
 	match('@' /* charlit */ );
 	mVAR_NM_QT(false);
-#line 607 "ncoGrammer.g"
+#line 613 "ncoGrammer.g"
 	_ttype = STR_ATT_QT;
-#line 2430 "ncoLexer.cpp"
+#line 2431 "ncoLexer.cpp"
 	{
 	_saveIndex = text.length();
 	match('\'' /* charlit */ );
@@ -2455,9 +2456,9 @@ void ncoLexer::mDIM_QT(bool _createToken) {
 	match('$' /* charlit */ );
 	text.erase(_saveIndex);
 	mVAR_NM_QT(false);
-#line 614 "ncoGrammer.g"
+#line 620 "ncoGrammer.g"
 	_ttype = DIM_ID;
-#line 2461 "ncoLexer.cpp"
+#line 2462 "ncoLexer.cpp"
 	}
 	{
 	_saveIndex = text.length();
@@ -2469,9 +2470,9 @@ void ncoLexer::mDIM_QT(bool _createToken) {
 		_saveIndex = text.length();
 		match(".size");
 		text.erase(_saveIndex);
-#line 616 "ncoGrammer.g"
+#line 622 "ncoGrammer.g"
 		_ttype = DIM_ID_SIZE;
-#line 2475 "ncoLexer.cpp"
+#line 2476 "ncoLexer.cpp"
 	}
 	else {
 	}
@@ -2578,17 +2579,17 @@ void ncoLexer::mDIM_VAL(bool _createToken) {
 	}
 	_loop217:;
 	} // ( ... )*
-#line 621 "ncoGrammer.g"
+#line 627 "ncoGrammer.g"
 	_ttype = DIM_ID;
-#line 2584 "ncoLexer.cpp"
+#line 2585 "ncoLexer.cpp"
 	{
 	if ((LA(1) == 0x2e /* '.' */ )) {
 		_saveIndex = text.length();
 		match(".size");
 		text.erase(_saveIndex);
-#line 623 "ncoGrammer.g"
+#line 629 "ncoGrammer.g"
 		_ttype = DIM_ID_SIZE;
-#line 2592 "ncoLexer.cpp"
+#line 2593 "ncoLexer.cpp"
 	}
 	else {
 	}
@@ -2657,17 +2658,17 @@ void ncoLexer::mNSTRING(bool _createToken) {
 	_saveIndex = text.length();
 	match('\"' /* charlit */ );
 	text.erase(_saveIndex);
-#line 637 "ncoGrammer.g"
+#line 643 "ncoGrammer.g"
 	_ttype = NSTRING;
-#line 2663 "ncoLexer.cpp"
+#line 2664 "ncoLexer.cpp"
 	{
 	if ((LA(1) == 0x73 /* 's' */ )) {
 		_saveIndex = text.length();
 		match('s' /* charlit */ );
 		text.erase(_saveIndex);
-#line 638 "ncoGrammer.g"
+#line 644 "ncoGrammer.g"
 		_ttype = N4STRING;
-#line 2671 "ncoLexer.cpp"
+#line 2672 "ncoLexer.cpp"
 	}
 	else {
 	}
@@ -2710,7 +2711,7 @@ void ncoLexer::mINCLUDE(bool _createToken) {
 	}
 	mNSTRING(true);
 	f=_returnToken;
-#line 643 "ncoGrammer.g"
+#line 649 "ncoGrammer.g"
 	
 			// ANTLR_USING_NAMESPACE(std)
 			// create lexer to handle include
@@ -2756,7 +2757,7 @@ void ncoLexer::mINCLUDE(bool _createToken) {
 			// of the new instance of this lexer.
 			selector.retry(); // throws TokenStreamRetryException
 			
-#line 2760 "ncoLexer.cpp"
+#line 2761 "ncoLexer.cpp"
 	if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
 	   _token = makeToken(_ttype);
 	   _token->setText(text.substr(_begin, text.length()-_begin));
@@ -2771,31 +2772,31 @@ const unsigned long ncoLexer::_tokenSet_0_data_[] = { 0UL, 96UL, 1073741824UL, 2
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_0(_tokenSet_0_data_,10);
 const unsigned long ncoLexer::_tokenSet_1_data_[] = { 0UL, 134179585UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 //   ( ) + - . 0 1 2 3 4 5 6 7 8 9 : A B C D E F G H I J K L M N O P Q 
-// R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t 
+// R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_1(_tokenSet_1_data_,10);
 const unsigned long ncoLexer::_tokenSet_2_data_[] = { 0UL, 0UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ a b c d e f g 
-// h i j k l m n o p q r s t 
+// h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_2(_tokenSet_2_data_,10);
 const unsigned long ncoLexer::_tokenSet_3_data_[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11 
 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
 //   ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 
 // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a 
-// b c d e f g h i j k l m n o p q r s t 
+// b c d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_3(_tokenSet_3_data_,16);
 const unsigned long ncoLexer::_tokenSet_4_data_[] = { 4294958079UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 
 // 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f   ! 
 // \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C 
 // D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d 
-// e f g h i j k l m n o p q r s t 
+// e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_4(_tokenSet_4_data_,16);
 const unsigned long ncoLexer::_tokenSet_5_data_[] = { 4294966271UL, 4294967291UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11 
 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
 //   ! # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B 
 // C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c 
-// d e f g h i j k l m n o p q r s t 
+// d e f g h i j k l m n o p q r s t u 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoLexer::_tokenSet_5(_tokenSet_5_data_,16);
 
diff --git a/src/nco++/ncoLexer.hpp b/src/nco++/ncoLexer.hpp
index a3eefd6..992626c 100644
--- a/src/nco++/ncoLexer.hpp
+++ b/src/nco++/ncoLexer.hpp
@@ -14,7 +14,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -35,9 +35,12 @@
     #include <fstream>
     #include <string>
   
+    // custom exception -used for "exit" function
+    #include "ExitException.hpp" 
     // Custom Headers
     #include "prs_cls.hh"
     #include "ncap2_utl.hh"
+    #include "ncap2_att.hh"
     #include "fmc_cls.hh"
     #include "NcapVar.hh"
     #include "NcapVarVector.hh"
@@ -50,10 +53,10 @@
     ANTLR_USING_NAMESPACE(std);
     ANTLR_USING_NAMESPACE(antlr);
 
-#line 54 "ncoLexer.hpp"
+#line 57 "ncoLexer.hpp"
 class CUSTOM_API ncoLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public ncoParserTokenTypes
 {
-#line 342 "ncoGrammer.g"
+#line 348 "ncoGrammer.g"
 
 private:
     prs_cls *prs_arg;
@@ -95,7 +98,7 @@ public:
 		}
 		// else ANTLR_USE_NAMESPACE(std)cout << "Hit EOF of main file" << ANTLR_USE_NAMESPACE(std)endl;
 	}
-#line 58 "ncoLexer.hpp"
+#line 61 "ncoLexer.hpp"
 private:
 	void initLiterals();
 public:
diff --git a/src/nco++/ncoParser.cpp b/src/nco++/ncoParser.cpp
index b239a07..6275a11 100644
--- a/src/nco++/ncoParser.cpp
+++ b/src/nco++/ncoParser.cpp
@@ -92,7 +92,7 @@ void ncoParser::statement() {
 		astFactory->addASTChild( currentAST, returnAST );
 		match(SEMI);
 		statement_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 96 "ncoGrammer.g"
+#line 99 "ncoGrammer.g"
 		
 		if( ncap_fnc_srh(e1_AST))  
 		statement_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(FEXPR,"FEXPR"))->add(statement_AST))); 
@@ -166,7 +166,7 @@ void ncoParser::statement() {
 		}
 		match(RPAREN);
 		match(SEMI);
-#line 106 "ncoGrammer.g"
+#line 109 "ncoGrammer.g"
 		
 		if( def1_AST ){  def1_AST->setType(DEFDIM);def1_AST->setText("1");}
 		if( def2_AST ){  def2_AST->setType(DEFDIM);def2_AST->setText("0");}
@@ -176,11 +176,25 @@ void ncoParser::statement() {
 		statement_AST = currentAST.root;
 		break;
 	}
-	case WHILE:
+	case EXIT:
 	{
 		ANTLR_USE_NAMESPACE(antlr)RefAST tmp8_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
 		tmp8_AST = astFactory->create(LT(1));
 		astFactory->makeASTRoot(currentAST, tmp8_AST);
+		match(EXIT);
+		match(LPAREN);
+		expr();
+		astFactory->addASTChild( currentAST, returnAST );
+		match(RPAREN);
+		match(SEMI);
+		statement_AST = currentAST.root;
+		break;
+	}
+	case WHILE:
+	{
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp12_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp12_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp12_AST);
 		match(WHILE);
 		match(LPAREN);
 		expr();
@@ -200,9 +214,9 @@ void ncoParser::statement() {
 	}
 	case BREAK:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp11_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp11_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp11_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp15_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp15_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp15_AST);
 		match(BREAK);
 		match(SEMI);
 		statement_AST = currentAST.root;
@@ -210,9 +224,9 @@ void ncoParser::statement() {
 	}
 	case CONTINUE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp13_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp13_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp13_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp17_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp17_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp17_AST);
 		match(CONTINUE);
 		match(SEMI);
 		statement_AST = currentAST.root;
@@ -222,9 +236,9 @@ void ncoParser::statement() {
 	{
 		match(SEMI);
 		statement_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 119 "ncoGrammer.g"
+#line 124 "ncoGrammer.g"
 		statement_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(1))->add(astFactory->create(NULL_NODE,"null_stmt"))));
-#line 228 "ncoParser.cpp"
+#line 242 "ncoParser.cpp"
 		currentAST.root = statement_AST;
 		if ( statement_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 			statement_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -237,9 +251,9 @@ void ncoParser::statement() {
 	}
 	case IF:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp16_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp16_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp16_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp20_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp20_AST);
 		match(IF);
 		match(LPAREN);
 		expr();
@@ -265,9 +279,9 @@ void ncoParser::statement() {
 	}
 	case WHERE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp20_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp20_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp24_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp24_AST);
 		match(WHERE);
 		match(LPAREN);
 		expr();
@@ -326,9 +340,9 @@ void ncoParser::for_stmt() {
 	ANTLR_USE_NAMESPACE(antlr)RefAST e3_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST st_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	
-	ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-	tmp24_AST = astFactory->create(LT(1));
-	astFactory->makeASTRoot(currentAST, tmp24_AST);
+	ANTLR_USE_NAMESPACE(antlr)RefAST tmp28_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	tmp28_AST = astFactory->create(LT(1));
+	astFactory->makeASTRoot(currentAST, tmp28_AST);
 	match(FOR);
 	match(LPAREN);
 	{
@@ -485,9 +499,9 @@ void ncoParser::block() {
 	} // ( ... )*
 	match(RCURL);
 	block_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 138 "ncoGrammer.g"
+#line 143 "ncoGrammer.g"
 	block_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(BLOCK,"block"))->add(block_AST)));
-#line 491 "ncoParser.cpp"
+#line 505 "ncoParser.cpp"
 	currentAST.root = block_AST;
 	if ( block_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		block_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -549,9 +563,9 @@ void ncoParser::lmt() {
 	{ // ( ... )*
 	for (;;) {
 		if ((LA(1) == COLON)) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp31_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp31_AST = astFactory->create(LT(1));
-			astFactory->addASTChild(currentAST, tmp31_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp35_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp35_AST = astFactory->create(LT(1));
+			astFactory->addASTChild(currentAST, tmp35_AST);
 			match(COLON);
 			{
 			switch ( LA(1)) {
@@ -604,9 +618,9 @@ void ncoParser::lmt() {
 	_loop20:;
 	} // ( ... )*
 	lmt_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 151 "ncoGrammer.g"
+#line 156 "ncoGrammer.g"
 	lmt_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(LMT,"lmt"))->add(lmt_AST)));
-#line 610 "ncoParser.cpp"
+#line 624 "ncoParser.cpp"
 	currentAST.root = lmt_AST;
 	if ( lmt_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		lmt_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -642,9 +656,9 @@ void ncoParser::lmt_list() {
 	} // ( ... )*
 	match(RPAREN);
 	lmt_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 155 "ncoGrammer.g"
+#line 160 "ncoGrammer.g"
 	lmt_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(LMT_LIST,"lmt_list"))->add(lmt_list_AST)));
-#line 648 "ncoParser.cpp"
+#line 662 "ncoParser.cpp"
 	currentAST.root = lmt_list_AST;
 	if ( lmt_list_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		lmt_list_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -666,17 +680,17 @@ void ncoParser::dmn_list_p() {
 	switch ( LA(1)) {
 	case VAR_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp36_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp36_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp36_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp40_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp40_AST);
 		match(VAR_ID);
 		break;
 	}
 	case DIM_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp37_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp37_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp37_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp41_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp41_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp41_AST);
 		match(DIM_ID);
 		break;
 	}
@@ -699,17 +713,17 @@ void ncoParser::dmn_list_p() {
 			switch ( LA(1)) {
 			case VAR_ID:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp39_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp39_AST = astFactory->create(LT(1));
-				astFactory->addASTChild(currentAST, tmp39_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp43_AST = astFactory->create(LT(1));
+				astFactory->addASTChild(currentAST, tmp43_AST);
 				match(VAR_ID);
 				break;
 			}
 			case DIM_ID:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp40_AST = astFactory->create(LT(1));
-				astFactory->addASTChild(currentAST, tmp40_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp44_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp44_AST = astFactory->create(LT(1));
+				astFactory->addASTChild(currentAST, tmp44_AST);
 				match(DIM_ID);
 				break;
 			}
@@ -729,9 +743,9 @@ void ncoParser::dmn_list_p() {
 	} // ( ... )*
 	match(RSQUARE);
 	dmn_list_p_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 163 "ncoGrammer.g"
+#line 168 "ncoGrammer.g"
 	dmn_list_p_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(DMN_LIST_P,"dmn_list_p"))->add(dmn_list_p_AST)));
-#line 735 "ncoParser.cpp"
+#line 749 "ncoParser.cpp"
 	currentAST.root = dmn_list_p_AST;
 	if ( dmn_list_p_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		dmn_list_p_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -750,18 +764,18 @@ void ncoParser::dmn_list() {
 	
 	match(LPAREN);
 	{
-	ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-	tmp43_AST = astFactory->create(LT(1));
-	astFactory->addASTChild(currentAST, tmp43_AST);
+	ANTLR_USE_NAMESPACE(antlr)RefAST tmp47_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	tmp47_AST = astFactory->create(LT(1));
+	astFactory->addASTChild(currentAST, tmp47_AST);
 	match(DIM_ID);
 	}
 	{ // ( ... )*
 	for (;;) {
 		if ((LA(1) == COMMA)) {
 			match(COMMA);
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp45_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp45_AST = astFactory->create(LT(1));
-			astFactory->addASTChild(currentAST, tmp45_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp49_AST = astFactory->create(LT(1));
+			astFactory->addASTChild(currentAST, tmp49_AST);
 			match(DIM_ID);
 		}
 		else {
@@ -773,9 +787,9 @@ void ncoParser::dmn_list() {
 	} // ( ... )*
 	match(RPAREN);
 	dmn_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 168 "ncoGrammer.g"
+#line 173 "ncoGrammer.g"
 	dmn_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(DMN_LIST,"dmn_list"))->add(dmn_list_AST)));
-#line 779 "ncoParser.cpp"
+#line 793 "ncoParser.cpp"
 	currentAST.root = dmn_list_AST;
 	if ( dmn_list_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		dmn_list_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -797,17 +811,17 @@ void ncoParser::dmn_arg_list() {
 	switch ( LA(1)) {
 	case DIM_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp48_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp48_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp48_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp52_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp52_AST);
 		match(DIM_ID);
 		break;
 	}
 	case DIM_MTD_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp49_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp49_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp53_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp53_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp53_AST);
 		match(DIM_MTD_ID);
 		break;
 	}
@@ -825,17 +839,17 @@ void ncoParser::dmn_arg_list() {
 			switch ( LA(1)) {
 			case DIM_ID:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp51_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp51_AST = astFactory->create(LT(1));
-				astFactory->addASTChild(currentAST, tmp51_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp55_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp55_AST = astFactory->create(LT(1));
+				astFactory->addASTChild(currentAST, tmp55_AST);
 				match(DIM_ID);
 				break;
 			}
 			case DIM_MTD_ID:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp52_AST = astFactory->create(LT(1));
-				astFactory->addASTChild(currentAST, tmp52_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp56_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp56_AST = astFactory->create(LT(1));
+				astFactory->addASTChild(currentAST, tmp56_AST);
 				match(DIM_MTD_ID);
 				break;
 			}
@@ -855,9 +869,9 @@ void ncoParser::dmn_arg_list() {
 	} // ( ... )*
 	match(DIVIDE);
 	dmn_arg_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 174 "ncoGrammer.g"
+#line 179 "ncoGrammer.g"
 	dmn_arg_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(DMN_ARG_LIST,"dmn_arg_list"))->add(dmn_arg_list_AST)));
-#line 861 "ncoParser.cpp"
+#line 875 "ncoParser.cpp"
 	currentAST.root = dmn_arg_list_AST;
 	if ( dmn_arg_list_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		dmn_arg_list_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -893,9 +907,9 @@ void ncoParser::value_list() {
 	} // ( ... )*
 	match(RCURL);
 	value_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 179 "ncoGrammer.g"
+#line 184 "ncoGrammer.g"
 	value_list_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(VALUE_LIST,"value_list"))->add(value_list_AST)));
-#line 899 "ncoParser.cpp"
+#line 913 "ncoParser.cpp"
 	currentAST.root = value_list_AST;
 	if ( value_list_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		value_list_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -951,18 +965,18 @@ void ncoParser::arg_list() {
 	}
 	case DIM_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp57_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp57_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp57_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp61_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp61_AST);
 		match(DIM_ID);
 		arg_list_AST = currentAST.root;
 		break;
 	}
 	case DIM_MTD_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp58_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp58_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp58_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp62_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp62_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp62_AST);
 		match(DIM_MTD_ID);
 		arg_list_AST = currentAST.root;
 		break;
@@ -987,25 +1001,25 @@ void ncoParser::call_ref() {
 	ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST call_ref_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	
-	ANTLR_USE_NAMESPACE(antlr)RefAST tmp59_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-	tmp59_AST = astFactory->create(LT(1));
-	astFactory->makeASTRoot(currentAST, tmp59_AST);
+	ANTLR_USE_NAMESPACE(antlr)RefAST tmp63_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	tmp63_AST = astFactory->create(LT(1));
+	astFactory->makeASTRoot(currentAST, tmp63_AST);
 	match(CALL_REF);
 	{
 	switch ( LA(1)) {
 	case VAR_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp60_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp60_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp60_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp64_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp64_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp64_AST);
 		match(VAR_ID);
 		break;
 	}
 	case ATT_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp61_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp61_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp65_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp65_AST);
 		match(ATT_ID);
 		break;
 	}
@@ -1086,9 +1100,9 @@ void ncoParser::func_arg() {
 	} // ( ... )*
 	match(RPAREN);
 	func_arg_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(currentAST.root);
-#line 186 "ncoGrammer.g"
+#line 191 "ncoGrammer.g"
 	func_arg_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(astFactory->create(FUNC_ARG,"func_arg"))->add(func_arg_AST)));
-#line 1092 "ncoParser.cpp"
+#line 1106 "ncoParser.cpp"
 	currentAST.root = func_arg_AST;
 	if ( func_arg_AST!=ANTLR_USE_NAMESPACE(antlr)nullAST &&
 		func_arg_AST->getFirstChild() != ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -1109,17 +1123,17 @@ void ncoParser::hyper_slb() {
 	switch ( LA(1)) {
 	case VAR_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp65_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp65_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp69_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp69_AST);
 		match(VAR_ID);
 		break;
 	}
 	case ATT_ID:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp66_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp66_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp66_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp70_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp70_AST);
 		match(ATT_ID);
 		break;
 	}
@@ -1203,9 +1217,9 @@ void ncoParser::top_exp() {
 		ur_AST = astFactory->create(ur);
 		astFactory->makeASTRoot(currentAST, ur_AST);
 		match(TIMES);
-#line 198 "ncoGrammer.g"
+#line 203 "ncoGrammer.g"
 		ur_AST->setType(UTIMES);ur_AST->setText("UTIMES");
-#line 1209 "ncoParser.cpp"
+#line 1223 "ncoParser.cpp"
 		top_exp();
 		astFactory->addASTChild( currentAST, returnAST );
 		top_exp_AST = currentAST.root;
@@ -1250,117 +1264,117 @@ void ncoParser::primary_exp() {
 	switch ( LA(1)) {
 	case NCAP_FLOAT:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp67_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp67_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp67_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp71_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp71_AST);
 		match(NCAP_FLOAT);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_DOUBLE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp68_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp68_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp68_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp72_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp72_AST);
 		match(NCAP_DOUBLE);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_INT:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp69_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp69_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp73_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp73_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp73_AST);
 		match(NCAP_INT);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_BYTE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp70_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp70_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp74_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp74_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp74_AST);
 		match(NCAP_BYTE);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_UBYTE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp71_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp71_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp75_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp75_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp75_AST);
 		match(NCAP_UBYTE);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_SHORT:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp72_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp72_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp76_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp76_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp76_AST);
 		match(NCAP_SHORT);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_USHORT:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp73_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp73_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp73_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp77_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp77_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp77_AST);
 		match(NCAP_USHORT);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_UINT:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp74_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp74_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp74_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp78_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp78_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp78_AST);
 		match(NCAP_UINT);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_INT64:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp75_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp75_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp75_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp79_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp79_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp79_AST);
 		match(NCAP_INT64);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NCAP_UINT64:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp76_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp76_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp76_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp80_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp80_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp80_AST);
 		match(NCAP_UINT64);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case NSTRING:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp77_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp77_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp77_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp81_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp81_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp81_AST);
 		match(NSTRING);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case N4STRING:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp78_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp78_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp78_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp82_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp82_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp82_AST);
 		match(N4STRING);
 		primary_exp_AST = currentAST.root;
 		break;
 	}
 	case DIM_ID_SIZE:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp79_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp79_AST = astFactory->create(LT(1));
-		astFactory->addASTChild(currentAST, tmp79_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp83_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp83_AST = astFactory->create(LT(1));
+		astFactory->addASTChild(currentAST, tmp83_AST);
 		match(DIM_ID_SIZE);
 		primary_exp_AST = currentAST.root;
 		break;
@@ -1376,9 +1390,9 @@ void ncoParser::primary_exp() {
 	}
 	case FUNC:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp82_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp82_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp82_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp86_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp86_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp86_AST);
 		match(FUNC);
 		func_arg();
 		astFactory->addASTChild( currentAST, returnAST );
@@ -1411,13 +1425,13 @@ void ncoParser::meth_exp() {
 	{ // ( ... )*
 	for (;;) {
 		if ((LA(1) == DOT)) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp83_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp83_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp83_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp87_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp87_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp87_AST);
 			match(DOT);
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp84_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp84_AST = astFactory->create(LT(1));
-			astFactory->addASTChild(currentAST, tmp84_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp88_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp88_AST = astFactory->create(LT(1));
+			astFactory->addASTChild(currentAST, tmp88_AST);
 			match(FUNC);
 			func_arg();
 			astFactory->addASTChild( currentAST, returnAST );
@@ -1452,10 +1466,10 @@ void ncoParser::unaryleft_exp() {
 		in_AST = astFactory->create(in);
 		astFactory->makeASTRoot(currentAST, in_AST);
 		match(INC);
-#line 207 "ncoGrammer.g"
+#line 212 "ncoGrammer.g"
 		in_AST->setType(POST_INC);
 		in_AST->setText("POST_INC");
-#line 1459 "ncoParser.cpp"
+#line 1473 "ncoParser.cpp"
 		break;
 	}
 	case DEC:
@@ -1464,10 +1478,10 @@ void ncoParser::unaryleft_exp() {
 		de_AST = astFactory->create(de);
 		astFactory->makeASTRoot(currentAST, de_AST);
 		match(DEC);
-#line 209 "ncoGrammer.g"
+#line 214 "ncoGrammer.g"
 		de_AST->setType(POST_DEC);
 		de_AST->setText("POST_DEC");
-#line 1471 "ncoParser.cpp"
+#line 1485 "ncoParser.cpp"
 		break;
 	}
 	case SEMI:
@@ -1526,41 +1540,41 @@ void ncoParser::unary_exp() {
 		switch ( LA(1)) {
 		case LNOT:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp85_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp85_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp85_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp89_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp89_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp89_AST);
 			match(LNOT);
 			break;
 		}
 		case PLUS:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp86_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp86_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp86_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp90_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp90_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp90_AST);
 			match(PLUS);
 			break;
 		}
 		case MINUS:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp87_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp87_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp87_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp91_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp91_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp91_AST);
 			match(MINUS);
 			break;
 		}
 		case INC:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp88_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp88_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp88_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp92_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp92_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp92_AST);
 			match(INC);
 			break;
 		}
 		case DEC:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp89_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp89_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp89_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp93_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp93_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp93_AST);
 			match(DEC);
 			break;
 		}
@@ -1618,9 +1632,9 @@ void ncoParser::pow_exp() {
 	switch ( LA(1)) {
 	case CARET:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp90_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp90_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp90_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp94_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp94_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp94_AST);
 		match(CARET);
 		pow_exp();
 		astFactory->addASTChild( currentAST, returnAST );
@@ -1679,25 +1693,25 @@ void ncoParser::mexpr() {
 			switch ( LA(1)) {
 			case TIMES:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp91_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp91_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp91_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp95_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp95_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp95_AST);
 				match(TIMES);
 				break;
 			}
 			case DIVIDE:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp92_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp92_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp92_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp96_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp96_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp96_AST);
 				match(DIVIDE);
 				break;
 			}
 			case MOD:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp93_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp93_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp93_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp97_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp97_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp97_AST);
 				match(MOD);
 				break;
 			}
@@ -1735,17 +1749,17 @@ void ncoParser::add_expr() {
 			switch ( LA(1)) {
 			case PLUS:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp94_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp94_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp94_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp98_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp98_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp98_AST);
 				match(PLUS);
 				break;
 			}
 			case MINUS:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp95_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp95_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp95_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp99_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp99_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp99_AST);
 				match(MINUS);
 				break;
 			}
@@ -1783,17 +1797,17 @@ void ncoParser::frel_expr() {
 			switch ( LA(1)) {
 			case FLTHAN:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp96_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp96_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp96_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp100_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp100_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp100_AST);
 				match(FLTHAN);
 				break;
 			}
 			case FGTHAN:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp97_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp97_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp97_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp101_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp101_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp101_AST);
 				match(FGTHAN);
 				break;
 			}
@@ -1831,33 +1845,33 @@ void ncoParser::rel_expr() {
 			switch ( LA(1)) {
 			case LTHAN:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp98_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp98_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp98_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp102_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp102_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp102_AST);
 				match(LTHAN);
 				break;
 			}
 			case GTHAN:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp99_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp99_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp99_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp103_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp103_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp103_AST);
 				match(GTHAN);
 				break;
 			}
 			case GEQ:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp100_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp100_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp100_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp104_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp104_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp104_AST);
 				match(GEQ);
 				break;
 			}
 			case LEQ:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp101_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp101_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp101_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp105_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp105_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp105_AST);
 				match(LEQ);
 				break;
 			}
@@ -1895,17 +1909,17 @@ void ncoParser::eq_expr() {
 			switch ( LA(1)) {
 			case EQ:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp102_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp102_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp102_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp106_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp106_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp106_AST);
 				match(EQ);
 				break;
 			}
 			case NEQ:
 			{
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp103_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-				tmp103_AST = astFactory->create(LT(1));
-				astFactory->makeASTRoot(currentAST, tmp103_AST);
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp107_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+				tmp107_AST = astFactory->create(LT(1));
+				astFactory->makeASTRoot(currentAST, tmp107_AST);
 				match(NEQ);
 				break;
 			}
@@ -1939,9 +1953,9 @@ void ncoParser::lmul_expr() {
 	{ // ( ... )*
 	for (;;) {
 		if ((LA(1) == LAND)) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp104_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp104_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp104_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp108_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp108_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp108_AST);
 			match(LAND);
 			eq_expr();
 			astFactory->addASTChild( currentAST, returnAST );
@@ -1967,9 +1981,9 @@ void ncoParser::lor_expr() {
 	{ // ( ... )*
 	for (;;) {
 		if ((LA(1) == LOR)) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp105_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp105_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp105_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp109_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp109_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp109_AST);
 			match(LOR);
 			lmul_expr();
 			astFactory->addASTChild( currentAST, returnAST );
@@ -1996,9 +2010,9 @@ void ncoParser::cond_expr() {
 	switch ( LA(1)) {
 	case QUESTION:
 	{
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp106_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-		tmp106_AST = astFactory->create(LT(1));
-		astFactory->makeASTRoot(currentAST, tmp106_AST);
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp110_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+		tmp110_AST = astFactory->create(LT(1));
+		astFactory->makeASTRoot(currentAST, tmp110_AST);
 		match(QUESTION);
 		ass_expr();
 		astFactory->addASTChild( currentAST, returnAST );
@@ -2049,41 +2063,41 @@ void ncoParser::ass_expr() {
 		switch ( LA(1)) {
 		case ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp108_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp108_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp108_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp112_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp112_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp112_AST);
 			match(ASSIGN);
 			break;
 		}
 		case PLUS_ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp109_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp109_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp109_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp113_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp113_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp113_AST);
 			match(PLUS_ASSIGN);
 			break;
 		}
 		case MINUS_ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp110_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp110_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp110_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp114_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp114_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp114_AST);
 			match(MINUS_ASSIGN);
 			break;
 		}
 		case TIMES_ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp111_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp111_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp111_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp115_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp115_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp115_AST);
 			match(TIMES_ASSIGN);
 			break;
 		}
 		case DIVIDE_ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp112_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-			tmp112_AST = astFactory->create(LT(1));
-			astFactory->makeASTRoot(currentAST, tmp112_AST);
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp116_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+			tmp116_AST = astFactory->create(LT(1));
+			astFactory->makeASTRoot(currentAST, tmp116_AST);
 			match(DIVIDE_ASSIGN);
 			break;
 		}
@@ -2161,9 +2175,9 @@ void ncoParser::imaginary_token() {
 	ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST imaginary_token_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	
-	ANTLR_USE_NAMESPACE(antlr)RefAST tmp113_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
-	tmp113_AST = astFactory->create(LT(1));
-	astFactory->addASTChild(currentAST, tmp113_AST);
+	ANTLR_USE_NAMESPACE(antlr)RefAST tmp117_AST = ANTLR_USE_NAMESPACE(antlr)nullAST;
+	tmp117_AST = astFactory->create(LT(1));
+	astFactory->addASTChild(currentAST, tmp117_AST);
 	match(NRootAST);
 	imaginary_token_AST = currentAST.root;
 	returnAST = imaginary_token_AST;
@@ -2171,7 +2185,7 @@ void ncoParser::imaginary_token() {
 
 void ncoParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
 {
-	factory.setMaxNodeType(116);
+	factory.setMaxNodeType(117);
 }
 const char* ncoParser::tokenNames[] = {
 	"<0>",
@@ -2211,6 +2225,7 @@ const char* ncoParser::tokenNames[] = {
 	"a string",
 	",",
 	")",
+	"\"exit\"",
 	"\"while\"",
 	"\"break\"",
 	"\"continue\"",
@@ -2294,30 +2309,30 @@ const char* ncoParser::tokenNames[] = {
 	0
 };
 
-const unsigned long ncoParser::_tokenSet_0_data_[] = { 3221225472UL, 4248983015UL, 1073479680UL, 0UL, 0UL, 0UL, 0UL, 0UL };
-// SEMI "defdim" "defdimunlim" LPAREN NSTRING "while" "break" "continue" 
+const unsigned long ncoParser::_tokenSet_0_data_[] = { 3221225472UL, 4202998759UL, 2146959361UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "defdim" "defdimunlim" LPAREN NSTRING "exit" "while" "break" "continue" 
 // "if" "where" LCURL "for" VAR_ID ATT_ID TIMES FUNC INC DEC LNOT PLUS 
 // MINUS NCAP_FLOAT NCAP_DOUBLE NCAP_INT NCAP_BYTE NCAP_UBYTE NCAP_SHORT 
 // NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 N4STRING DIM_ID_SIZE 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoParser::_tokenSet_0(_tokenSet_0_data_,8);
-const unsigned long ncoParser::_tokenSet_1_data_[] = { 3221225474UL, 4283662311UL, 1073741823UL, 0UL, 0UL, 0UL, 0UL, 0UL };
-// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING "while" "break" "continue" 
-// "if" "else" "where" "elsewhere" LCURL RCURL "for" LSQUARE VAR_ID DIVIDE 
-// ATT_ID TIMES DOT FUNC INC DEC LNOT PLUS MINUS CARET MOD FLTHAN FGTHAN 
-// LTHAN GTHAN GEQ LEQ EQ NEQ LAND LOR QUESTION ASSIGN PLUS_ASSIGN MINUS_ASSIGN 
-// TIMES_ASSIGN DIVIDE_ASSIGN NCAP_FLOAT NCAP_DOUBLE NCAP_INT NCAP_BYTE 
-// NCAP_UBYTE NCAP_SHORT NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 N4STRING 
-// DIM_ID_SIZE 
+const unsigned long ncoParser::_tokenSet_1_data_[] = { 3221225474UL, 4272357351UL, 2147483647UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING "exit" "while" "break" 
+// "continue" "if" "else" "where" "elsewhere" LCURL RCURL "for" LSQUARE 
+// VAR_ID DIVIDE ATT_ID TIMES DOT FUNC INC DEC LNOT PLUS MINUS CARET MOD 
+// FLTHAN FGTHAN LTHAN GTHAN GEQ LEQ EQ NEQ LAND LOR QUESTION ASSIGN PLUS_ASSIGN 
+// MINUS_ASSIGN TIMES_ASSIGN DIVIDE_ASSIGN NCAP_FLOAT NCAP_DOUBLE NCAP_INT 
+// NCAP_BYTE NCAP_UBYTE NCAP_SHORT NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 
+// N4STRING DIM_ID_SIZE 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoParser::_tokenSet_1(_tokenSet_1_data_,8);
-const unsigned long ncoParser::_tokenSet_2_data_[] = { 3221225474UL, 4248993767UL, 1073479680UL, 0UL, 0UL, 0UL, 0UL, 0UL };
-// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING "while" "break" "continue" 
-// "if" "else" "where" "elsewhere" LCURL RCURL "for" VAR_ID ATT_ID TIMES 
-// FUNC INC DEC LNOT PLUS MINUS NCAP_FLOAT NCAP_DOUBLE NCAP_INT NCAP_BYTE 
-// NCAP_UBYTE NCAP_SHORT NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 N4STRING 
-// DIM_ID_SIZE 
+const unsigned long ncoParser::_tokenSet_2_data_[] = { 3221225474UL, 4203020263UL, 2146959361UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING "exit" "while" "break" 
+// "continue" "if" "else" "where" "elsewhere" LCURL RCURL "for" VAR_ID 
+// ATT_ID TIMES FUNC INC DEC LNOT PLUS MINUS NCAP_FLOAT NCAP_DOUBLE NCAP_INT 
+// NCAP_BYTE NCAP_UBYTE NCAP_SHORT NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 
+// N4STRING DIM_ID_SIZE 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoParser::_tokenSet_2(_tokenSet_2_data_,8);
-const unsigned long ncoParser::_tokenSet_3_data_[] = { 3221225474UL, 4294967295UL, 1073741823UL, 0UL, 0UL, 0UL, 0UL, 0UL };
-// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING COMMA RPAREN "while" 
+const unsigned long ncoParser::_tokenSet_3_data_[] = { 3221225474UL, 4294967295UL, 2147483647UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "defdim" "defdimunlim" LPAREN NSTRING COMMA RPAREN "exit" "while" 
 // "break" "continue" "if" "else" "where" "elsewhere" LCURL RCURL "for" 
 // COLON LSQUARE VAR_ID DIM_ID RSQUARE DIVIDE DIM_MTD_ID ATT_ID CALL_REF 
 // TIMES DOT FUNC INC DEC LNOT PLUS MINUS CARET MOD FLTHAN FGTHAN LTHAN 
@@ -2326,7 +2341,7 @@ const unsigned long ncoParser::_tokenSet_3_data_[] = { 3221225474UL, 4294967295U
 // NCAP_UBYTE NCAP_SHORT NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 N4STRING 
 // DIM_ID_SIZE 
 const ANTLR_USE_NAMESPACE(antlr)BitSet ncoParser::_tokenSet_3(_tokenSet_3_data_,8);
-const unsigned long ncoParser::_tokenSet_4_data_[] = { 0UL, 4248993822UL, 1073479680UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+const unsigned long ncoParser::_tokenSet_4_data_[] = { 0UL, 4203020318UL, 2146959361UL, 0UL, 0UL, 0UL, 0UL, 0UL };
 // LPAREN NSTRING COMMA RPAREN COLON VAR_ID ATT_ID TIMES FUNC INC DEC LNOT 
 // PLUS MINUS NCAP_FLOAT NCAP_DOUBLE NCAP_INT NCAP_BYTE NCAP_UBYTE NCAP_SHORT 
 // NCAP_USHORT NCAP_UINT NCAP_INT64 NCAP_UINT64 N4STRING DIM_ID_SIZE 
diff --git a/src/nco++/ncoParser.hpp b/src/nco++/ncoParser.hpp
index f5b9b60..12ed8a6 100644
--- a/src/nco++/ncoParser.hpp
+++ b/src/nco++/ncoParser.hpp
@@ -14,7 +14,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -35,9 +35,12 @@
     #include <fstream>
     #include <string>
   
+    // custom exception -used for "exit" function
+    #include "ExitException.hpp" 
     // Custom Headers
     #include "prs_cls.hh"
     #include "ncap2_utl.hh"
+    #include "ncap2_att.hh"
     #include "fmc_cls.hh"
     #include "NcapVar.hh"
     #include "NcapVarVector.hh"
@@ -50,15 +53,15 @@
     ANTLR_USING_NAMESPACE(std);
     ANTLR_USING_NAMESPACE(antlr);
 
-#line 54 "ncoParser.hpp"
+#line 57 "ncoParser.hpp"
 class CUSTOM_API ncoParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public ncoParserTokenTypes
 {
-#line 84 "ncoGrammer.g"
+#line 87 "ncoGrammer.g"
 
 
 public:
    std::vector<std::string> inc_vtr;
-#line 58 "ncoParser.hpp"
+#line 61 "ncoParser.hpp"
 public:
 	void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
 protected:
@@ -125,10 +128,10 @@ protected:
 private:
 	static const char* tokenNames[];
 #ifndef NO_STATIC_CONSTS
-	static const int NUM_TOKENS = 117;
+	static const int NUM_TOKENS = 118;
 #else
 	enum {
-		NUM_TOKENS = 117
+		NUM_TOKENS = 118
 	};
 #endif
 	
diff --git a/src/nco++/ncoParserTokenTypes.hpp b/src/nco++/ncoParserTokenTypes.hpp
index f141853..7632c4d 100644
--- a/src/nco++/ncoParserTokenTypes.hpp
+++ b/src/nco++/ncoParserTokenTypes.hpp
@@ -45,86 +45,87 @@ struct CUSTOM_API ncoParserTokenTypes {
 		NSTRING = 34,
 		COMMA = 35,
 		RPAREN = 36,
-		WHILE = 37,
-		BREAK = 38,
-		CONTINUE = 39,
-		IF = 40,
-		ELSE = 41,
-		WHERE = 42,
-		ELSEWHERE = 43,
-		LCURL = 44,
-		RCURL = 45,
-		FOR = 46,
-		COLON = 47,
-		LSQUARE = 48,
-		VAR_ID = 49,
-		DIM_ID = 50,
-		RSQUARE = 51,
-		DIVIDE = 52,
-		DIM_MTD_ID = 53,
-		ATT_ID = 54,
-		CALL_REF = 55,
-		TIMES = 56,
-		DOT = 57,
-		FUNC = 58,
-		INC = 59,
-		DEC = 60,
-		LNOT = 61,
-		PLUS = 62,
-		MINUS = 63,
-		CARET = 64,
-		MOD = 65,
-		FLTHAN = 66,
-		FGTHAN = 67,
-		LTHAN = 68,
-		GTHAN = 69,
-		GEQ = 70,
-		LEQ = 71,
-		EQ = 72,
-		NEQ = 73,
-		LAND = 74,
-		LOR = 75,
-		QUESTION = 76,
-		ASSIGN = 77,
-		PLUS_ASSIGN = 78,
-		MINUS_ASSIGN = 79,
-		TIMES_ASSIGN = 80,
-		DIVIDE_ASSIGN = 81,
-		NCAP_FLOAT = 82,
-		NCAP_DOUBLE = 83,
-		NCAP_INT = 84,
-		NCAP_BYTE = 85,
-		NCAP_UBYTE = 86,
-		NCAP_SHORT = 87,
-		NCAP_USHORT = 88,
-		NCAP_UINT = 89,
-		NCAP_INT64 = 90,
-		NCAP_UINT64 = 91,
-		N4STRING = 92,
-		DIM_ID_SIZE = 93,
-		NRootAST = 94,
-		SHIFTL = 95,
-		SHIFTR = 96,
-		QUOTE = 97,
-		DGT = 98,
-		LPH = 99,
-		LPHDGT = 100,
-		XPN = 101,
-		VAR_NM_QT = 102,
-		BLASTOUT = 103,
-		UNUSED_OPS = 104,
-		WS = 105,
-		CXX_COMMENT = 106,
-		C_COMMENT = 107,
-		NUMBER_DOT = 108,
-		NUMBER = 109,
-		VAR_ATT = 110,
-		VAR_ATT_QT = 111,
-		STR_ATT_QT = 112,
-		DIM_QT = 113,
-		DIM_VAL = 114,
-		INCLUDE = 115,
-		LMT_DMN = 116,
+		EXIT = 37,
+		WHILE = 38,
+		BREAK = 39,
+		CONTINUE = 40,
+		IF = 41,
+		ELSE = 42,
+		WHERE = 43,
+		ELSEWHERE = 44,
+		LCURL = 45,
+		RCURL = 46,
+		FOR = 47,
+		COLON = 48,
+		LSQUARE = 49,
+		VAR_ID = 50,
+		DIM_ID = 51,
+		RSQUARE = 52,
+		DIVIDE = 53,
+		DIM_MTD_ID = 54,
+		ATT_ID = 55,
+		CALL_REF = 56,
+		TIMES = 57,
+		DOT = 58,
+		FUNC = 59,
+		INC = 60,
+		DEC = 61,
+		LNOT = 62,
+		PLUS = 63,
+		MINUS = 64,
+		CARET = 65,
+		MOD = 66,
+		FLTHAN = 67,
+		FGTHAN = 68,
+		LTHAN = 69,
+		GTHAN = 70,
+		GEQ = 71,
+		LEQ = 72,
+		EQ = 73,
+		NEQ = 74,
+		LAND = 75,
+		LOR = 76,
+		QUESTION = 77,
+		ASSIGN = 78,
+		PLUS_ASSIGN = 79,
+		MINUS_ASSIGN = 80,
+		TIMES_ASSIGN = 81,
+		DIVIDE_ASSIGN = 82,
+		NCAP_FLOAT = 83,
+		NCAP_DOUBLE = 84,
+		NCAP_INT = 85,
+		NCAP_BYTE = 86,
+		NCAP_UBYTE = 87,
+		NCAP_SHORT = 88,
+		NCAP_USHORT = 89,
+		NCAP_UINT = 90,
+		NCAP_INT64 = 91,
+		NCAP_UINT64 = 92,
+		N4STRING = 93,
+		DIM_ID_SIZE = 94,
+		NRootAST = 95,
+		SHIFTL = 96,
+		SHIFTR = 97,
+		QUOTE = 98,
+		DGT = 99,
+		LPH = 100,
+		LPHDGT = 101,
+		XPN = 102,
+		VAR_NM_QT = 103,
+		BLASTOUT = 104,
+		UNUSED_OPS = 105,
+		WS = 106,
+		CXX_COMMENT = 107,
+		C_COMMENT = 108,
+		NUMBER_DOT = 109,
+		NUMBER = 110,
+		VAR_ATT = 111,
+		VAR_ATT_QT = 112,
+		STR_ATT_QT = 113,
+		DIM_QT = 114,
+		DIM_VAL = 115,
+		INCLUDE = 116,
+		LMT_DMN = 117,
 		NULL_TREE_LOOKAHEAD = 3
 	};
 #ifdef __cplusplus
diff --git a/src/nco++/ncoTree.cpp b/src/nco++/ncoTree.cpp
index 760ecff..ef9937b 100644
--- a/src/nco++/ncoTree.cpp
+++ b/src/nco++/ncoTree.cpp
@@ -13,7 +13,7 @@ ncoTree::ncoTree()
 }
 
 int  ncoTree::lmt_peek(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 1157 "ncoGrammer.g"
+#line 1163 "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 1159 "ncoGrammer.g"
+#line 1165 "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 1170 "ncoGrammer.g"
+#line 1176 "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;
@@ -69,7 +69,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	ANTLR_USE_NAMESPACE(antlr)RefAST stmt2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST dtyp = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST def = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 1170 "ncoGrammer.g"
+#line 1176 "ncoGrammer.g"
 	
 	var_sct *var=NULL;
 	var_sct *var2=NULL;
@@ -91,7 +91,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,BLOCK);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1180 "ncoGrammer.g"
+#line 1186 "ncoGrammer.g"
 				
 				//std::cout <<"Num of Children in block="<<blk->getNumberOfChildren()<<endl;
 				iret=run_exe(blk->getFirstChild(),lpp_vtr.size() );
@@ -113,7 +113,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t231;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1187 "ncoGrammer.g"
+#line 1193 "ncoGrammer.g"
 				
 				int aType; 
 				
@@ -137,7 +137,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		case FEXPR:
 		{
 			ANTLR_USE_NAMESPACE(antlr)RefAST __t232 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp114_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp118_AST_in = _t;
 			match(_t,FEXPR);
 			_t = _t->getFirstChild();
 			fss = _t;
@@ -146,7 +146,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t232;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1207 "ncoGrammer.g"
+#line 1213 "ncoGrammer.g"
 				
 				
 				var=out(fss);
@@ -163,7 +163,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		case IF:
 		{
 			ANTLR_USE_NAMESPACE(antlr)RefAST __t233 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp115_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp119_AST_in = _t;
 			match(_t,IF);
 			_t = _t->getFirstChild();
 			var=out(_t);
@@ -174,7 +174,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t233;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1217 "ncoGrammer.g"
+#line 1223 "ncoGrammer.g"
 				
 				//if can have only 3 or 4 parts  , 1 node and 2 or 3 siblings
 				// IF LOGICAL_EXP STATEMENT1 STATEMENT2
@@ -211,7 +211,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		case WHERE:
 		{
 			ANTLR_USE_NAMESPACE(antlr)RefAST __t234 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp116_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp120_AST_in = _t;
 			match(_t,WHERE);
 			_t = _t->getFirstChild();
 			var=out(_t);
@@ -222,7 +222,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t234;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1247 "ncoGrammer.g"
+#line 1253 "ncoGrammer.g"
 				
 				// convert mask to short 
 				RefAST tr; 
@@ -273,7 +273,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		case WHILE:
 		{
 			ANTLR_USE_NAMESPACE(antlr)RefAST __t235 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp117_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp121_AST_in = _t;
 			match(_t,WHILE);
 			_t = _t->getFirstChild();
 			lgcl = _t;
@@ -285,7 +285,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t235;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1291 "ncoGrammer.g"
+#line 1297 "ncoGrammer.g"
 				
 				
 				bool br;
@@ -321,7 +321,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		case FOR:
 		{
 			ANTLR_USE_NAMESPACE(antlr)RefAST __t236 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp118_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp122_AST_in = _t;
 			match(_t,FOR);
 			_t = _t->getFirstChild();
 			e1 = _t;
@@ -339,7 +339,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			_t = __t236;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1320 "ncoGrammer.g"
+#line 1326 "ncoGrammer.g"
 				
 				bool b1,b2,b3,br;
 				var_sct *var_f1;
@@ -394,57 +394,89 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			}
 			break;
 		}
+		case EXIT:
+		{
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t237 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp123_AST_in = _t;
+			match(_t,EXIT);
+			_t = _t->getFirstChild();
+			var=out(_t);
+			_t = _retTree;
+			_t = __t237;
+			_t = _t->getNextSibling();
+			if ( inputState->guessing==0 ) {
+#line 1378 "ncoGrammer.g"
+				
+				int sret;
+				ostringstream os;       
+				
+				// convert to INT   
+				nco_var_cnf_typ(NC_INT,var);  
+				cast_void_nctype(NC_INT,&var->val);
+				sret=var->val.ip[0];
+				cast_nctype_void(NC_INT,&var->val);
+				var=nco_var_free(var); 
+				
+				iret=EXIT; 
+				os<<sret;
+				throw  ANTLR_USE_NAMESPACE(antlr)ExitException(os.str());
+				
+				
+#line 426 "ncoTree.cpp"
+			}
+			break;
+		}
 		case ELSE:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp119_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp124_AST_in = _t;
 			match(_t,ELSE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1371 "ncoGrammer.g"
+#line 1394 "ncoGrammer.g"
 				iret=ELSE;
-#line 406 "ncoTree.cpp"
+#line 438 "ncoTree.cpp"
 			}
 			break;
 		}
 		case BREAK:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp120_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp125_AST_in = _t;
 			match(_t,BREAK);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1372 "ncoGrammer.g"
+#line 1395 "ncoGrammer.g"
 				iret=BREAK;
-#line 418 "ncoTree.cpp"
+#line 450 "ncoTree.cpp"
 			}
 			break;
 		}
 		case CONTINUE:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp121_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp126_AST_in = _t;
 			match(_t,CONTINUE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1373 "ncoGrammer.g"
+#line 1396 "ncoGrammer.g"
 				iret=CONTINUE;
-#line 430 "ncoTree.cpp"
+#line 462 "ncoTree.cpp"
 			}
 			break;
 		}
 		case NULL_NODE:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp122_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp127_AST_in = _t;
 			match(_t,NULL_NODE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1374 "ncoGrammer.g"
+#line 1397 "ncoGrammer.g"
 				iret=NULL_NODE;
-#line 442 "ncoTree.cpp"
+#line 474 "ncoTree.cpp"
 			}
 			break;
 		}
 		case DEFDIM:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t237 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t238 = _t;
 			dtyp = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 			match(_t,DEFDIM);
 			_t = _t->getFirstChild();
@@ -519,10 +551,10 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			}
 			}
 			}
-			_t = __t237;
+			_t = __t238;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1376 "ncoGrammer.g"
+#line 1399 "ncoGrammer.g"
 				
 				
 				bool bunlimited=false;      
@@ -563,7 +595,7 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				
 				(void)ncap_def_dim(def->getText(),sz,bunlimited,prs_arg);
 				
-#line 567 "ncoTree.cpp"
+#line 599 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -587,9 +619,9 @@ int  ncoTree::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2184 "ncoGrammer.g"
+#line 2207 "ncoGrammer.g"
 	var_sct *var;
-#line 593 "ncoTree.cpp"
+#line 625 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST out_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST aposti = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST apostd = ANTLR_USE_NAMESPACE(antlr)nullAST;
@@ -631,7 +663,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 2184 "ncoGrammer.g"
+#line 2207 "ncoGrammer.g"
 	
 	bool bret=true;   
 	const std::string fnc_nm("out"); 
@@ -649,7 +681,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	bret=false;
 	}      
 	
-#line 653 "ncoTree.cpp"
+#line 685 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -657,331 +689,331 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		switch ( _t->getType()) {
 		case TIMES:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t308 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp123_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t309 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp128_AST_in = _t;
 			match(_t,TIMES);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t308;
+			_t = __t309;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2225 "ncoGrammer.g"
+#line 2248 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, TIMES );
-#line 674 "ncoTree.cpp"
+#line 706 "ncoTree.cpp"
 			}
 			break;
 		}
 		case DIVIDE:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t309 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp124_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t310 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp129_AST_in = _t;
 			match(_t,DIVIDE);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t309;
+			_t = __t310;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2228 "ncoGrammer.g"
+#line 2251 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, DIVIDE );
-#line 693 "ncoTree.cpp"
+#line 725 "ncoTree.cpp"
 			}
 			break;
 		}
 		case MOD:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t310 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp125_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t311 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp130_AST_in = _t;
 			match(_t,MOD);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t310;
+			_t = __t311;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2230 "ncoGrammer.g"
+#line 2253 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, MOD);
-#line 712 "ncoTree.cpp"
+#line 744 "ncoTree.cpp"
 			}
 			break;
 		}
 		case CARET:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t311 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp126_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t312 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp131_AST_in = _t;
 			match(_t,CARET);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t311;
+			_t = __t312;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2232 "ncoGrammer.g"
+#line 2255 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, CARET);
-#line 731 "ncoTree.cpp"
+#line 763 "ncoTree.cpp"
 			}
 			break;
 		}
 		case LNOT:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t312 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp127_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t313 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp132_AST_in = _t;
 			match(_t,LNOT);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
-			_t = __t312;
+			_t = __t313;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2235 "ncoGrammer.g"
+#line 2258 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,NULL_CEWI, LNOT );
-#line 748 "ncoTree.cpp"
+#line 780 "ncoTree.cpp"
 			}
 			break;
 		}
 		case LAND:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t319 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp128_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t320 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp133_AST_in = _t;
 			match(_t,LAND);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t319;
+			_t = __t320;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2254 "ncoGrammer.g"
+#line 2277 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LAND );
-#line 767 "ncoTree.cpp"
+#line 799 "ncoTree.cpp"
 			}
 			break;
 		}
 		case LOR:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t320 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp129_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t321 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp134_AST_in = _t;
 			match(_t,LOR);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t320;
+			_t = __t321;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2256 "ncoGrammer.g"
+#line 2279 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LOR );
-#line 786 "ncoTree.cpp"
+#line 818 "ncoTree.cpp"
 			}
 			break;
 		}
 		case LTHAN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t321 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp130_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t322 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp135_AST_in = _t;
 			match(_t,LTHAN);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t321;
+			_t = __t322;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2259 "ncoGrammer.g"
+#line 2282 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LTHAN );
-#line 805 "ncoTree.cpp"
+#line 837 "ncoTree.cpp"
 			}
 			break;
 		}
 		case GTHAN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t322 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp131_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t323 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp136_AST_in = _t;
 			match(_t,GTHAN);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t322;
+			_t = __t323;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2261 "ncoGrammer.g"
+#line 2284 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GTHAN );
-#line 824 "ncoTree.cpp"
+#line 856 "ncoTree.cpp"
 			}
 			break;
 		}
 		case GEQ:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t323 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp132_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t324 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp137_AST_in = _t;
 			match(_t,GEQ);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t323;
+			_t = __t324;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2263 "ncoGrammer.g"
+#line 2286 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, GEQ );
-#line 843 "ncoTree.cpp"
+#line 875 "ncoTree.cpp"
 			}
 			break;
 		}
 		case LEQ:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t324 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp133_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t325 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp138_AST_in = _t;
 			match(_t,LEQ);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t324;
+			_t = __t325;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2265 "ncoGrammer.g"
+#line 2288 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, LEQ );
-#line 862 "ncoTree.cpp"
+#line 894 "ncoTree.cpp"
 			}
 			break;
 		}
 		case EQ:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t325 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp134_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t326 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp139_AST_in = _t;
 			match(_t,EQ);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t325;
+			_t = __t326;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2267 "ncoGrammer.g"
+#line 2290 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, EQ );
-#line 881 "ncoTree.cpp"
+#line 913 "ncoTree.cpp"
 			}
 			break;
 		}
 		case NEQ:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t326 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp135_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t327 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp140_AST_in = _t;
 			match(_t,NEQ);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t326;
+			_t = __t327;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2269 "ncoGrammer.g"
+#line 2292 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, NEQ );
-#line 900 "ncoTree.cpp"
+#line 932 "ncoTree.cpp"
 			}
 			break;
 		}
 		case FLTHAN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t327 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp136_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t328 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp141_AST_in = _t;
 			match(_t,FLTHAN);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t327;
+			_t = __t328;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2272 "ncoGrammer.g"
+#line 2295 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FLTHAN );
-#line 919 "ncoTree.cpp"
+#line 951 "ncoTree.cpp"
 			}
 			break;
 		}
 		case FGTHAN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t328 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp137_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t329 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp142_AST_in = _t;
 			match(_t,FGTHAN);
 			_t = _t->getFirstChild();
 			var1=out(_t);
 			_t = _retTree;
 			var2=out(_t);
 			_t = _retTree;
-			_t = __t328;
+			_t = __t329;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2274 "ncoGrammer.g"
+#line 2297 "ncoGrammer.g"
 				var=ncap_var_var_op(var1,var2, FGTHAN );
-#line 938 "ncoTree.cpp"
+#line 970 "ncoTree.cpp"
 			}
 			break;
 		}
 		case UTIMES:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t412 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp138_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t413 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp143_AST_in = _t;
 			match(_t,UTIMES);
 			_t = _t->getFirstChild();
 			attz = _t;
 			match(_t,ATT_ID);
 			_t = _t->getNextSibling();
-			_t = __t412;
+			_t = __t413;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2407 "ncoGrammer.g"
+#line 2430 "ncoGrammer.g"
 				
 				var=out(att2var(attz));    
 				
-#line 958 "ncoTree.cpp"
+#line 990 "ncoTree.cpp"
 			}
 			break;
 		}
 		case WHERE_ASSIGN:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t413 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp139_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t414 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp144_AST_in = _t;
 			match(_t,WHERE_ASSIGN);
 			_t = _t->getFirstChild();
 			wasn = _t;
 			if ( _t == ANTLR_USE_NAMESPACE(antlr)nullAST ) throw ANTLR_USE_NAMESPACE(antlr)MismatchedTokenException();
 			_t = _t->getNextSibling();
-			_t = __t413;
+			_t = __t414;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2413 "ncoGrammer.g"
+#line 2436 "ncoGrammer.g"
 				
 				
 				
-#line 978 "ncoTree.cpp"
+#line 1010 "ncoTree.cpp"
 			}
 			break;
 		}
 		case QUESTION:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t414 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp140_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t415 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp145_AST_in = _t;
 			match(_t,QUESTION);
 			_t = _t->getFirstChild();
 			var1=out(_t);
@@ -989,10 +1021,10 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			qus = _t;
 			if ( _t == ANTLR_USE_NAMESPACE(antlr)nullAST ) throw ANTLR_USE_NAMESPACE(antlr)MismatchedTokenException();
 			_t = _t->getNextSibling();
-			_t = __t414;
+			_t = __t415;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2418 "ncoGrammer.g"
+#line 2441 "ncoGrammer.g"
 				
 				bool br;
 				
@@ -1009,23 +1041,23 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}   
 				var1=nco_var_free(var1);
 				
-#line 1013 "ncoTree.cpp"
+#line 1045 "ncoTree.cpp"
 			}
 			break;
 		}
 		case FUNC:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t415 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t416 = _t;
 			m = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 			match(_t,FUNC);
 			_t = _t->getFirstChild();
 			args = _t;
 			match(_t,FUNC_ARG);
 			_t = _t->getNextSibling();
-			_t = __t415;
+			_t = __t416;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2436 "ncoGrammer.g"
+#line 2459 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1035,14 +1067,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				RefAST tr;  
 				var=prs_arg->fmc_vtr[idx].vfnc()->fnd(tr ,args, prs_arg->fmc_vtr[idx],*this); 
 				
-#line 1039 "ncoTree.cpp"
+#line 1071 "ncoTree.cpp"
 			}
 			break;
 		}
 		case DOT:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t416 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp141_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t417 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp146_AST_in = _t;
 			match(_t,DOT);
 			_t = _t->getFirstChild();
 			mtd = _t;
@@ -1054,10 +1086,10 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			margs = _t;
 			match(_t,FUNC_ARG);
 			_t = _t->getNextSibling();
-			_t = __t416;
+			_t = __t417;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2447 "ncoGrammer.g"
+#line 2470 "ncoGrammer.g"
 				
 				// The lexer has appended the index of the function to the function name m - (name#index)
 				//  the index is into fmc_vtr  
@@ -1066,7 +1098,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				int idx=atoi(sdx.c_str());
 				var=prs_arg->fmc_vtr[idx].vfnc()->fnd(mtd ,margs, prs_arg->fmc_vtr[idx],*this); 
 				
-#line 1070 "ncoTree.cpp"
+#line 1102 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1076,7 +1108,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,DIM_ID_SIZE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2457 "ncoGrammer.g"
+#line 2480 "ncoGrammer.g"
 				
 				string sDim=dval->getText();
 				dmn_sct *dmn_fd;
@@ -1116,7 +1148,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				} 
 				
 				
-#line 1120 "ncoTree.cpp"
+#line 1152 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1126,11 +1158,11 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VALUE_LIST);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2698 "ncoGrammer.g"
+#line 2721 "ncoGrammer.g"
 				
 				var=value_list(vlst);
 				
-#line 1134 "ncoTree.cpp"
+#line 1166 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1140,7 +1172,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NSTRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2703 "ncoGrammer.g"
+#line 2726 "ncoGrammer.g"
 				
 				/* use malloc here rather than strdup(str->getText().c_str()) as this causes 
 				an invalid-read when using GCC compiler */ 
@@ -1164,7 +1196,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				tsng=(char*)nco_free(tsng);      
 				
-#line 1168 "ncoTree.cpp"
+#line 1200 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1174,7 +1206,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,N4STRING);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2731 "ncoGrammer.g"
+#line 2754 "ncoGrammer.g"
 				
 				char *tsng;
 				tsng=(char*)nco_malloc(str1->getText().size()+1);    
@@ -1202,7 +1234,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				tsng=(char*)nco_free(tsng);      
 				
-#line 1206 "ncoTree.cpp"
+#line 1238 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1212,9 +1244,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_FLOAT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2761 "ncoGrammer.g"
+#line 2784 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~float"),(nc_type)NC_FLOAT,false); else var=ncap_sclr_var_mk(SCS("~float"),static_cast<float>(std::strtod(val_float->getText().c_str(),(char **)NULL)));
-#line 1218 "ncoTree.cpp"
+#line 1250 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1224,9 +1256,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_DOUBLE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2763 "ncoGrammer.g"
+#line 2786 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~double"),(nc_type)NC_DOUBLE,false); else var=ncap_sclr_var_mk(SCS("~double"),strtod(val_double->getText().c_str(),(char **)NULL));
-#line 1230 "ncoTree.cpp"
+#line 1262 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1236,9 +1268,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_INT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2765 "ncoGrammer.g"
+#line 2788 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~int"),(nc_type)NC_INT,false); else var=ncap_sclr_var_mk(SCS("~int"),static_cast<nco_int>(std::strtol(val_int->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1242 "ncoTree.cpp"
+#line 1274 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1248,9 +1280,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_SHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2767 "ncoGrammer.g"
+#line 2790 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~short"),(nc_type)NC_SHORT,false); else var=ncap_sclr_var_mk(SCS("~short"),static_cast<nco_short>(std::strtol(val_short->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1254 "ncoTree.cpp"
+#line 1286 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1260,9 +1292,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_BYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2769 "ncoGrammer.g"
+#line 2792 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~byte"),(nc_type)NC_BYTE,false); else var=ncap_sclr_var_mk(SCS("~byte"),static_cast<nco_byte>(std::strtol(val_byte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1266 "ncoTree.cpp"
+#line 1298 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1272,9 +1304,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UBYTE);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2774 "ncoGrammer.g"
+#line 2797 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~ubyte"),(nc_type)NC_UBYTE,false); else var=ncap_sclr_var_mk(SCS("~ubyte"),static_cast<nco_ubyte>(std::strtoul(val_ubyte->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1278 "ncoTree.cpp"
+#line 1310 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1284,9 +1316,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_USHORT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2778 "ncoGrammer.g"
+#line 2801 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~ushort"),(nc_type)NC_USHORT,false); else var=ncap_sclr_var_mk(SCS("~ushort"),static_cast<nco_ushort>(std::strtoul(val_ushort->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1290 "ncoTree.cpp"
+#line 1322 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1296,9 +1328,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UINT);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2780 "ncoGrammer.g"
+#line 2803 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~uint"),(nc_type)NC_UINT,false); else var=ncap_sclr_var_mk(SCS("~uint"),static_cast<nco_uint>(std::strtoul(val_uint->getText().c_str(),(char **)NULL,NCO_SNG_CNV_BASE10)));
-#line 1302 "ncoTree.cpp"
+#line 1334 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1308,9 +1340,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_INT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2782 "ncoGrammer.g"
+#line 2805 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~int64"),(nc_type)NC_INT64,false); else var=ncap_sclr_var_mk(SCS("~int64"),sng2nbr(val_int64->getText(),nco_int64_CEWI));
-#line 1314 "ncoTree.cpp"
+#line 1346 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -1320,435 +1352,435 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,NCAP_UINT64);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2786 "ncoGrammer.g"
+#line 2809 "ncoGrammer.g"
 				if(prs_arg->ntl_scn) var=ncap_sclr_var_mk(SCS("~uint64"),(nc_type)NC_UINT64,false); else var=ncap_sclr_var_mk(SCS("~uint64"),sng2nbr(val_uint64->getText(),nco_uint64_CEWI));
-#line 1326 "ncoTree.cpp"
+#line 1358 "ncoTree.cpp"
 			}
 			break;
 		}
 		default:
-			bool synPredMatched278 = false;
+			bool synPredMatched279 = false;
 			if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 				_t = ASTNULL;
 			if (((_t->getType() == PLUS))) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t278 = _t;
-				synPredMatched278 = true;
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t279 = _t;
+				synPredMatched279 = true;
 				inputState->guessing++;
 				try {
 					{
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t277 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp142_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t278 = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp147_AST_in = _t;
 					match(_t,PLUS);
 					_t = _t->getFirstChild();
 					out(_t);
 					_t = _retTree;
 					out(_t);
 					_t = _retTree;
-					_t = __t277;
+					_t = __t278;
 					_t = _t->getNextSibling();
 					}
 				}
 				catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-					synPredMatched278 = false;
+					synPredMatched279 = false;
 				}
-				_t = __t278;
+				_t = __t279;
 				inputState->guessing--;
 			}
-			if ( synPredMatched278 ) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t279 = _t;
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp143_AST_in = _t;
+			if ( synPredMatched279 ) {
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t280 = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp148_AST_in = _t;
 				match(_t,PLUS);
 				_t = _t->getFirstChild();
 				var1=out(_t);
 				_t = _retTree;
 				var2=out(_t);
 				_t = _retTree;
-				_t = __t279;
+				_t = __t280;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 2205 "ncoGrammer.g"
+#line 2228 "ncoGrammer.g"
 					var=ncap_var_var_op(var1,var2, PLUS );
-#line 1372 "ncoTree.cpp"
+#line 1404 "ncoTree.cpp"
 				}
 			}
 			else {
-				bool synPredMatched282 = false;
+				bool synPredMatched283 = false;
 				if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 					_t = ASTNULL;
 				if (((_t->getType() == MINUS))) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t282 = _t;
-					synPredMatched282 = true;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t283 = _t;
+					synPredMatched283 = true;
 					inputState->guessing++;
 					try {
 						{
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t281 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp144_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t282 = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp149_AST_in = _t;
 						match(_t,MINUS);
 						_t = _t->getFirstChild();
 						out(_t);
 						_t = _retTree;
 						out(_t);
 						_t = _retTree;
-						_t = __t281;
+						_t = __t282;
 						_t = _t->getNextSibling();
 						}
 					}
 					catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-						synPredMatched282 = false;
+						synPredMatched283 = false;
 					}
-					_t = __t282;
+					_t = __t283;
 					inputState->guessing--;
 				}
-				if ( synPredMatched282 ) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t283 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp145_AST_in = _t;
+				if ( synPredMatched283 ) {
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t284 = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp150_AST_in = _t;
 					match(_t,MINUS);
 					_t = _t->getFirstChild();
 					var1=out(_t);
 					_t = _retTree;
 					var2=out(_t);
 					_t = _retTree;
-					_t = __t283;
+					_t = __t284;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 2207 "ncoGrammer.g"
+#line 2230 "ncoGrammer.g"
 						var=ncap_var_var_op(var1,var2, MINUS );
-#line 1417 "ncoTree.cpp"
+#line 1449 "ncoTree.cpp"
 					}
 				}
 				else {
-					bool synPredMatched287 = false;
+					bool synPredMatched288 = false;
 					if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 						_t = ASTNULL;
 					if (((_t->getType() == POST_INC))) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t287 = _t;
-						synPredMatched287 = true;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t288 = _t;
+						synPredMatched288 = true;
 						inputState->guessing++;
 						try {
 							{
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t285 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp146_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t286 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp151_AST_in = _t;
 							match(_t,POST_INC);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t286 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp147_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t287 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp152_AST_in = _t;
 							match(_t,UTIMES);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp148_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp153_AST_in = _t;
 							match(_t,ATT_ID);
 							_t = _t->getNextSibling();
-							_t = __t286;
+							_t = __t287;
 							_t = _t->getNextSibling();
-							_t = __t285;
+							_t = __t286;
 							_t = _t->getNextSibling();
 							}
 						}
 						catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-							synPredMatched287 = false;
+							synPredMatched288 = false;
 						}
-						_t = __t287;
+						_t = __t288;
 						inputState->guessing--;
 					}
-					if ( synPredMatched287 ) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t288 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp149_AST_in = _t;
+					if ( synPredMatched288 ) {
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t289 = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp154_AST_in = _t;
 						match(_t,POST_INC);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t289 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp150_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t290 = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp155_AST_in = _t;
 						match(_t,UTIMES);
 						_t = _t->getFirstChild();
 						aposti = _t;
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
-						_t = __t289;
+						_t = __t290;
 						_t = _t->getNextSibling();
-						_t = __t288;
+						_t = __t289;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 2208 "ncoGrammer.g"
+#line 2231 "ncoGrammer.g"
 							
 							var1=out(att2var(aposti));     
 							var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,false,bret,prs_arg);      
 							
-#line 1475 "ncoTree.cpp"
+#line 1507 "ncoTree.cpp"
 						}
 					}
 					else {
-						bool synPredMatched293 = false;
+						bool synPredMatched294 = false;
 						if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 							_t = ASTNULL;
 						if (((_t->getType() == POST_DEC))) {
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t293 = _t;
-							synPredMatched293 = true;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t294 = _t;
+							synPredMatched294 = true;
 							inputState->guessing++;
 							try {
 								{
-								ANTLR_USE_NAMESPACE(antlr)RefAST __t291 = _t;
-								ANTLR_USE_NAMESPACE(antlr)RefAST tmp151_AST_in = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST __t292 = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST tmp156_AST_in = _t;
 								match(_t,POST_DEC);
 								_t = _t->getFirstChild();
-								ANTLR_USE_NAMESPACE(antlr)RefAST __t292 = _t;
-								ANTLR_USE_NAMESPACE(antlr)RefAST tmp152_AST_in = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST __t293 = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST tmp157_AST_in = _t;
 								match(_t,UTIMES);
 								_t = _t->getFirstChild();
-								ANTLR_USE_NAMESPACE(antlr)RefAST tmp153_AST_in = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST tmp158_AST_in = _t;
 								match(_t,ATT_ID);
 								_t = _t->getNextSibling();
-								_t = __t292;
+								_t = __t293;
 								_t = _t->getNextSibling();
-								_t = __t291;
+								_t = __t292;
 								_t = _t->getNextSibling();
 								}
 							}
 							catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-								synPredMatched293 = false;
+								synPredMatched294 = false;
 							}
-							_t = __t293;
+							_t = __t294;
 							inputState->guessing--;
 						}
-						if ( synPredMatched293 ) {
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t294 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp154_AST_in = _t;
+						if ( synPredMatched294 ) {
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t295 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp159_AST_in = _t;
 							match(_t,POST_DEC);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t295 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp155_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t296 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp160_AST_in = _t;
 							match(_t,UTIMES);
 							_t = _t->getFirstChild();
 							apostd = _t;
 							match(_t,ATT_ID);
 							_t = _t->getNextSibling();
-							_t = __t295;
+							_t = __t296;
 							_t = _t->getNextSibling();
-							_t = __t294;
+							_t = __t295;
 							_t = _t->getNextSibling();
 							if ( inputState->guessing==0 ) {
-#line 2212 "ncoGrammer.g"
+#line 2235 "ncoGrammer.g"
 								
 								var1=out(att2var(apostd));     
 								var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,false,bret,prs_arg);      
 								
-#line 1533 "ncoTree.cpp"
+#line 1565 "ncoTree.cpp"
 							}
 						}
 						else {
-							bool synPredMatched299 = false;
+							bool synPredMatched300 = false;
 							if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 								_t = ASTNULL;
 							if (((_t->getType() == INC))) {
-								ANTLR_USE_NAMESPACE(antlr)RefAST __t299 = _t;
-								synPredMatched299 = true;
+								ANTLR_USE_NAMESPACE(antlr)RefAST __t300 = _t;
+								synPredMatched300 = true;
 								inputState->guessing++;
 								try {
 									{
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t297 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp156_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t298 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp161_AST_in = _t;
 									match(_t,INC);
 									_t = _t->getFirstChild();
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t298 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp157_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t299 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp162_AST_in = _t;
 									match(_t,UTIMES);
 									_t = _t->getFirstChild();
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp158_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp163_AST_in = _t;
 									match(_t,ATT_ID);
 									_t = _t->getNextSibling();
-									_t = __t298;
+									_t = __t299;
 									_t = _t->getNextSibling();
-									_t = __t297;
+									_t = __t298;
 									_t = _t->getNextSibling();
 									}
 								}
 								catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-									synPredMatched299 = false;
+									synPredMatched300 = false;
 								}
-								_t = __t299;
+								_t = __t300;
 								inputState->guessing--;
 							}
-							if ( synPredMatched299 ) {
-								ANTLR_USE_NAMESPACE(antlr)RefAST __t300 = _t;
-								ANTLR_USE_NAMESPACE(antlr)RefAST tmp159_AST_in = _t;
+							if ( synPredMatched300 ) {
+								ANTLR_USE_NAMESPACE(antlr)RefAST __t301 = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST tmp164_AST_in = _t;
 								match(_t,INC);
 								_t = _t->getFirstChild();
-								ANTLR_USE_NAMESPACE(antlr)RefAST __t301 = _t;
-								ANTLR_USE_NAMESPACE(antlr)RefAST tmp160_AST_in = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST __t302 = _t;
+								ANTLR_USE_NAMESPACE(antlr)RefAST tmp165_AST_in = _t;
 								match(_t,UTIMES);
 								_t = _t->getFirstChild();
 								aprei = _t;
 								match(_t,ATT_ID);
 								_t = _t->getNextSibling();
-								_t = __t301;
+								_t = __t302;
 								_t = _t->getNextSibling();
-								_t = __t300;
+								_t = __t301;
 								_t = _t->getNextSibling();
 								if ( inputState->guessing==0 ) {
-#line 2216 "ncoGrammer.g"
+#line 2239 "ncoGrammer.g"
 									
 									var1=out(att2var(aprei));     
 									var=ncap_var_var_inc(var1,NULL_CEWI,INC,false,bret,prs_arg);      
 									
-#line 1591 "ncoTree.cpp"
+#line 1623 "ncoTree.cpp"
 								}
 							}
 							else {
-								bool synPredMatched305 = false;
+								bool synPredMatched306 = false;
 								if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 									_t = ASTNULL;
 								if (((_t->getType() == DEC))) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t305 = _t;
-									synPredMatched305 = true;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t306 = _t;
+									synPredMatched306 = true;
 									inputState->guessing++;
 									try {
 										{
-										ANTLR_USE_NAMESPACE(antlr)RefAST __t303 = _t;
-										ANTLR_USE_NAMESPACE(antlr)RefAST tmp161_AST_in = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST __t304 = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST tmp166_AST_in = _t;
 										match(_t,DEC);
 										_t = _t->getFirstChild();
-										ANTLR_USE_NAMESPACE(antlr)RefAST __t304 = _t;
-										ANTLR_USE_NAMESPACE(antlr)RefAST tmp162_AST_in = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST __t305 = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST tmp167_AST_in = _t;
 										match(_t,UTIMES);
 										_t = _t->getFirstChild();
-										ANTLR_USE_NAMESPACE(antlr)RefAST tmp163_AST_in = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST tmp168_AST_in = _t;
 										match(_t,ATT_ID);
 										_t = _t->getNextSibling();
-										_t = __t304;
+										_t = __t305;
 										_t = _t->getNextSibling();
-										_t = __t303;
+										_t = __t304;
 										_t = _t->getNextSibling();
 										}
 									}
 									catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-										synPredMatched305 = false;
+										synPredMatched306 = false;
 									}
-									_t = __t305;
+									_t = __t306;
 									inputState->guessing--;
 								}
-								if ( synPredMatched305 ) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t306 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp164_AST_in = _t;
+								if ( synPredMatched306 ) {
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t307 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp169_AST_in = _t;
 									match(_t,DEC);
 									_t = _t->getFirstChild();
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t307 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp165_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t308 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp170_AST_in = _t;
 									match(_t,UTIMES);
 									_t = _t->getFirstChild();
 									apred = _t;
 									match(_t,ATT_ID);
 									_t = _t->getNextSibling();
-									_t = __t307;
+									_t = __t308;
 									_t = _t->getNextSibling();
-									_t = __t306;
+									_t = __t307;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2220 "ncoGrammer.g"
+#line 2243 "ncoGrammer.g"
 										
 										var1=out(att2var(apred));     
 										var=ncap_var_var_inc(var1,NULL_CEWI,DEC,false,bret,prs_arg);      
 										
-#line 1649 "ncoTree.cpp"
+#line 1681 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == MINUS)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t313 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp166_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t314 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp171_AST_in = _t;
 									match(_t,MINUS);
 									_t = _t->getFirstChild();
 									var1=out(_t);
 									_t = _retTree;
-									_t = __t313;
+									_t = __t314;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2237 "ncoGrammer.g"
+#line 2260 "ncoGrammer.g"
 										var=ncap_var_var_op(var1,NULL_CEWI, MINUS );
-#line 1664 "ncoTree.cpp"
+#line 1696 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == PLUS)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t314 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp167_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t315 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp172_AST_in = _t;
 									match(_t,PLUS);
 									_t = _t->getFirstChild();
 									var1=out(_t);
 									_t = _retTree;
-									_t = __t314;
+									_t = __t315;
 									_t = _t->getNextSibling();
 								}
 								else if ((_t->getType() == INC)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t315 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp168_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t316 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp173_AST_in = _t;
 									match(_t,INC);
 									_t = _t->getFirstChild();
 									var1=out_asn(_t);
 									_t = _retTree;
-									_t = __t315;
+									_t = __t316;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2241 "ncoGrammer.g"
+#line 2264 "ncoGrammer.g"
 										var=ncap_var_var_inc(var1,NULL_CEWI,INC,false,bret,prs_arg);
-#line 1689 "ncoTree.cpp"
+#line 1721 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == DEC)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t316 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp169_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t317 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp174_AST_in = _t;
 									match(_t,DEC);
 									_t = _t->getFirstChild();
 									var1=out_asn(_t);
 									_t = _retTree;
-									_t = __t316;
+									_t = __t317;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2244 "ncoGrammer.g"
+#line 2267 "ncoGrammer.g"
 										var=ncap_var_var_inc(var1,NULL_CEWI, DEC,false,bret,prs_arg );
-#line 1704 "ncoTree.cpp"
+#line 1736 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == POST_INC)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t317 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp170_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t318 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp175_AST_in = _t;
 									match(_t,POST_INC);
 									_t = _t->getFirstChild();
 									var1=out_asn(_t);
 									_t = _retTree;
-									_t = __t317;
+									_t = __t318;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2246 "ncoGrammer.g"
+#line 2269 "ncoGrammer.g"
 										
 										var=ncap_var_var_inc(var1,NULL_CEWI,POST_INC,false,bret,prs_arg);
 										
-#line 1721 "ncoTree.cpp"
+#line 1753 "ncoTree.cpp"
 									}
 								}
 								else if ((_t->getType() == POST_DEC)) {
-									ANTLR_USE_NAMESPACE(antlr)RefAST __t318 = _t;
-									ANTLR_USE_NAMESPACE(antlr)RefAST tmp171_AST_in = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST __t319 = _t;
+									ANTLR_USE_NAMESPACE(antlr)RefAST tmp176_AST_in = _t;
 									match(_t,POST_DEC);
 									_t = _t->getFirstChild();
 									var1=out_asn(_t);
 									_t = _retTree;
-									_t = __t318;
+									_t = __t319;
 									_t = _t->getNextSibling();
 									if ( inputState->guessing==0 ) {
-#line 2249 "ncoGrammer.g"
+#line 2272 "ncoGrammer.g"
 										
 										var=ncap_var_var_inc(var1,NULL_CEWI,POST_DEC,false,bret,prs_arg);
 										
-#line 1738 "ncoTree.cpp"
+#line 1770 "ncoTree.cpp"
 									}
 								}
 								else {
-									bool synPredMatched332 = false;
+									bool synPredMatched333 = false;
 									if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 										_t = ASTNULL;
 									if (((_t->getType() == PLUS_ASSIGN))) {
-										ANTLR_USE_NAMESPACE(antlr)RefAST __t332 = _t;
-										synPredMatched332 = true;
+										ANTLR_USE_NAMESPACE(antlr)RefAST __t333 = _t;
+										synPredMatched333 = true;
 										inputState->guessing++;
 										try {
 											{
-											ANTLR_USE_NAMESPACE(antlr)RefAST __t330 = _t;
-											ANTLR_USE_NAMESPACE(antlr)RefAST tmp172_AST_in = _t;
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t331 = _t;
+											ANTLR_USE_NAMESPACE(antlr)RefAST tmp177_AST_in = _t;
 											match(_t,PLUS_ASSIGN);
 											_t = _t->getFirstChild();
 											{
@@ -1757,14 +1789,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 											switch ( _t->getType()) {
 											case VAR_ID:
 											{
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp173_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp178_AST_in = _t;
 												match(_t,VAR_ID);
 												_t = _t->getNextSibling();
 												break;
 											}
 											case ATT_ID:
 											{
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp174_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp179_AST_in = _t;
 												match(_t,ATT_ID);
 												_t = _t->getNextSibling();
 												break;
@@ -1777,170 +1809,170 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 											}
 											var2=out(_t);
 											_t = _retTree;
-											_t = __t330;
+											_t = __t331;
 											_t = _t->getNextSibling();
 											}
 										}
 										catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-											synPredMatched332 = false;
+											synPredMatched333 = false;
 										}
-										_t = __t332;
+										_t = __t333;
 										inputState->guessing--;
 									}
-									if ( synPredMatched332 ) {
-										ANTLR_USE_NAMESPACE(antlr)RefAST __t333 = _t;
-										ANTLR_USE_NAMESPACE(antlr)RefAST tmp175_AST_in = _t;
+									if ( synPredMatched333 ) {
+										ANTLR_USE_NAMESPACE(antlr)RefAST __t334 = _t;
+										ANTLR_USE_NAMESPACE(antlr)RefAST tmp180_AST_in = _t;
 										match(_t,PLUS_ASSIGN);
 										_t = _t->getFirstChild();
 										var1=out(_t);
 										_t = _retTree;
 										var2=out(_t);
 										_t = _retTree;
-										_t = __t333;
+										_t = __t334;
 										_t = _t->getNextSibling();
 										if ( inputState->guessing==0 ) {
-#line 2282 "ncoGrammer.g"
+#line 2305 "ncoGrammer.g"
 											
 											var=ncap_var_var_inc(var1,var2,PLUS_ASSIGN ,false, bret,prs_arg);
 											
-#line 1807 "ncoTree.cpp"
+#line 1839 "ncoTree.cpp"
 										}
 									}
 									else {
-										bool synPredMatched337 = false;
+										bool synPredMatched338 = false;
 										if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 											_t = ASTNULL;
 										if (((_t->getType() == PLUS_ASSIGN))) {
-											ANTLR_USE_NAMESPACE(antlr)RefAST __t337 = _t;
-											synPredMatched337 = true;
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t338 = _t;
+											synPredMatched338 = true;
 											inputState->guessing++;
 											try {
 												{
-												ANTLR_USE_NAMESPACE(antlr)RefAST __t335 = _t;
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp176_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t336 = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp181_AST_in = _t;
 												match(_t,PLUS_ASSIGN);
 												_t = _t->getFirstChild();
-												ANTLR_USE_NAMESPACE(antlr)RefAST __t336 = _t;
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp177_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t337 = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp182_AST_in = _t;
 												match(_t,UTIMES);
 												_t = _t->getFirstChild();
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp178_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp183_AST_in = _t;
 												match(_t,VAR_ID);
 												_t = _t->getNextSibling();
-												_t = __t336;
+												_t = __t337;
 												_t = _t->getNextSibling();
 												var2=out(_t);
 												_t = _retTree;
-												_t = __t335;
+												_t = __t336;
 												_t = _t->getNextSibling();
 												}
 											}
 											catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-												synPredMatched337 = false;
+												synPredMatched338 = false;
 											}
-											_t = __t337;
+											_t = __t338;
 											inputState->guessing--;
 										}
-										if ( synPredMatched337 ) {
-											ANTLR_USE_NAMESPACE(antlr)RefAST __t338 = _t;
-											ANTLR_USE_NAMESPACE(antlr)RefAST tmp179_AST_in = _t;
+										if ( synPredMatched338 ) {
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t339 = _t;
+											ANTLR_USE_NAMESPACE(antlr)RefAST tmp184_AST_in = _t;
 											match(_t,PLUS_ASSIGN);
 											_t = _t->getFirstChild();
-											ANTLR_USE_NAMESPACE(antlr)RefAST __t339 = _t;
-											ANTLR_USE_NAMESPACE(antlr)RefAST tmp180_AST_in = _t;
+											ANTLR_USE_NAMESPACE(antlr)RefAST __t340 = _t;
+											ANTLR_USE_NAMESPACE(antlr)RefAST tmp185_AST_in = _t;
 											match(_t,UTIMES);
 											_t = _t->getFirstChild();
 											var1=out(_t);
 											_t = _retTree;
-											_t = __t339;
+											_t = __t340;
 											_t = _t->getNextSibling();
 											var2=out(_t);
 											_t = _retTree;
-											_t = __t338;
+											_t = __t339;
 											_t = _t->getNextSibling();
 											if ( inputState->guessing==0 ) {
-#line 2286 "ncoGrammer.g"
+#line 2309 "ncoGrammer.g"
 												
 												var=ncap_var_var_inc(var1,var2, PLUS_ASSIGN ,true, bret,prs_arg);
 												
-#line 1867 "ncoTree.cpp"
+#line 1899 "ncoTree.cpp"
 											}
 										}
 										else {
-											bool synPredMatched343 = false;
+											bool synPredMatched344 = false;
 											if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 												_t = ASTNULL;
 											if (((_t->getType() == PLUS_ASSIGN))) {
-												ANTLR_USE_NAMESPACE(antlr)RefAST __t343 = _t;
-												synPredMatched343 = true;
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t344 = _t;
+												synPredMatched344 = true;
 												inputState->guessing++;
 												try {
 													{
-													ANTLR_USE_NAMESPACE(antlr)RefAST __t341 = _t;
-													ANTLR_USE_NAMESPACE(antlr)RefAST tmp181_AST_in = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST __t342 = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST tmp186_AST_in = _t;
 													match(_t,PLUS_ASSIGN);
 													_t = _t->getFirstChild();
-													ANTLR_USE_NAMESPACE(antlr)RefAST __t342 = _t;
-													ANTLR_USE_NAMESPACE(antlr)RefAST tmp182_AST_in = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST __t343 = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST tmp187_AST_in = _t;
 													match(_t,UTIMES);
 													_t = _t->getFirstChild();
-													ANTLR_USE_NAMESPACE(antlr)RefAST tmp183_AST_in = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST tmp188_AST_in = _t;
 													match(_t,ATT_ID);
 													_t = _t->getNextSibling();
-													_t = __t342;
+													_t = __t343;
 													_t = _t->getNextSibling();
 													var2=out(_t);
 													_t = _retTree;
-													_t = __t341;
+													_t = __t342;
 													_t = _t->getNextSibling();
 													}
 												}
 												catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-													synPredMatched343 = false;
+													synPredMatched344 = false;
 												}
-												_t = __t343;
+												_t = __t344;
 												inputState->guessing--;
 											}
-											if ( synPredMatched343 ) {
-												ANTLR_USE_NAMESPACE(antlr)RefAST __t344 = _t;
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp184_AST_in = _t;
+											if ( synPredMatched344 ) {
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t345 = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp189_AST_in = _t;
 												match(_t,PLUS_ASSIGN);
 												_t = _t->getFirstChild();
-												ANTLR_USE_NAMESPACE(antlr)RefAST __t345 = _t;
-												ANTLR_USE_NAMESPACE(antlr)RefAST tmp185_AST_in = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST __t346 = _t;
+												ANTLR_USE_NAMESPACE(antlr)RefAST tmp190_AST_in = _t;
 												match(_t,UTIMES);
 												_t = _t->getFirstChild();
 												atp = _t;
 												match(_t,ATT_ID);
 												_t = _t->getNextSibling();
-												_t = __t345;
+												_t = __t346;
 												_t = _t->getNextSibling();
 												var2=out(_t);
 												_t = _retTree;
-												_t = __t344;
+												_t = __t345;
 												_t = _t->getNextSibling();
 												if ( inputState->guessing==0 ) {
-#line 2290 "ncoGrammer.g"
+#line 2313 "ncoGrammer.g"
 													
 													
 													var1=out(att2var(atp));     
 													var=ncap_var_var_inc(var1,var2, PLUS_ASSIGN ,false,bret, prs_arg);
 													
-#line 1930 "ncoTree.cpp"
+#line 1962 "ncoTree.cpp"
 												}
 											}
 											else {
-												bool synPredMatched349 = false;
+												bool synPredMatched350 = false;
 												if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 													_t = ASTNULL;
 												if (((_t->getType() == MINUS_ASSIGN))) {
-													ANTLR_USE_NAMESPACE(antlr)RefAST __t349 = _t;
-													synPredMatched349 = true;
+													ANTLR_USE_NAMESPACE(antlr)RefAST __t350 = _t;
+													synPredMatched350 = true;
 													inputState->guessing++;
 													try {
 														{
-														ANTLR_USE_NAMESPACE(antlr)RefAST __t347 = _t;
-														ANTLR_USE_NAMESPACE(antlr)RefAST tmp186_AST_in = _t;
+														ANTLR_USE_NAMESPACE(antlr)RefAST __t348 = _t;
+														ANTLR_USE_NAMESPACE(antlr)RefAST tmp191_AST_in = _t;
 														match(_t,MINUS_ASSIGN);
 														_t = _t->getFirstChild();
 														{
@@ -1949,14 +1981,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 														switch ( _t->getType()) {
 														case VAR_ID:
 														{
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp187_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t;
 															match(_t,VAR_ID);
 															_t = _t->getNextSibling();
 															break;
 														}
 														case ATT_ID:
 														{
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp188_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t;
 															match(_t,ATT_ID);
 															_t = _t->getNextSibling();
 															break;
@@ -1969,169 +2001,169 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 														}
 														var2=out(_t);
 														_t = _retTree;
-														_t = __t347;
+														_t = __t348;
 														_t = _t->getNextSibling();
 														}
 													}
 													catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-														synPredMatched349 = false;
+														synPredMatched350 = false;
 													}
-													_t = __t349;
+													_t = __t350;
 													inputState->guessing--;
 												}
-												if ( synPredMatched349 ) {
-													ANTLR_USE_NAMESPACE(antlr)RefAST __t350 = _t;
-													ANTLR_USE_NAMESPACE(antlr)RefAST tmp189_AST_in = _t;
+												if ( synPredMatched350 ) {
+													ANTLR_USE_NAMESPACE(antlr)RefAST __t351 = _t;
+													ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t;
 													match(_t,MINUS_ASSIGN);
 													_t = _t->getFirstChild();
 													var1=out(_t);
 													_t = _retTree;
 													var2=out(_t);
 													_t = _retTree;
-													_t = __t350;
+													_t = __t351;
 													_t = _t->getNextSibling();
 													if ( inputState->guessing==0 ) {
-#line 2297 "ncoGrammer.g"
+#line 2320 "ncoGrammer.g"
 														
 														var=ncap_var_var_inc(var1,var2, MINUS_ASSIGN ,false, bret,prs_arg);
 														
-#line 1999 "ncoTree.cpp"
+#line 2031 "ncoTree.cpp"
 													}
 												}
 												else {
-													bool synPredMatched354 = false;
+													bool synPredMatched355 = false;
 													if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 														_t = ASTNULL;
 													if (((_t->getType() == MINUS_ASSIGN))) {
-														ANTLR_USE_NAMESPACE(antlr)RefAST __t354 = _t;
-														synPredMatched354 = true;
+														ANTLR_USE_NAMESPACE(antlr)RefAST __t355 = _t;
+														synPredMatched355 = true;
 														inputState->guessing++;
 														try {
 															{
-															ANTLR_USE_NAMESPACE(antlr)RefAST __t352 = _t;
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp190_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST __t353 = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t;
 															match(_t,MINUS_ASSIGN);
 															_t = _t->getFirstChild();
-															ANTLR_USE_NAMESPACE(antlr)RefAST __t353 = _t;
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp191_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST __t354 = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t;
 															match(_t,UTIMES);
 															_t = _t->getFirstChild();
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t;
 															match(_t,VAR_ID);
 															_t = _t->getNextSibling();
-															_t = __t353;
+															_t = __t354;
 															_t = _t->getNextSibling();
 															var2=out(_t);
 															_t = _retTree;
-															_t = __t352;
+															_t = __t353;
 															_t = _t->getNextSibling();
 															}
 														}
 														catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-															synPredMatched354 = false;
+															synPredMatched355 = false;
 														}
-														_t = __t354;
+														_t = __t355;
 														inputState->guessing--;
 													}
-													if ( synPredMatched354 ) {
-														ANTLR_USE_NAMESPACE(antlr)RefAST __t355 = _t;
-														ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t;
+													if ( synPredMatched355 ) {
+														ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t;
+														ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t;
 														match(_t,MINUS_ASSIGN);
 														_t = _t->getFirstChild();
-														ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t;
-														ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t;
+														ANTLR_USE_NAMESPACE(antlr)RefAST __t357 = _t;
+														ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t;
 														match(_t,UTIMES);
 														_t = _t->getFirstChild();
 														var1=out(_t);
 														_t = _retTree;
-														_t = __t356;
+														_t = __t357;
 														_t = _t->getNextSibling();
 														var2=out(_t);
 														_t = _retTree;
-														_t = __t355;
+														_t = __t356;
 														_t = _t->getNextSibling();
 														if ( inputState->guessing==0 ) {
-#line 2301 "ncoGrammer.g"
+#line 2324 "ncoGrammer.g"
 															
 															var=ncap_var_var_inc(var1,var2, MINUS_ASSIGN ,true, bret,prs_arg);
 															
-#line 2059 "ncoTree.cpp"
+#line 2091 "ncoTree.cpp"
 														}
 													}
 													else {
-														bool synPredMatched360 = false;
+														bool synPredMatched361 = false;
 														if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 															_t = ASTNULL;
 														if (((_t->getType() == MINUS_ASSIGN))) {
-															ANTLR_USE_NAMESPACE(antlr)RefAST __t360 = _t;
-															synPredMatched360 = true;
+															ANTLR_USE_NAMESPACE(antlr)RefAST __t361 = _t;
+															synPredMatched361 = true;
 															inputState->guessing++;
 															try {
 																{
-																ANTLR_USE_NAMESPACE(antlr)RefAST __t358 = _t;
-																ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t;
 																match(_t,MINUS_ASSIGN);
 																_t = _t->getFirstChild();
-																ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t;
-																ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST __t360 = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t;
 																match(_t,UTIMES);
 																_t = _t->getFirstChild();
-																ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t;
 																match(_t,ATT_ID);
 																_t = _t->getNextSibling();
-																_t = __t359;
+																_t = __t360;
 																_t = _t->getNextSibling();
 																var2=out(_t);
 																_t = _retTree;
-																_t = __t358;
+																_t = __t359;
 																_t = _t->getNextSibling();
 																}
 															}
 															catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																synPredMatched360 = false;
+																synPredMatched361 = false;
 															}
-															_t = __t360;
+															_t = __t361;
 															inputState->guessing--;
 														}
-														if ( synPredMatched360 ) {
-															ANTLR_USE_NAMESPACE(antlr)RefAST __t361 = _t;
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t;
+														if ( synPredMatched361 ) {
+															ANTLR_USE_NAMESPACE(antlr)RefAST __t362 = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t;
 															match(_t,MINUS_ASSIGN);
 															_t = _t->getFirstChild();
-															ANTLR_USE_NAMESPACE(antlr)RefAST __t362 = _t;
-															ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST __t363 = _t;
+															ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t;
 															match(_t,UTIMES);
 															_t = _t->getFirstChild();
 															atm = _t;
 															match(_t,ATT_ID);
 															_t = _t->getNextSibling();
-															_t = __t362;
+															_t = __t363;
 															_t = _t->getNextSibling();
 															var2=out(_t);
 															_t = _retTree;
-															_t = __t361;
+															_t = __t362;
 															_t = _t->getNextSibling();
 															if ( inputState->guessing==0 ) {
-#line 2305 "ncoGrammer.g"
+#line 2328 "ncoGrammer.g"
 																
 																var1=out(att2var(atm));     
 																var=ncap_var_var_inc(var1,var2, MINUS_ASSIGN ,false, bret,prs_arg);
 																
-#line 2121 "ncoTree.cpp"
+#line 2153 "ncoTree.cpp"
 															}
 														}
 														else {
-															bool synPredMatched366 = false;
+															bool synPredMatched367 = false;
 															if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																_t = ASTNULL;
 															if (((_t->getType() == TIMES_ASSIGN))) {
-																ANTLR_USE_NAMESPACE(antlr)RefAST __t366 = _t;
-																synPredMatched366 = true;
+																ANTLR_USE_NAMESPACE(antlr)RefAST __t367 = _t;
+																synPredMatched367 = true;
 																inputState->guessing++;
 																try {
 																	{
-																	ANTLR_USE_NAMESPACE(antlr)RefAST __t364 = _t;
-																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST __t365 = _t;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t;
 																	match(_t,TIMES_ASSIGN);
 																	_t = _t->getFirstChild();
 																	{
@@ -2140,14 +2172,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																	switch ( _t->getType()) {
 																	case VAR_ID:
 																	{
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t;
 																		match(_t,VAR_ID);
 																		_t = _t->getNextSibling();
 																		break;
 																	}
 																	case ATT_ID:
 																	{
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t;
 																		match(_t,ATT_ID);
 																		_t = _t->getNextSibling();
 																		break;
@@ -2160,169 +2192,169 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																	}
 																	var2=out(_t);
 																	_t = _retTree;
-																	_t = __t364;
+																	_t = __t365;
 																	_t = _t->getNextSibling();
 																	}
 																}
 																catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																	synPredMatched366 = false;
+																	synPredMatched367 = false;
 																}
-																_t = __t366;
+																_t = __t367;
 																inputState->guessing--;
 															}
-															if ( synPredMatched366 ) {
-																ANTLR_USE_NAMESPACE(antlr)RefAST __t367 = _t;
-																ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t;
+															if ( synPredMatched367 ) {
+																ANTLR_USE_NAMESPACE(antlr)RefAST __t368 = _t;
+																ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t;
 																match(_t,TIMES_ASSIGN);
 																_t = _t->getFirstChild();
 																var1=out(_t);
 																_t = _retTree;
 																var2=out(_t);
 																_t = _retTree;
-																_t = __t367;
+																_t = __t368;
 																_t = _t->getNextSibling();
 																if ( inputState->guessing==0 ) {
-#line 2310 "ncoGrammer.g"
+#line 2333 "ncoGrammer.g"
 																	
 																	var=ncap_var_var_inc(var1,var2, TIMES_ASSIGN ,false, bret,prs_arg);
 																	
-#line 2190 "ncoTree.cpp"
+#line 2222 "ncoTree.cpp"
 																}
 															}
 															else {
-																bool synPredMatched371 = false;
+																bool synPredMatched372 = false;
 																if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																	_t = ASTNULL;
 																if (((_t->getType() == TIMES_ASSIGN))) {
-																	ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t;
-																	synPredMatched371 = true;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST __t372 = _t;
+																	synPredMatched372 = true;
 																	inputState->guessing++;
 																	try {
 																		{
-																		ANTLR_USE_NAMESPACE(antlr)RefAST __t369 = _t;
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST __t370 = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t;
 																		match(_t,TIMES_ASSIGN);
 																		_t = _t->getFirstChild();
-																		ANTLR_USE_NAMESPACE(antlr)RefAST __t370 = _t;
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t;
 																		match(_t,UTIMES);
 																		_t = _t->getFirstChild();
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t;
 																		match(_t,VAR_ID);
 																		_t = _t->getNextSibling();
-																		_t = __t370;
+																		_t = __t371;
 																		_t = _t->getNextSibling();
 																		var2=out(_t);
 																		_t = _retTree;
-																		_t = __t369;
+																		_t = __t370;
 																		_t = _t->getNextSibling();
 																		}
 																	}
 																	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																		synPredMatched371 = false;
+																		synPredMatched372 = false;
 																	}
-																	_t = __t371;
+																	_t = __t372;
 																	inputState->guessing--;
 																}
-																if ( synPredMatched371 ) {
-																	ANTLR_USE_NAMESPACE(antlr)RefAST __t372 = _t;
-																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t;
+																if ( synPredMatched372 ) {
+																	ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t;
 																	match(_t,TIMES_ASSIGN);
 																	_t = _t->getFirstChild();
-																	ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t;
-																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST __t374 = _t;
+																	ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t;
 																	match(_t,UTIMES);
 																	_t = _t->getFirstChild();
 																	var1=out(_t);
 																	_t = _retTree;
-																	_t = __t373;
+																	_t = __t374;
 																	_t = _t->getNextSibling();
 																	var2=out(_t);
 																	_t = _retTree;
-																	_t = __t372;
+																	_t = __t373;
 																	_t = _t->getNextSibling();
 																	if ( inputState->guessing==0 ) {
-#line 2314 "ncoGrammer.g"
+#line 2337 "ncoGrammer.g"
 																		
 																		var=ncap_var_var_inc(var1,var2, TIMES_ASSIGN ,true, bret,prs_arg);
 																		
-#line 2250 "ncoTree.cpp"
+#line 2282 "ncoTree.cpp"
 																	}
 																}
 																else {
-																	bool synPredMatched377 = false;
+																	bool synPredMatched378 = false;
 																	if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																		_t = ASTNULL;
 																	if (((_t->getType() == TIMES_ASSIGN))) {
-																		ANTLR_USE_NAMESPACE(antlr)RefAST __t377 = _t;
-																		synPredMatched377 = true;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST __t378 = _t;
+																		synPredMatched378 = true;
 																		inputState->guessing++;
 																		try {
 																			{
-																			ANTLR_USE_NAMESPACE(antlr)RefAST __t375 = _t;
-																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST __t376 = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t;
 																			match(_t,TIMES_ASSIGN);
 																			_t = _t->getFirstChild();
-																			ANTLR_USE_NAMESPACE(antlr)RefAST __t376 = _t;
-																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST __t377 = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t;
 																			match(_t,UTIMES);
 																			_t = _t->getFirstChild();
-																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t;
 																			match(_t,ATT_ID);
 																			_t = _t->getNextSibling();
-																			_t = __t376;
+																			_t = __t377;
 																			_t = _t->getNextSibling();
 																			var2=out(_t);
 																			_t = _retTree;
-																			_t = __t375;
+																			_t = __t376;
 																			_t = _t->getNextSibling();
 																			}
 																		}
 																		catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																			synPredMatched377 = false;
+																			synPredMatched378 = false;
 																		}
-																		_t = __t377;
+																		_t = __t378;
 																		inputState->guessing--;
 																	}
-																	if ( synPredMatched377 ) {
-																		ANTLR_USE_NAMESPACE(antlr)RefAST __t378 = _t;
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t;
+																	if ( synPredMatched378 ) {
+																		ANTLR_USE_NAMESPACE(antlr)RefAST __t379 = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t;
 																		match(_t,TIMES_ASSIGN);
 																		_t = _t->getFirstChild();
-																		ANTLR_USE_NAMESPACE(antlr)RefAST __t379 = _t;
-																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST __t380 = _t;
+																		ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t;
 																		match(_t,UTIMES);
 																		_t = _t->getFirstChild();
 																		attm = _t;
 																		match(_t,ATT_ID);
 																		_t = _t->getNextSibling();
-																		_t = __t379;
+																		_t = __t380;
 																		_t = _t->getNextSibling();
 																		var2=out(_t);
 																		_t = _retTree;
-																		_t = __t378;
+																		_t = __t379;
 																		_t = _t->getNextSibling();
 																		if ( inputState->guessing==0 ) {
-#line 2318 "ncoGrammer.g"
+#line 2341 "ncoGrammer.g"
 																			
 																			var1=out(att2var(attm));     
 																			var=ncap_var_var_inc(var1,var2, TIMES_ASSIGN ,false, bret,prs_arg);
 																			
-#line 2312 "ncoTree.cpp"
+#line 2344 "ncoTree.cpp"
 																		}
 																	}
 																	else {
-																		bool synPredMatched383 = false;
+																		bool synPredMatched384 = false;
 																		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																			_t = ASTNULL;
 																		if (((_t->getType() == DIVIDE_ASSIGN))) {
-																			ANTLR_USE_NAMESPACE(antlr)RefAST __t383 = _t;
-																			synPredMatched383 = true;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST __t384 = _t;
+																			synPredMatched384 = true;
 																			inputState->guessing++;
 																			try {
 																				{
-																				ANTLR_USE_NAMESPACE(antlr)RefAST __t381 = _t;
-																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST __t382 = _t;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t;
 																				match(_t,DIVIDE_ASSIGN);
 																				_t = _t->getFirstChild();
 																				{
@@ -2331,14 +2363,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																				switch ( _t->getType()) {
 																				case VAR_ID:
 																				{
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t;
 																					match(_t,VAR_ID);
 																					_t = _t->getNextSibling();
 																					break;
 																				}
 																				case ATT_ID:
 																				{
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t;
 																					match(_t,ATT_ID);
 																					_t = _t->getNextSibling();
 																					break;
@@ -2351,169 +2383,169 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																				}
 																				var2=out(_t);
 																				_t = _retTree;
-																				_t = __t381;
+																				_t = __t382;
 																				_t = _t->getNextSibling();
 																				}
 																			}
 																			catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																				synPredMatched383 = false;
+																				synPredMatched384 = false;
 																			}
-																			_t = __t383;
+																			_t = __t384;
 																			inputState->guessing--;
 																		}
-																		if ( synPredMatched383 ) {
-																			ANTLR_USE_NAMESPACE(antlr)RefAST __t384 = _t;
-																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t;
+																		if ( synPredMatched384 ) {
+																			ANTLR_USE_NAMESPACE(antlr)RefAST __t385 = _t;
+																			ANTLR_USE_NAMESPACE(antlr)RefAST tmp222_AST_in = _t;
 																			match(_t,DIVIDE_ASSIGN);
 																			_t = _t->getFirstChild();
 																			var1=out(_t);
 																			_t = _retTree;
 																			var2=out(_t);
 																			_t = _retTree;
-																			_t = __t384;
+																			_t = __t385;
 																			_t = _t->getNextSibling();
 																			if ( inputState->guessing==0 ) {
-#line 2323 "ncoGrammer.g"
+#line 2346 "ncoGrammer.g"
 																				
 																				var=ncap_var_var_inc(var1,var2, DIVIDE_ASSIGN ,false, bret,prs_arg);
 																				
-#line 2381 "ncoTree.cpp"
+#line 2413 "ncoTree.cpp"
 																			}
 																		}
 																		else {
-																			bool synPredMatched388 = false;
+																			bool synPredMatched389 = false;
 																			if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																				_t = ASTNULL;
 																			if (((_t->getType() == DIVIDE_ASSIGN))) {
-																				ANTLR_USE_NAMESPACE(antlr)RefAST __t388 = _t;
-																				synPredMatched388 = true;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST __t389 = _t;
+																				synPredMatched389 = true;
 																				inputState->guessing++;
 																				try {
 																					{
-																					ANTLR_USE_NAMESPACE(antlr)RefAST __t386 = _t;
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST __t387 = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp223_AST_in = _t;
 																					match(_t,DIVIDE_ASSIGN);
 																					_t = _t->getFirstChild();
-																					ANTLR_USE_NAMESPACE(antlr)RefAST __t387 = _t;
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST __t388 = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp224_AST_in = _t;
 																					match(_t,UTIMES);
 																					_t = _t->getFirstChild();
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp225_AST_in = _t;
 																					match(_t,VAR_ID);
 																					_t = _t->getNextSibling();
-																					_t = __t387;
+																					_t = __t388;
 																					_t = _t->getNextSibling();
 																					var2=out(_t);
 																					_t = _retTree;
-																					_t = __t386;
+																					_t = __t387;
 																					_t = _t->getNextSibling();
 																					}
 																				}
 																				catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																					synPredMatched388 = false;
+																					synPredMatched389 = false;
 																				}
-																				_t = __t388;
+																				_t = __t389;
 																				inputState->guessing--;
 																			}
-																			if ( synPredMatched388 ) {
-																				ANTLR_USE_NAMESPACE(antlr)RefAST __t389 = _t;
-																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t;
+																			if ( synPredMatched389 ) {
+																				ANTLR_USE_NAMESPACE(antlr)RefAST __t390 = _t;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp226_AST_in = _t;
 																				match(_t,DIVIDE_ASSIGN);
 																				_t = _t->getFirstChild();
-																				ANTLR_USE_NAMESPACE(antlr)RefAST __t390 = _t;
-																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp222_AST_in = _t;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST __t391 = _t;
+																				ANTLR_USE_NAMESPACE(antlr)RefAST tmp227_AST_in = _t;
 																				match(_t,UTIMES);
 																				_t = _t->getFirstChild();
 																				var1=out(_t);
 																				_t = _retTree;
-																				_t = __t390;
+																				_t = __t391;
 																				_t = _t->getNextSibling();
 																				var2=out(_t);
 																				_t = _retTree;
-																				_t = __t389;
+																				_t = __t390;
 																				_t = _t->getNextSibling();
 																				if ( inputState->guessing==0 ) {
-#line 2327 "ncoGrammer.g"
+#line 2350 "ncoGrammer.g"
 																					
 																					var=ncap_var_var_inc(var1,var2, DIVIDE_ASSIGN ,true, bret,prs_arg);
 																					
-#line 2441 "ncoTree.cpp"
+#line 2473 "ncoTree.cpp"
 																				}
 																			}
 																			else {
-																				bool synPredMatched394 = false;
+																				bool synPredMatched395 = false;
 																				if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																					_t = ASTNULL;
 																				if (((_t->getType() == DIVIDE_ASSIGN))) {
-																					ANTLR_USE_NAMESPACE(antlr)RefAST __t394 = _t;
-																					synPredMatched394 = true;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST __t395 = _t;
+																					synPredMatched395 = true;
 																					inputState->guessing++;
 																					try {
 																						{
-																						ANTLR_USE_NAMESPACE(antlr)RefAST __t392 = _t;
-																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp223_AST_in = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST __t393 = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp228_AST_in = _t;
 																						match(_t,DIVIDE_ASSIGN);
 																						_t = _t->getFirstChild();
-																						ANTLR_USE_NAMESPACE(antlr)RefAST __t393 = _t;
-																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp224_AST_in = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST __t394 = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp229_AST_in = _t;
 																						match(_t,UTIMES);
 																						_t = _t->getFirstChild();
-																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp225_AST_in = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp230_AST_in = _t;
 																						match(_t,ATT_ID);
 																						_t = _t->getNextSibling();
-																						_t = __t393;
+																						_t = __t394;
 																						_t = _t->getNextSibling();
 																						var2=out(_t);
 																						_t = _retTree;
-																						_t = __t392;
+																						_t = __t393;
 																						_t = _t->getNextSibling();
 																						}
 																					}
 																					catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																						synPredMatched394 = false;
+																						synPredMatched395 = false;
 																					}
-																					_t = __t394;
+																					_t = __t395;
 																					inputState->guessing--;
 																				}
-																				if ( synPredMatched394 ) {
-																					ANTLR_USE_NAMESPACE(antlr)RefAST __t395 = _t;
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp226_AST_in = _t;
+																				if ( synPredMatched395 ) {
+																					ANTLR_USE_NAMESPACE(antlr)RefAST __t396 = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp231_AST_in = _t;
 																					match(_t,DIVIDE_ASSIGN);
 																					_t = _t->getFirstChild();
-																					ANTLR_USE_NAMESPACE(antlr)RefAST __t396 = _t;
-																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp227_AST_in = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST __t397 = _t;
+																					ANTLR_USE_NAMESPACE(antlr)RefAST tmp232_AST_in = _t;
 																					match(_t,UTIMES);
 																					_t = _t->getFirstChild();
 																					atd = _t;
 																					match(_t,ATT_ID);
 																					_t = _t->getNextSibling();
-																					_t = __t396;
+																					_t = __t397;
 																					_t = _t->getNextSibling();
 																					var2=out(_t);
 																					_t = _retTree;
-																					_t = __t395;
+																					_t = __t396;
 																					_t = _t->getNextSibling();
 																					if ( inputState->guessing==0 ) {
-#line 2331 "ncoGrammer.g"
+#line 2354 "ncoGrammer.g"
 																						
 																						var1=out(att2var(atd));        
 																						var=ncap_var_var_inc(var1,var2, DIVIDE_ASSIGN ,false, bret,prs_arg);
 																						
-#line 2503 "ncoTree.cpp"
+#line 2535 "ncoTree.cpp"
 																					}
 																				}
 																				else {
-																					bool synPredMatched400 = false;
+																					bool synPredMatched401 = false;
 																					if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																						_t = ASTNULL;
 																					if (((_t->getType() == ASSIGN))) {
-																						ANTLR_USE_NAMESPACE(antlr)RefAST __t400 = _t;
-																						synPredMatched400 = true;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST __t401 = _t;
+																						synPredMatched401 = true;
 																						inputState->guessing++;
 																						try {
 																							{
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t398 = _t;
-																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp228_AST_in = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t399 = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp233_AST_in = _t;
 																							match(_t,ASSIGN);
 																							_t = _t->getFirstChild();
 																							{
@@ -2522,14 +2554,14 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																							switch ( _t->getType()) {
 																							case VAR_ID:
 																							{
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp229_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp234_AST_in = _t;
 																								match(_t,VAR_ID);
 																								_t = _t->getNextSibling();
 																								break;
 																							}
 																							case ATT_ID:
 																							{
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp230_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp235_AST_in = _t;
 																								match(_t,ATT_ID);
 																								_t = _t->getNextSibling();
 																								break;
@@ -2540,88 +2572,88 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																							}
 																							}
 																							}
-																							_t = __t398;
+																							_t = __t399;
 																							_t = _t->getNextSibling();
 																							}
 																						}
 																						catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																							synPredMatched400 = false;
+																							synPredMatched401 = false;
 																						}
-																						_t = __t400;
+																						_t = __t401;
 																						inputState->guessing--;
 																					}
-																					if ( synPredMatched400 ) {
-																						ANTLR_USE_NAMESPACE(antlr)RefAST __t401 = _t;
-																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp231_AST_in = _t;
+																					if ( synPredMatched401 ) {
+																						ANTLR_USE_NAMESPACE(antlr)RefAST __t402 = _t;
+																						ANTLR_USE_NAMESPACE(antlr)RefAST tmp236_AST_in = _t;
 																						match(_t,ASSIGN);
 																						_t = _t->getFirstChild();
 																						asn = _t;
 																						if ( _t == ANTLR_USE_NAMESPACE(antlr)nullAST ) throw ANTLR_USE_NAMESPACE(antlr)MismatchedTokenException();
 																						_t = _t->getNextSibling();
-																						_t = __t401;
+																						_t = __t402;
 																						_t = _t->getNextSibling();
 																						if ( inputState->guessing==0 ) {
-#line 2337 "ncoGrammer.g"
+#line 2360 "ncoGrammer.g"
 																							
 																							if(prs_arg->ntl_scn)
 																							var=assign_ntl(asn,false,bret); 
 																							else
 																							var=assign(asn,false,bret);
 																							
-#line 2572 "ncoTree.cpp"
+#line 2604 "ncoTree.cpp"
 																						}
 																					}
 																					else {
-																						bool synPredMatched405 = false;
+																						bool synPredMatched406 = false;
 																						if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																							_t = ASTNULL;
 																						if (((_t->getType() == ASSIGN))) {
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t405 = _t;
-																							synPredMatched405 = true;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t406 = _t;
+																							synPredMatched406 = true;
 																							inputState->guessing++;
 																							try {
 																								{
-																								ANTLR_USE_NAMESPACE(antlr)RefAST __t403 = _t;
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp232_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST __t404 = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp237_AST_in = _t;
 																								match(_t,ASSIGN);
 																								_t = _t->getFirstChild();
-																								ANTLR_USE_NAMESPACE(antlr)RefAST __t404 = _t;
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp233_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST __t405 = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp238_AST_in = _t;
 																								match(_t,UTIMES);
 																								_t = _t->getFirstChild();
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp234_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp239_AST_in = _t;
 																								match(_t,ATT_ID);
 																								_t = _t->getNextSibling();
-																								_t = __t404;
+																								_t = __t405;
 																								_t = _t->getNextSibling();
-																								_t = __t403;
+																								_t = __t404;
 																								_t = _t->getNextSibling();
 																								}
 																							}
 																							catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																								synPredMatched405 = false;
+																								synPredMatched406 = false;
 																							}
-																							_t = __t405;
+																							_t = __t406;
 																							inputState->guessing--;
 																						}
-																						if ( synPredMatched405 ) {
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t406 = _t;
-																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp235_AST_in = _t;
+																						if ( synPredMatched406 ) {
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t407 = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp240_AST_in = _t;
 																							match(_t,ASSIGN);
 																							_t = _t->getFirstChild();
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t407 = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t408 = _t;
 																							atta = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 																							match(_t,UTIMES);
 																							_t = _t->getFirstChild();
-																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp236_AST_in = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp241_AST_in = _t;
 																							match(_t,ATT_ID);
 																							_t = _t->getNextSibling();
-																							_t = __t407;
+																							_t = __t408;
 																							_t = _t->getNextSibling();
-																							_t = __t406;
+																							_t = __t407;
 																							_t = _t->getNextSibling();
 																							if ( inputState->guessing==0 ) {
-#line 2345 "ncoGrammer.g"
+#line 2368 "ncoGrammer.g"
 																								
 																								
 																								RefAST tr;
@@ -2636,15 +2668,15 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																								else
 																								var=assign(tr,false,bret);
 																								
-#line 2640 "ncoTree.cpp"
+#line 2672 "ncoTree.cpp"
 																							}
 																						}
 																						else if ((_t->getType() == ASSIGN)) {
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t408 = _t;
-																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp237_AST_in = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t409 = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST tmp242_AST_in = _t;
 																							match(_t,ASSIGN);
 																							_t = _t->getFirstChild();
-																							ANTLR_USE_NAMESPACE(antlr)RefAST __t409 = _t;
+																							ANTLR_USE_NAMESPACE(antlr)RefAST __t410 = _t;
 																							asn2 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 																							match(_t,UTIMES);
 																							_t = _t->getFirstChild();
@@ -2654,21 +2686,21 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																							switch ( _t->getType()) {
 																							case VAR_ID:
 																							{
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp238_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp243_AST_in = _t;
 																								match(_t,VAR_ID);
 																								_t = _t->getNextSibling();
 																								break;
 																							}
 																							case UTIMES:
 																							{
-																								ANTLR_USE_NAMESPACE(antlr)RefAST __t411 = _t;
-																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp239_AST_in = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST __t412 = _t;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST tmp244_AST_in = _t;
 																								match(_t,UTIMES);
 																								_t = _t->getFirstChild();
 																								asn2a = _t;
 																								match(_t,ATT_ID);
 																								_t = _t->getNextSibling();
-																								_t = __t411;
+																								_t = __t412;
 																								_t = _t->getNextSibling();
 																								break;
 																							}
@@ -2678,12 +2710,12 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																							}
 																							}
 																							}
-																							_t = __t409;
+																							_t = __t410;
 																							_t = _t->getNextSibling();
-																							_t = __t408;
+																							_t = __t409;
 																							_t = _t->getNextSibling();
 																							if ( inputState->guessing==0 ) {
-#line 2361 "ncoGrammer.g"
+#line 2384 "ncoGrammer.g"
 																								
 																								// Check for RAM variable - if present 
 																								// change tree - for example from:
@@ -2727,48 +2759,48 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																								var=assign(tr, true,bret);
 																								
 																								
-#line 2731 "ncoTree.cpp"
+#line 2763 "ncoTree.cpp"
 																							}
 																						}
 																						else {
-																							bool synPredMatched419 = false;
+																							bool synPredMatched420 = false;
 																							if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																								_t = ASTNULL;
 																							if (((_t->getType() == VAR_ID))) {
-																								ANTLR_USE_NAMESPACE(antlr)RefAST __t419 = _t;
-																								synPredMatched419 = true;
+																								ANTLR_USE_NAMESPACE(antlr)RefAST __t420 = _t;
+																								synPredMatched420 = true;
 																								inputState->guessing++;
 																								try {
 																									{
-																									ANTLR_USE_NAMESPACE(antlr)RefAST __t418 = _t;
-																									ANTLR_USE_NAMESPACE(antlr)RefAST tmp240_AST_in = _t;
+																									ANTLR_USE_NAMESPACE(antlr)RefAST __t419 = _t;
+																									ANTLR_USE_NAMESPACE(antlr)RefAST tmp245_AST_in = _t;
 																									match(_t,VAR_ID);
 																									_t = _t->getFirstChild();
-																									ANTLR_USE_NAMESPACE(antlr)RefAST tmp241_AST_in = _t;
+																									ANTLR_USE_NAMESPACE(antlr)RefAST tmp246_AST_in = _t;
 																									match(_t,LMT_LIST);
 																									_t = _t->getNextSibling();
-																									_t = __t418;
+																									_t = __t419;
 																									_t = _t->getNextSibling();
 																									}
 																								}
 																								catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																									synPredMatched419 = false;
+																									synPredMatched420 = false;
 																								}
-																								_t = __t419;
+																								_t = __t420;
 																								inputState->guessing--;
 																							}
-																							if ( synPredMatched419 ) {
-																								ANTLR_USE_NAMESPACE(antlr)RefAST __t420 = _t;
+																							if ( synPredMatched420 ) {
+																								ANTLR_USE_NAMESPACE(antlr)RefAST __t421 = _t;
 																								vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 																								match(_t,VAR_ID);
 																								_t = _t->getFirstChild();
 																								lmt = _t;
 																								match(_t,LMT_LIST);
 																								_t = _t->getNextSibling();
-																								_t = __t420;
+																								_t = __t421;
 																								_t = _t->getNextSibling();
 																								if ( inputState->guessing==0 ) {
-#line 2498 "ncoGrammer.g"
+#line 2521 "ncoGrammer.g"
 																									
 																											
 																											    // fxm: 4 Oct 2015
@@ -2795,48 +2827,48 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																									
 																									
 																									
-#line 2799 "ncoTree.cpp"
+#line 2831 "ncoTree.cpp"
 																								}
 																							}
 																							else {
-																								bool synPredMatched423 = false;
+																								bool synPredMatched424 = false;
 																								if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 																									_t = ASTNULL;
 																								if (((_t->getType() == ATT_ID))) {
-																									ANTLR_USE_NAMESPACE(antlr)RefAST __t423 = _t;
-																									synPredMatched423 = true;
+																									ANTLR_USE_NAMESPACE(antlr)RefAST __t424 = _t;
+																									synPredMatched424 = true;
 																									inputState->guessing++;
 																									try {
 																										{
-																										ANTLR_USE_NAMESPACE(antlr)RefAST __t422 = _t;
-																										ANTLR_USE_NAMESPACE(antlr)RefAST tmp242_AST_in = _t;
+																										ANTLR_USE_NAMESPACE(antlr)RefAST __t423 = _t;
+																										ANTLR_USE_NAMESPACE(antlr)RefAST tmp247_AST_in = _t;
 																										match(_t,ATT_ID);
 																										_t = _t->getFirstChild();
-																										ANTLR_USE_NAMESPACE(antlr)RefAST tmp243_AST_in = _t;
+																										ANTLR_USE_NAMESPACE(antlr)RefAST tmp248_AST_in = _t;
 																										match(_t,LMT_LIST);
 																										_t = _t->getNextSibling();
-																										_t = __t422;
+																										_t = __t423;
 																										_t = _t->getNextSibling();
 																										}
 																									}
 																									catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-																										synPredMatched423 = false;
+																										synPredMatched424 = false;
 																									}
-																									_t = __t423;
+																									_t = __t424;
 																									inputState->guessing--;
 																								}
-																								if ( synPredMatched423 ) {
-																									ANTLR_USE_NAMESPACE(antlr)RefAST __t424 = _t;
+																								if ( synPredMatched424 ) {
+																									ANTLR_USE_NAMESPACE(antlr)RefAST __t425 = _t;
 																									attl = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 																									match(_t,ATT_ID);
 																									_t = _t->getFirstChild();
 																									lmtl = _t;
 																									match(_t,LMT_LIST);
 																									_t = _t->getNextSibling();
-																									_t = __t424;
+																									_t = __t425;
 																									_t = _t->getNextSibling();
 																									if ( inputState->guessing==0 ) {
-#line 2526 "ncoGrammer.g"
+#line 2549 "ncoGrammer.g"
 																										
 																										
 																										std::string att_nm=attl->getText();
@@ -2938,7 +2970,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																										
 																										attl_end: ; 
 																										
-#line 2942 "ncoTree.cpp"
+#line 2974 "ncoTree.cpp"
 																									}
 																								}
 																								else if ((_t->getType() == VAR_ID)) {
@@ -2946,7 +2978,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																									match(_t,VAR_ID);
 																									_t = _t->getNextSibling();
 																									if ( inputState->guessing==0 ) {
-#line 2632 "ncoGrammer.g"
+#line 2655 "ncoGrammer.g"
 																										
 																										//dbg_prn(fnc_nm,"getting regular var in out "+v->getText());
 																										
@@ -2977,7 +3009,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																										
 																										
 																										
-#line 2981 "ncoTree.cpp"
+#line 3013 "ncoTree.cpp"
 																									}
 																								}
 																								else if ((_t->getType() == ATT_ID)) {
@@ -2985,7 +3017,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																									match(_t,ATT_ID);
 																									_t = _t->getNextSibling();
 																									if ( inputState->guessing==0 ) {
-#line 2664 "ncoGrammer.g"
+#line 2687 "ncoGrammer.g"
 																										
 																										
 																										var=att_plain(att);  
@@ -3018,7 +3050,7 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 																										*/
 																										
 																										
-#line 3022 "ncoTree.cpp"
+#line 3054 "ncoTree.cpp"
 																									}
 																								}
 		else {
@@ -3042,9 +3074,9 @@ var_sct * ncoTree::out(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram,bool bret
 ) {
-#line 1419 "ncoGrammer.g"
+#line 1442 "ncoGrammer.g"
 	var_sct *var;
-#line 3048 "ncoTree.cpp"
+#line 3080 "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;
@@ -3054,52 +3086,52 @@ 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 1419 "ncoGrammer.g"
+#line 1442 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign_ntl"); 
 	var=NULL_CEWI;
 	
-#line 3063 "ncoTree.cpp"
+#line 3095 "ncoTree.cpp"
 	
 	try {      // for error handling
-		bool synPredMatched242 = false;
+		bool synPredMatched243 = false;
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 			_t = ASTNULL;
 		if (((_t->getType() == VAR_ID))) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t242 = _t;
-			synPredMatched242 = true;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t243 = _t;
+			synPredMatched243 = true;
 			inputState->guessing++;
 			try {
 				{
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t241 = _t;
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp244_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t242 = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp249_AST_in = _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp245_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp250_AST_in = _t;
 				match(_t,LMT_LIST);
 				_t = _t->getNextSibling();
-				_t = __t241;
+				_t = __t242;
 				_t = _t->getNextSibling();
 				}
 			}
 			catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-				synPredMatched242 = false;
+				synPredMatched243 = false;
 			}
-			_t = __t242;
+			_t = __t243;
 			inputState->guessing--;
 		}
-		if ( synPredMatched242 ) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t243 = _t;
+		if ( synPredMatched243 ) {
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t244 = _t;
 			vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 			match(_t,VAR_ID);
 			_t = _t->getFirstChild();
 			lmt = _t;
 			match(_t,LMT_LIST);
 			_t = _t->getNextSibling();
-			_t = __t243;
+			_t = __t244;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1424 "ncoGrammer.g"
+#line 1447 "ncoGrammer.g"
 				
 				
 				std::string var_nm; 
@@ -3131,21 +3163,21 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				(void)prs_arg->int_vtr.push_ow(Nvar);
 				}
 				
-#line 3135 "ncoTree.cpp"
+#line 3167 "ncoTree.cpp"
 			}
 		}
 		else {
-			bool synPredMatched247 = false;
+			bool synPredMatched248 = false;
 			if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 				_t = ASTNULL;
 			if (((_t->getType() == VAR_ID))) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t247 = _t;
-				synPredMatched247 = true;
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t248 = _t;
+				synPredMatched248 = true;
 				inputState->guessing++;
 				try {
 					{
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t245 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp246_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t246 = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp251_AST_in = _t;
 					match(_t,VAR_ID);
 					_t = _t->getFirstChild();
 					{
@@ -3154,14 +3186,14 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					switch ( _t->getType()) {
 					case DMN_LIST:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp247_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp252_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						break;
 					}
 					case DMN_LIST_P:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp248_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp253_AST_in = _t;
 						match(_t,DMN_LIST_P);
 						_t = _t->getNextSibling();
 						break;
@@ -3172,28 +3204,28 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					}
 					}
 					}
-					_t = __t245;
+					_t = __t246;
 					_t = _t->getNextSibling();
 					}
 				}
 				catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-					synPredMatched247 = false;
+					synPredMatched248 = false;
 				}
-				_t = __t247;
+				_t = __t248;
 				inputState->guessing--;
 			}
-			if ( synPredMatched247 ) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t248 = _t;
+			if ( synPredMatched248 ) {
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t249 = _t;
 				vid1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
 				dmn = _t;
 				if ( _t == ANTLR_USE_NAMESPACE(antlr)nullAST ) throw ANTLR_USE_NAMESPACE(antlr)MismatchedTokenException();
 				_t = _t->getNextSibling();
-				_t = __t248;
+				_t = __t249;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1456 "ncoGrammer.g"
+#line 1479 "ncoGrammer.g"
 					
 					
 					int idx;
@@ -3269,7 +3301,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					
 					bcst=false;   
 					
-#line 3273 "ncoTree.cpp"
+#line 3305 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -3277,7 +3309,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				match(_t,VAR_ID);
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1532 "ncoGrammer.g"
+#line 1555 "ncoGrammer.g"
 					
 					
 					var_sct *var_rhs;
@@ -3309,48 +3341,48 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					
 					
 					
-#line 3313 "ncoTree.cpp"
+#line 3345 "ncoTree.cpp"
 				}
 			}
 			else {
-				bool synPredMatched251 = false;
+				bool synPredMatched252 = false;
 				if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 					_t = ASTNULL;
 				if (((_t->getType() == ATT_ID))) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t251 = _t;
-					synPredMatched251 = true;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t252 = _t;
+					synPredMatched252 = true;
 					inputState->guessing++;
 					try {
 						{
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t250 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp249_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t251 = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp254_AST_in = _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp250_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp255_AST_in = _t;
 						match(_t,LMT_LIST);
 						_t = _t->getNextSibling();
-						_t = __t250;
+						_t = __t251;
 						_t = _t->getNextSibling();
 						}
 					}
 					catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-						synPredMatched251 = false;
+						synPredMatched252 = false;
 					}
-					_t = __t251;
+					_t = __t252;
 					inputState->guessing--;
 				}
-				if ( synPredMatched251 ) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t252 = _t;
+				if ( synPredMatched252 ) {
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t253 = _t;
 					att = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 					match(_t,ATT_ID);
 					_t = _t->getFirstChild();
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp251_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp256_AST_in = _t;
 					match(_t,LMT_LIST);
 					_t = _t->getNextSibling();
-					_t = __t252;
+					_t = __t253;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1564 "ncoGrammer.g"
+#line 1587 "ncoGrammer.g"
 						
 						
 						//In Initial scan all newly defined atts are flagged as Undefined
@@ -3371,52 +3403,52 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						var=(var_sct*)NULL; 
 						
 						
-#line 3375 "ncoTree.cpp"
+#line 3407 "ncoTree.cpp"
 					}
 				}
 				else {
-					bool synPredMatched255 = false;
+					bool synPredMatched256 = false;
 					if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 						_t = ASTNULL;
 					if (((_t->getType() == ATT_ID))) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t255 = _t;
-						synPredMatched255 = true;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t256 = _t;
+						synPredMatched256 = true;
 						inputState->guessing++;
 						try {
 							{
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t254 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp252_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t255 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp257_AST_in = _t;
 							match(_t,ATT_ID);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp253_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp258_AST_in = _t;
 							match(_t,LMT_DMN);
 							_t = _t->getNextSibling();
-							_t = __t254;
+							_t = __t255;
 							_t = _t->getNextSibling();
 							}
 						}
 						catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-							synPredMatched255 = false;
+							synPredMatched256 = false;
 						}
-						_t = __t255;
+						_t = __t256;
 						inputState->guessing--;
 					}
-					if ( synPredMatched255 ) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t256 = _t;
+					if ( synPredMatched256 ) {
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t257 = _t;
 						att1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp254_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp259_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
-						_t = __t256;
+						_t = __t257;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1585 "ncoGrammer.g"
+#line 1608 "ncoGrammer.g"
 							
 							;
 							
-#line 3420 "ncoTree.cpp"
+#line 3452 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -3424,7 +3456,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 1588 "ncoGrammer.g"
+#line 1611 "ncoGrammer.g"
 							
 							
 							//In Initial scan all newly defined atts are flagged as Undefined
@@ -3445,7 +3477,7 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							var=(var_sct*)NULL;    
 							
 							
-#line 3449 "ncoTree.cpp"
+#line 3481 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -3469,9 +3501,9 @@ var_sct * ncoTree::assign_ntl(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram,bool bret
 ) {
-#line 1611 "ncoGrammer.g"
+#line 1634 "ncoGrammer.g"
 	var_sct *var;
-#line 3475 "ncoTree.cpp"
+#line 3507 "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;
@@ -3482,52 +3514,52 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	ANTLR_USE_NAMESPACE(antlr)RefAST lmta = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 1611 "ncoGrammer.g"
+#line 1634 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign"); 
 	var=NULL_CEWI;
 	
-#line 3491 "ncoTree.cpp"
+#line 3523 "ncoTree.cpp"
 	
 	try {      // for error handling
-		bool synPredMatched260 = false;
+		bool synPredMatched261 = false;
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 			_t = ASTNULL;
 		if (((_t->getType() == VAR_ID))) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t260 = _t;
-			synPredMatched260 = true;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t261 = _t;
+			synPredMatched261 = true;
 			inputState->guessing++;
 			try {
 				{
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t259 = _t;
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp255_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t260 = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp260_AST_in = _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
-				ANTLR_USE_NAMESPACE(antlr)RefAST tmp256_AST_in = _t;
+				ANTLR_USE_NAMESPACE(antlr)RefAST tmp261_AST_in = _t;
 				match(_t,LMT_LIST);
 				_t = _t->getNextSibling();
-				_t = __t259;
+				_t = __t260;
 				_t = _t->getNextSibling();
 				}
 			}
 			catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-				synPredMatched260 = false;
+				synPredMatched261 = false;
 			}
-			_t = __t260;
+			_t = __t261;
 			inputState->guessing--;
 		}
-		if ( synPredMatched260 ) {
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t261 = _t;
+		if ( synPredMatched261 ) {
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t262 = _t;
 			vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 			match(_t,VAR_ID);
 			_t = _t->getFirstChild();
 			lmt = _t;
 			match(_t,LMT_LIST);
 			_t = _t->getNextSibling();
-			_t = __t261;
+			_t = __t262;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 1617 "ncoGrammer.g"
+#line 1640 "ncoGrammer.g"
 				
 				
 				int idx;
@@ -3724,21 +3756,21 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				
 				
 				
-#line 3728 "ncoTree.cpp"
+#line 3760 "ncoTree.cpp"
 			}
 		}
 		else {
-			bool synPredMatched265 = false;
+			bool synPredMatched266 = false;
 			if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 				_t = ASTNULL;
 			if (((_t->getType() == VAR_ID))) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t265 = _t;
-				synPredMatched265 = true;
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t266 = _t;
+				synPredMatched266 = true;
 				inputState->guessing++;
 				try {
 					{
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t263 = _t;
-					ANTLR_USE_NAMESPACE(antlr)RefAST tmp257_AST_in = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t264 = _t;
+					ANTLR_USE_NAMESPACE(antlr)RefAST tmp262_AST_in = _t;
 					match(_t,VAR_ID);
 					_t = _t->getFirstChild();
 					{
@@ -3747,14 +3779,14 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					switch ( _t->getType()) {
 					case DMN_LIST:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp258_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp263_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
 						break;
 					}
 					case DMN_LIST_P:
 					{
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp259_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp264_AST_in = _t;
 						match(_t,DMN_LIST_P);
 						_t = _t->getNextSibling();
 						break;
@@ -3765,28 +3797,28 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					}
 					}
 					}
-					_t = __t263;
+					_t = __t264;
 					_t = _t->getNextSibling();
 					}
 				}
 				catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-					synPredMatched265 = false;
+					synPredMatched266 = false;
 				}
-				_t = __t265;
+				_t = __t266;
 				inputState->guessing--;
 			}
-			if ( synPredMatched265 ) {
-				ANTLR_USE_NAMESPACE(antlr)RefAST __t266 = _t;
+			if ( synPredMatched266 ) {
+				ANTLR_USE_NAMESPACE(antlr)RefAST __t267 = _t;
 				vid1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 				match(_t,VAR_ID);
 				_t = _t->getFirstChild();
 				dmn = _t;
 				if ( _t == ANTLR_USE_NAMESPACE(antlr)nullAST ) throw ANTLR_USE_NAMESPACE(antlr)MismatchedTokenException();
 				_t = _t->getNextSibling();
-				_t = __t266;
+				_t = __t267;
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1815 "ncoGrammer.g"
+#line 1838 "ncoGrammer.g"
 					
 					
 					var_sct *var1;
@@ -3884,7 +3916,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					var_cst=nco_var_free(var_cst); 
 					
 					
-#line 3888 "ncoTree.cpp"
+#line 3920 "ncoTree.cpp"
 				}
 			}
 			else if ((_t->getType() == VAR_ID)) {
@@ -3892,7 +3924,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 				match(_t,VAR_ID);
 				_t = _t->getNextSibling();
 				if ( inputState->guessing==0 ) {
-#line 1913 "ncoGrammer.g"
+#line 1936 "ncoGrammer.g"
 					
 					
 					// Set class wide variables
@@ -3964,48 +3996,48 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 					
 					
 					
-#line 3968 "ncoTree.cpp"
+#line 4000 "ncoTree.cpp"
 				}
 			}
 			else {
-				bool synPredMatched269 = false;
+				bool synPredMatched270 = false;
 				if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 					_t = ASTNULL;
 				if (((_t->getType() == ATT_ID))) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t269 = _t;
-					synPredMatched269 = true;
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t270 = _t;
+					synPredMatched270 = true;
 					inputState->guessing++;
 					try {
 						{
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t268 = _t;
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp260_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t269 = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp265_AST_in = _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp261_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp266_AST_in = _t;
 						match(_t,LMT_LIST);
 						_t = _t->getNextSibling();
-						_t = __t268;
+						_t = __t269;
 						_t = _t->getNextSibling();
 						}
 					}
 					catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-						synPredMatched269 = false;
+						synPredMatched270 = false;
 					}
-					_t = __t269;
+					_t = __t270;
 					inputState->guessing--;
 				}
-				if ( synPredMatched269 ) {
-					ANTLR_USE_NAMESPACE(antlr)RefAST __t270 = _t;
+				if ( synPredMatched270 ) {
+					ANTLR_USE_NAMESPACE(antlr)RefAST __t271 = _t;
 					att = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 					match(_t,ATT_ID);
 					_t = _t->getFirstChild();
 					lmta = _t;
 					match(_t,LMT_LIST);
 					_t = _t->getNextSibling();
-					_t = __t270;
+					_t = __t271;
 					_t = _t->getNextSibling();
 					if ( inputState->guessing==0 ) {
-#line 1985 "ncoGrammer.g"
+#line 2008 "ncoGrammer.g"
 						
 						
 						long srt,end,cnt,srd;  
@@ -4160,52 +4192,52 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						
 						
 						
-#line 4164 "ncoTree.cpp"
+#line 4196 "ncoTree.cpp"
 					}
 				}
 				else {
-					bool synPredMatched273 = false;
+					bool synPredMatched274 = false;
 					if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
 						_t = ASTNULL;
 					if (((_t->getType() == ATT_ID))) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t273 = _t;
-						synPredMatched273 = true;
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t274 = _t;
+						synPredMatched274 = true;
 						inputState->guessing++;
 						try {
 							{
-							ANTLR_USE_NAMESPACE(antlr)RefAST __t272 = _t;
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp262_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST __t273 = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp267_AST_in = _t;
 							match(_t,ATT_ID);
 							_t = _t->getFirstChild();
-							ANTLR_USE_NAMESPACE(antlr)RefAST tmp263_AST_in = _t;
+							ANTLR_USE_NAMESPACE(antlr)RefAST tmp268_AST_in = _t;
 							match(_t,DMN_LIST);
 							_t = _t->getNextSibling();
-							_t = __t272;
+							_t = __t273;
 							_t = _t->getNextSibling();
 							}
 						}
 						catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
-							synPredMatched273 = false;
+							synPredMatched274 = false;
 						}
-						_t = __t273;
+						_t = __t274;
 						inputState->guessing--;
 					}
-					if ( synPredMatched273 ) {
-						ANTLR_USE_NAMESPACE(antlr)RefAST __t274 = _t;
+					if ( synPredMatched274 ) {
+						ANTLR_USE_NAMESPACE(antlr)RefAST __t275 = _t;
 						att1 = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 						match(_t,ATT_ID);
 						_t = _t->getFirstChild();
-						ANTLR_USE_NAMESPACE(antlr)RefAST tmp264_AST_in = _t;
+						ANTLR_USE_NAMESPACE(antlr)RefAST tmp269_AST_in = _t;
 						match(_t,DMN_LIST);
 						_t = _t->getNextSibling();
-						_t = __t274;
+						_t = __t275;
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 2140 "ncoGrammer.g"
+#line 2163 "ncoGrammer.g"
 							
 							;
 							
-#line 4209 "ncoTree.cpp"
+#line 4241 "ncoTree.cpp"
 						}
 					}
 					else if ((_t->getType() == ATT_ID)) {
@@ -4213,7 +4245,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 						match(_t,ATT_ID);
 						_t = _t->getNextSibling();
 						if ( inputState->guessing==0 ) {
-#line 2143 "ncoGrammer.g"
+#line 2166 "ncoGrammer.g"
 							
 							
 							var_sct *var1;
@@ -4253,7 +4285,7 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 							
 							
 							
-#line 4257 "ncoTree.cpp"
+#line 4289 "ncoTree.cpp"
 						}
 					}
 		else {
@@ -4275,14 +4307,14 @@ var_sct * ncoTree::assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2797 "ncoGrammer.g"
+#line 2820 "ncoGrammer.g"
 	var_sct *var;
-#line 4281 "ncoTree.cpp"
+#line 4313 "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 2797 "ncoGrammer.g"
+#line 2820 "ncoGrammer.g"
 	
 	const std::string fnc_nm("assign_asn");
 	var=NULL_CEWI; 
@@ -4290,7 +4322,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	NcapVar *Nvar;
 	
 	
-#line 4294 "ncoTree.cpp"
+#line 4326 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
@@ -4298,17 +4330,17 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		switch ( _t->getType()) {
 		case UTIMES:
 		{
-			ANTLR_USE_NAMESPACE(antlr)RefAST __t426 = _t;
-			ANTLR_USE_NAMESPACE(antlr)RefAST tmp265_AST_in = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST __t427 = _t;
+			ANTLR_USE_NAMESPACE(antlr)RefAST tmp270_AST_in = _t;
 			match(_t,UTIMES);
 			_t = _t->getFirstChild();
 			vid1 = _t;
 			match(_t,VAR_ID);
 			_t = _t->getNextSibling();
-			_t = __t426;
+			_t = __t427;
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2807 "ncoGrammer.g"
+#line 2830 "ncoGrammer.g"
 				
 				if(vid1->getFirstChild())
 				err_prn(fnc_nm,"Invalid Lvalue " +vid1->getText() );
@@ -4326,7 +4358,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				
 				
-#line 4330 "ncoTree.cpp"
+#line 4362 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -4336,7 +4368,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,VAR_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2825 "ncoGrammer.g"
+#line 2848 "ncoGrammer.g"
 				
 				var_nm_s=vid->getText();  
 				if(vid->getFirstChild())
@@ -4357,7 +4389,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				}
 				
 				
-#line 4361 "ncoTree.cpp"
+#line 4393 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -4367,7 +4399,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			match(_t,ATT_ID);
 			_t = _t->getNextSibling();
 			if ( inputState->guessing==0 ) {
-#line 2846 "ncoGrammer.g"
+#line 2869 "ncoGrammer.g"
 				
 				// check "output"
 				NcapVar *Nvar=NULL;
@@ -4404,7 +4436,7 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 				
 				
 				
-#line 4408 "ncoTree.cpp"
+#line 4440 "ncoTree.cpp"
 			}
 			break;
 		}
@@ -4428,12 +4460,12 @@ var_sct * ncoTree::out_asn(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2886 "ncoGrammer.g"
+#line 2909 "ncoGrammer.g"
 	var_sct *var;
-#line 4434 "ncoTree.cpp"
+#line 4466 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST att_plain_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2886 "ncoGrammer.g"
+#line 2909 "ncoGrammer.g"
 	
 	const std::string fnc_nm("att_plain");
 	var=NULL_CEWI; 
@@ -4441,14 +4473,14 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	NcapVar *Nvar;
 	
 	
-#line 4445 "ncoTree.cpp"
+#line 4477 "ncoTree.cpp"
 	
 	try {      // for error handling
 		att = _t;
 		match(_t,ATT_ID);
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 2896 "ncoGrammer.g"
+#line 2919 "ncoGrammer.g"
 			
 			// check "output"
 			NcapVar *Nvar=NULL;
@@ -4479,7 +4511,7 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			var->val.vp=(void*)nco_free(var->val.vp);
 			
 			
-#line 4483 "ncoTree.cpp"
+#line 4515 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4496,12 +4528,12 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
  RefAST  ncoTree::att2var(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2933 "ncoGrammer.g"
+#line 2956 "ncoGrammer.g"
 	 RefAST tr ;
-#line 4502 "ncoTree.cpp"
+#line 4534 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST att2var_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 	ANTLR_USE_NAMESPACE(antlr)RefAST att = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 2933 "ncoGrammer.g"
+#line 2956 "ncoGrammer.g"
 	
 	var_sct *var=NULL_CEWI; 
 	NcapVar *Nvar;
@@ -4510,7 +4542,7 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 	std::string fnc_nm("att2var");
 	
 	
-#line 4514 "ncoTree.cpp"
+#line 4546 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -4519,7 +4551,7 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 2944 "ncoGrammer.g"
+#line 2967 "ncoGrammer.g"
 			
 			/* sn can be empty on 1st Parse but not 2nd */
 			att_nm=att->getText();
@@ -4548,7 +4580,7 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			tr->setText(sn);
 			
 			
-#line 4552 "ncoTree.cpp"
+#line 4584 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4565,17 +4597,17 @@ var_sct * ncoTree::att_plain(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 2977 "ncoGrammer.g"
+#line 3000 "ncoGrammer.g"
 	var_sct *var;
-#line 4571 "ncoTree.cpp"
+#line 4603 "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 2977 "ncoGrammer.g"
+#line 3000 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list");
 	var=NULL_CEWI; 
 	
-#line 4579 "ncoTree.cpp"
+#line 4611 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -4584,7 +4616,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 2982 "ncoGrammer.g"
+#line 3005 "ncoGrammer.g"
 			
 			char *cp;  
 			int nbr_lst;
@@ -4659,7 +4691,7 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			var=var_ret;
 			
 			
-#line 4663 "ncoTree.cpp"
+#line 4695 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4676,17 +4708,17 @@ var_sct * ncoTree::value_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3059 "ncoGrammer.g"
+#line 3082 "ncoGrammer.g"
 	var_sct *var;
-#line 4682 "ncoTree.cpp"
+#line 4714 "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;
 	ANTLR_USE_NAMESPACE(antlr)RefAST vlst = ANTLR_USE_NAMESPACE(antlr)nullAST;
-#line 3059 "ncoGrammer.g"
+#line 3082 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list");
 	var=NULL_CEWI; 
 	
-#line 4690 "ncoTree.cpp"
+#line 4722 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -4695,7 +4727,7 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 3064 "ncoGrammer.g"
+#line 3087 "ncoGrammer.g"
 			
 			
 			char *cp;
@@ -4753,7 +4785,7 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			
 			
-#line 4757 "ncoTree.cpp"
+#line 4789 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4770,17 +4802,17 @@ var_sct * ncoTree::value_list_string(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 }
 
 var_sct * ncoTree::value_list_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3125 "ncoGrammer.g"
+#line 3148 "ncoGrammer.g"
 	var_sct *var;
-#line 4776 "ncoTree.cpp"
+#line 4808 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST value_list_old_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 3125 "ncoGrammer.g"
+#line 3148 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list");
 	var=NULL_CEWI; 
 	
-#line 4784 "ncoTree.cpp"
+#line 4816 "ncoTree.cpp"
 	
 	try {      // for error handling
 		{
@@ -4789,7 +4821,7 @@ var_sct * ncoTree::value_list_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 		_t = _t->getNextSibling();
 		}
 		if ( inputState->guessing==0 ) {
-#line 3130 "ncoGrammer.g"
+#line 3153 "ncoGrammer.g"
 			
 			
 			char *cp;
@@ -4878,7 +4910,7 @@ var_sct * ncoTree::value_list_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			var=var_ret;
 			
 			
-#line 4882 "ncoTree.cpp"
+#line 4914 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4897,20 +4929,20 @@ var_sct * ncoTree::value_list_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::value_list_string_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	 std::vector<var_sct*> &exp_vtr
 ) {
-#line 3226 "ncoGrammer.g"
+#line 3249 "ncoGrammer.g"
 	var_sct *var;
-#line 4903 "ncoTree.cpp"
+#line 4935 "ncoTree.cpp"
 	ANTLR_USE_NAMESPACE(antlr)RefAST value_list_string_old_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
-#line 3226 "ncoGrammer.g"
+#line 3249 "ncoGrammer.g"
 	
 	const std::string fnc_nm("value_list_string");
 	var=NULL_CEWI; 
 	
-#line 4910 "ncoTree.cpp"
+#line 4942 "ncoTree.cpp"
 	
 	try {      // for error handling
 		if ( inputState->guessing==0 ) {
-#line 3232 "ncoGrammer.g"
+#line 3255 "ncoGrammer.g"
 			
 			int idx;
 			int nbr_lst;
@@ -4959,7 +4991,7 @@ var_sct * ncoTree::value_list_string_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			end_val: var=var_ret;
 			
 			
-#line 4963 "ncoTree.cpp"
+#line 4995 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -4978,26 +5010,26 @@ var_sct * ncoTree::value_list_string_old(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	var_sct *var_msk
 ) {
-#line 3283 "ncoGrammer.g"
+#line 3306 "ncoGrammer.g"
 	bool bret=false;
-#line 4984 "ncoTree.cpp"
+#line 5016 "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 3283 "ncoGrammer.g"
+#line 3306 "ncoGrammer.g"
 	
 	const std::string fnc_nm("where_assign");
 	var_sct *var_rhs;
 	
 	
-#line 4993 "ncoTree.cpp"
+#line 5025 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t438 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp266_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t439 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp271_AST_in = _t;
 		match(_t,EXPR);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t439 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp267_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t440 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp272_AST_in = _t;
 		match(_t,ASSIGN);
 		_t = _t->getFirstChild();
 		vid = _t;
@@ -5005,12 +5037,12 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 		_t = _t->getNextSibling();
 		var_rhs=out(_t);
 		_t = _retTree;
-		_t = __t439;
+		_t = __t440;
 		_t = _t->getNextSibling();
-		_t = __t438;
+		_t = __t439;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3289 "ncoGrammer.g"
+#line 3312 "ncoGrammer.g"
 			
 			
 			bool bfr=false;
@@ -5112,7 +5144,7 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 			prs_arg->ncap_var_write(var_lhs,false);
 			bret=true;
 			
-#line 5116 "ncoTree.cpp"
+#line 5148 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -5129,42 +5161,42 @@ bool  ncoTree::where_assign(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3394 "ncoGrammer.g"
+#line 3417 "ncoGrammer.g"
 	var_sct *var;
-#line 5135 "ncoTree.cpp"
+#line 5167 "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 3394 "ncoGrammer.g"
+#line 3417 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 5144 "ncoTree.cpp"
+#line 5176 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t441 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t442 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t442 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp268_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t443 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp273_AST_in = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t443 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp269_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t444 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp274_AST_in = _t;
 		match(_t,LMT);
 		_t = _t->getFirstChild();
 		var_nbr=out(_t);
 		_t = _retTree;
+		_t = __t444;
+		_t = _t->getNextSibling();
 		_t = __t443;
 		_t = _t->getNextSibling();
 		_t = __t442;
 		_t = _t->getNextSibling();
-		_t = __t441;
-		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3400 "ncoGrammer.g"
+#line 3423 "ncoGrammer.g"
 			
 			
 			int idx;
@@ -5265,7 +5297,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 5269 "ncoTree.cpp"
+#line 5301 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -5284,42 +5316,42 @@ var_sct * ncoTree::var_lmt_one(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 	bool bram
 ) {
-#line 3505 "ncoGrammer.g"
+#line 3528 "ncoGrammer.g"
 	var_sct *var;
-#line 5290 "ncoTree.cpp"
+#line 5322 "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 3505 "ncoGrammer.g"
+#line 3528 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt_one_lhs");
 	var=NULL_CEWI; 
 	var_sct *var_nbr;
 	
-#line 5299 "ncoTree.cpp"
+#line 5331 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t445 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t446 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t446 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp270_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t447 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp275_AST_in = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getFirstChild();
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t447 = _t;
-		ANTLR_USE_NAMESPACE(antlr)RefAST tmp271_AST_in = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t448 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST tmp276_AST_in = _t;
 		match(_t,LMT);
 		_t = _t->getFirstChild();
 		var_nbr=out(_t);
 		_t = _retTree;
+		_t = __t448;
+		_t = _t->getNextSibling();
 		_t = __t447;
 		_t = _t->getNextSibling();
 		_t = __t446;
 		_t = _t->getNextSibling();
-		_t = __t445;
-		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3511 "ncoGrammer.g"
+#line 3534 "ncoGrammer.g"
 			
 			int idx; 
 			int var_id; 
@@ -5464,7 +5496,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 5468 "ncoTree.cpp"
+#line 5500 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -5481,31 +5513,31 @@ var_sct * ncoTree::var_lmt_one_lhs(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
 }
 
 var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
-#line 3659 "ncoGrammer.g"
+#line 3682 "ncoGrammer.g"
 	var_sct *var;
-#line 5487 "ncoTree.cpp"
+#line 5519 "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 3659 "ncoGrammer.g"
+#line 3682 "ncoGrammer.g"
 	
 	const std::string fnc_nm("var_lmt");
 	var=NULL_CEWI; 
 	
-#line 5496 "ncoTree.cpp"
+#line 5528 "ncoTree.cpp"
 	
 	try {      // for error handling
-		ANTLR_USE_NAMESPACE(antlr)RefAST __t449 = _t;
+		ANTLR_USE_NAMESPACE(antlr)RefAST __t450 = _t;
 		vid = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
 		match(_t,VAR_ID);
 		_t = _t->getFirstChild();
 		lmt = _t;
 		match(_t,LMT_LIST);
 		_t = _t->getNextSibling();
-		_t = __t449;
+		_t = __t450;
 		_t = _t->getNextSibling();
 		if ( inputState->guessing==0 ) {
-#line 3664 "ncoGrammer.g"
+#line 3687 "ncoGrammer.g"
 			
 			bool bram;   // Check for a RAM variable
 			bool bnrm;
@@ -5601,7 +5633,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			// copy lmt_sct to dmn_sct;
 			for(idx=0 ;idx <nbr_dmn ; idx++){
 			dmn_sct *dmn_nw;
-			dmn_nw=(dmn_sct*)nco_malloc(sizeof(dmn_sct));
+			dmn_nw=(dmn_sct*)nco_calloc(1,sizeof(dmn_sct));
 			dmn_nw->nm=strdup(lmt_vtr[idx]->nm);
 			
 			// Fudge -if the variable is from input then nco_lmt_evl
@@ -5746,7 +5778,7 @@ var_sct * ncoTree::var_lmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
 			
 			end2: var_rhs=nco_var_free(var_rhs); 
 			
-#line 5750 "ncoTree.cpp"
+#line 5782 "ncoTree.cpp"
 		}
 	}
 	catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
@@ -5803,6 +5835,7 @@ const char* ncoTree::tokenNames[] = {
 	"a string",
 	",",
 	")",
+	"\"exit\"",
 	"\"while\"",
 	"\"break\"",
 	"\"continue\"",
diff --git a/src/nco++/ncoTree.hpp b/src/nco++/ncoTree.hpp
index 4ee9c91..f8fdb91 100644
--- a/src/nco++/ncoTree.hpp
+++ b/src/nco++/ncoTree.hpp
@@ -12,7 +12,7 @@
 
 /* Purpose: ANTLR Grammar and support files for ncap2 */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -33,9 +33,12 @@
     #include <fstream>
     #include <string>
   
+    // custom exception -used for "exit" function
+    #include "ExitException.hpp" 
     // Custom Headers
     #include "prs_cls.hh"
     #include "ncap2_utl.hh"
+    #include "ncap2_att.hh"
     #include "fmc_cls.hh"
     #include "NcapVar.hh"
     #include "NcapVarVector.hh"
@@ -48,10 +51,10 @@
     ANTLR_USING_NAMESPACE(std);
     ANTLR_USING_NAMESPACE(antlr);
 
-#line 52 "ncoTree.hpp"
+#line 55 "ncoTree.hpp"
 class CUSTOM_API ncoTree : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public ncoParserTokenTypes
 {
-#line 691 "ncoGrammer.g"
+#line 697 "ncoGrammer.g"
 
 
 private:
@@ -478,7 +481,7 @@ if( nbr_dmn!=lmt_init(lmt,ast_lmt_vtr) )
     for(idx=0 ; idx < nbr_stmt; idx++){
       ntyp=ntr->getType();
       // we have hit an IF or a basic block
-      if(ntyp==BLOCK || ntyp==IF ||ntyp==DEFDIM || ntyp==WHILE ||ntyp==FOR || ntyp==FEXPR ||ntyp==WHERE) {
+      if(ntyp==BLOCK || ntyp==IF ||ntyp==DEFDIM || ntyp==WHILE ||ntyp==FOR || ntyp==FEXPR ||ntyp==WHERE || ntyp==EXIT) {
       //  if(ntyp != EXPR ){ 
         if(icnt>0) 
          (void)run_dbl(etr,icnt);
@@ -515,7 +518,7 @@ RefAST nco_dupList(RefAST tr){
       */ 
       return otr; 
      }
-#line 56 "ncoTree.hpp"
+#line 59 "ncoTree.hpp"
 public:
 	ncoTree();
 	static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
@@ -570,10 +573,10 @@ protected:
 private:
 	static const char* tokenNames[];
 #ifndef NO_STATIC_CONSTS
-	static const int NUM_TOKENS = 117;
+	static const int NUM_TOKENS = 118;
 #else
 	enum {
-		NUM_TOKENS = 117
+		NUM_TOKENS = 118
 	};
 #endif
 	
diff --git a/src/nco++/nco_gsl.c b/src/nco++/nco_gsl.c
index c98b6a9..b304d5f 100644
--- a/src/nco++/nco_gsl.c
+++ b/src/nco++/nco_gsl.c
@@ -9,7 +9,7 @@
    GSL and NCO are both distributed under the GPL3 license.
    The GSL code is copyright by its respective authors.
    The NCO modifications that provide missing value support are, in addition, 
-   Copyright (C) 2013--2016 Charlie Zender
+   Copyright (C) 2013--2017 Charlie Zender
    License: GNU General Public License (GPL) Version 3
    See http://www.gnu.org/copyleft/gpl.html for full license text
 
diff --git a/src/nco++/nco_gsl.h b/src/nco++/nco_gsl.h
index a869a10..2151f94 100644
--- a/src/nco++/nco_gsl.h
+++ b/src/nco++/nco_gsl.h
@@ -9,7 +9,7 @@
    GSL and NCO are both distributed under the GPL3 license.
    The GSL code is copyright by its respective authors.
    The NCO modifications that provide missing value support are, in addition, 
-   Copyright (C) 2013--2016 Charlie Zender
+   Copyright (C) 2013--2017 Charlie Zender
    License: GNU General Public License (GPL) Version 3
    See http://www.gnu.org/copyleft/gpl.html for full license text
 
diff --git a/src/nco++/prs_cls.cc b/src/nco++/prs_cls.cc
index ab30cb8..c4fdc46 100644
--- a/src/nco++/prs_cls.cc
+++ b/src/nco++/prs_cls.cc
@@ -3,7 +3,7 @@
 /* Purpose: netCDF arithmetic processor */
 /* prs_cls -- symbol table - class methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/prs_cls.hh b/src/nco++/prs_cls.hh
index 51ce1c2..d4c5d3d 100644
--- a/src/nco++/prs_cls.hh
+++ b/src/nco++/prs_cls.hh
@@ -1,7 +1,7 @@
 /* Purpose: netCDF arithmetic processor -  */
 /* prs_cls -- symbol table - data members & class methods */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/sdo_utl.cc b/src/nco++/sdo_utl.cc
index 67563fd..8c98fe0 100644
--- a/src/nco++/sdo_utl.cc
+++ b/src/nco++/sdo_utl.cc
@@ -2,7 +2,7 @@
 
 // Purpose: Implementation (declaration) of SDO stand-alone utilities 
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco++/sdo_utl.hh b/src/nco++/sdo_utl.hh
index 6cc7765..7ff5b4d 100644
--- a/src/nco++/sdo_utl.hh
+++ b/src/nco++/sdo_utl.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of SDO stand-alone utilities
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/libnco.h b/src/nco/libnco.h
index 567c745..951ebdc 100644
--- a/src/nco/libnco.h
+++ b/src/nco/libnco.h
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF Operator (NCO) library */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/mpncbo.c b/src/nco/mpncbo.c
index 7a21053..fa048d6 100644
--- a/src/nco/mpncbo.c
+++ b/src/nco/mpncbo.c
@@ -5,7 +5,7 @@
 /* Purpose: Compute sum, difference, product, or ratio of specified hyperslabs of specfied variables
    from two input netCDF files and output them to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/mpncecat.c b/src/nco/mpncecat.c
index ecc0be3..dda5b22 100644
--- a/src/nco/mpncecat.c
+++ b/src/nco/mpncecat.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Join variables across files into a new record variable */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/mpncflint.c b/src/nco/mpncflint.c
index 40c5f97..59a5b51 100644
--- a/src/nco/mpncflint.c
+++ b/src/nco/mpncflint.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Linearly interpolate a third netCDF file from two input files */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/mpncpdq.c b/src/nco/mpncpdq.c
index c9a4a46..0ca3e82 100644
--- a/src/nco/mpncpdq.c
+++ b/src/nco/mpncpdq.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Pack, re-dimension, query single netCDF file and output to a single file */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/mpncra.c b/src/nco/mpncra.c
index b5eed96..0bc018e 100644
--- a/src/nco/mpncra.c
+++ b/src/nco/mpncra.c
@@ -9,7 +9,7 @@
    specfied variables of multiple input netCDF files and output them 
    to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/mpncwa.c b/src/nco/mpncwa.c
index 91e0081..5ae0fc3 100644
--- a/src/nco/mpncwa.c
+++ b/src/nco/mpncwa.c
@@ -5,7 +5,7 @@
 /* Purpose: Compute averages of specified hyperslabs of specfied variables
    in a single input netCDF file and output them to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/ncap.c b/src/nco/ncap.c
index 4b83ab8..aa3268d 100644
--- a/src/nco/ncap.c
+++ b/src/nco/ncap.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Compute user-defined derived fields using forward algebraic notation applied to netCDF files */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -233,7 +233,6 @@ main(int argc,char **argv)
   nm_id_sct *xtr_lst_a=NULL; /* Initialize to ALL variables in OUTPUT file */
   
   size_t bfr_sz_hnt=NC_SIZEHINT_DEFAULT; /* [B] Buffer size hint */
-  size_t cnk_csh_byt=NCO_CNK_CSH_BYT_DFL; /* [B] Chunk cache size */
   size_t cnk_min_byt=NCO_CNK_SZ_MIN_BYT_DFL; /* [B] Minimize size of variable to chunk */
   size_t cnk_sz_byt=0UL; /* [B] Chunk size in bytes */
   size_t cnk_sz_scl=0UL; /* [nbr] Chunk size scalar */
diff --git a/src/nco/ncap.h b/src/nco/ncap.h
index a02c8c5..79361a1 100644
--- a/src/nco/ncap.h
+++ b/src/nco/ncap.h
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF arithmetic processor definitions and function prototypes for ncap.c, ncap_utl.c, ncap_lex.l, and ncap_yacc.y */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/ncap_utl.c b/src/nco/ncap_utl.c
index 9c8e0b1..f48f62c 100644
--- a/src/nco/ncap_utl.c
+++ b/src/nco/ncap_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF arithmetic processor */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/ncap_yacc.y b/src/nco/ncap_yacc.y
index 4a16ab9..80c8ee9 100644
--- a/src/nco/ncap_yacc.y
+++ b/src/nco/ncap_yacc.y
@@ -4,7 +4,7 @@
   
 /* Purpose: Grammar parser for ncap */
   
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
diff --git a/src/nco/ncatted.c b/src/nco/ncatted.c
index d8643b4..961b5b7 100644
--- a/src/nco/ncatted.c
+++ b/src/nco/ncatted.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Add, create, delete, or overwrite attributes in a netCDF file */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -416,7 +416,7 @@ main(int argc,char **argv)
   trv_tbl_init(&trv_tbl); 
 
   /* Construct GTT (Group Traversal Table) */
-  (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,NULL,(int) 0,False,False,False,False,True,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,NULL,(int)0,False,False,False,False,True,False,False,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
   /* Timestamp end of metadata setup and disk layout */
   rcd+=nco_ddra((char *)NULL,(char *)NULL,&ddra_info);
@@ -435,7 +435,7 @@ main(int argc,char **argv)
       trv_tbl_init(&trv_tbl_rx); 
       /* Use regular expressions in aed structure to construct traversal table
 	 Variables marked for extraction will then have the attributes edited */
-      (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,var_lst_in,var_lst_in_nbr,False,False,False,False,False,nco_pck_plc_nil,&flg_dne,trv_tbl_rx); 
+      (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,var_lst_in,var_lst_in_nbr,False,False,False,False,False,False,False,nco_pck_plc_nil,&flg_dne,trv_tbl_rx); 
       /* Edit same attribute for all variables marked for extraction */
       (void)nco_aed_prc_var_xtr(nc_id,aed_lst[idx_aed],trv_tbl_rx);
       trv_tbl_free(trv_tbl_rx);
diff --git a/src/nco/ncbo.c b/src/nco/ncbo.c
index 273da69..f460a1a 100644
--- a/src/nco/ncbo.c
+++ b/src/nco/ncbo.c
@@ -5,7 +5,7 @@
 /* Purpose: Compute sum, difference, product, or ratio of specified hyperslabs of specfied variables
    from two input netCDF files and output them to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -105,6 +105,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FILE_1_RETRIEVED_FROM_REMOTE_LOCATION=False;
   nco_bool FILE_2_RETRIEVED_FROM_REMOTE_LOCATION=False;
   nco_bool FL_LST_IN_FROM_STDIN=False; /* [flg] fl_lst_in comes from stdin */
@@ -243,6 +245,14 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -400,6 +410,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"drt") || !strcmp(opt_crr,"mmr_drt") || !strcmp(opt_crr,"dirty")) flg_cln=False; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"ddra") || !strcmp(opt_crr,"mdl_cmp")) ddra_info.flg_ddra=flg_ddra=True; /* [flg] DDRA diagnostics */
@@ -588,8 +602,8 @@ main(int argc,char **argv)
   in_id_2=in_id_2_arr[0];
 
   /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-  (void)nco_bld_trv_tbl(in_id_1,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne1,trv_tbl_1);
-  (void)nco_bld_trv_tbl(in_id_2,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne2,trv_tbl_2);
+  (void)nco_bld_trv_tbl(in_id_1,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne1,trv_tbl_1);
+  (void)nco_bld_trv_tbl(in_id_2,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne2,trv_tbl_2);
 
   /* Merge DNE lists before checking */
   flg_dne=(nco_dmn_dne_t *)nco_malloc(2*lmt_nbr*sizeof(nco_dmn_dne_t));
diff --git a/src/nco/ncecat.c b/src/nco/ncecat.c
index b7254d6..93f2c69 100644
--- a/src/nco/ncecat.c
+++ b/src/nco/ncecat.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Join variables across files with new record variable or aggregate files as groups */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -94,6 +94,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FL_RTR_RMT_LCN;
   nco_bool FL_LST_IN_APPEND=True; /* Option H */
   nco_bool FL_LST_IN_FROM_STDIN=False; /* [flg] fl_lst_in comes from stdin */
@@ -232,6 +234,14 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -395,6 +405,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"drt") || !strcmp(opt_crr,"mmr_drt") || !strcmp(opt_crr,"dirty")) flg_cln=False; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"fl_fmt") || !strcmp(opt_crr,"file_format")) rcd=nco_create_mode_prs(optarg,&fl_out_fmt);
@@ -596,7 +610,7 @@ main(int argc,char **argv)
     in_id_arr=(int *)nco_malloc(thr_nbr*sizeof(int));
 
     /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-    (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
+    (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
     /* Were all user-specified dimensions found? */ 
     (void)nco_chk_dmn(lmt_nbr,flg_dne);     
@@ -809,7 +823,7 @@ main(int argc,char **argv)
       trv_tbl_init(&trv_tbl_gpr);
 
       /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-      (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr_rgn,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl_gpr);
+      (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr_rgn,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl_gpr);
 
       /* 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_gpr);
diff --git a/src/nco/ncflint.c b/src/nco/ncflint.c
index 83c12c8..f704960 100644
--- a/src/nco/ncflint.c
+++ b/src/nco/ncflint.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Linearly interpolate a third netCDF file from two input files */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -92,6 +92,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FILE_1_RETRIEVED_FROM_REMOTE_LOCATION;
   nco_bool FILE_2_RETRIEVED_FROM_REMOTE_LOCATION;
   nco_bool FIX_REC_CRD=False; /* [flg] Do not interpolate/multiply record coordinate variables */
@@ -235,6 +237,14 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -394,6 +404,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"drt") || !strcmp(opt_crr,"mmr_drt") || !strcmp(opt_crr,"dirty")) flg_cln=False; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"fix_rec_crd")) FIX_REC_CRD=True; /* [flg] Do not interpolate/multiply record coordinate variables */
@@ -621,7 +635,7 @@ main(int argc,char **argv)
   trv_tbl_init(&trv_tbl);
 
   /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-  (void)nco_bld_trv_tbl(in_id_1,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  (void)nco_bld_trv_tbl(in_id_1,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
   /* Were all user-specified dimensions found? */ 
   (void)nco_chk_dmn(lmt_nbr,flg_dne);     
diff --git a/src/nco/ncks.c b/src/nco/ncks.c
index 261ec12..368239c 100644
--- a/src/nco/ncks.c
+++ b/src/nco/ncks.c
@@ -5,7 +5,7 @@
 /* Purpose: Extract (subsets of) variables from a netCDF file 
    Print them to screen, copy them to another file, or regrid them */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -157,6 +157,8 @@ main(int argc,char **argv)
   const char * const CVS_Revision="$Revision$";
   const char * const opt_sht_lst="34567aABb:CcD:d:FG:g:HhL:l:MmOo:Pp:qQrRs:t:uVv:X:xz-:";
 
+  const char fnc_nm[]="main()"; /* [sng] Function name */
+
   cnk_sct cnk; /* [sct] Chunking structure */
 
 #if defined(__cplusplus) || defined(PGI_CC)
@@ -225,6 +227,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option x */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FL_RTR_RMT_LCN;
   nco_bool FL_LST_IN_FROM_STDIN=False; /* [flg] fl_lst_in comes from stdin */
   nco_bool FORCE_APPEND=False; /* Option A */
@@ -288,6 +292,14 @@ main(int argc,char **argv)
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
     {"cdl",no_argument,0,0}, /* [flg] Print CDL */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -660,7 +672,7 @@ main(int argc,char **argv)
 	rgr_var=(char *)strdup(optarg);
       } /* !rgr_var */
       if(!strcmp(opt_crr,"secret") || !strcmp(opt_crr,"scr") || !strcmp(opt_crr,"shh")){
-        (void)fprintf(stdout,"Hidden/unsupported NCO options:\nCompiler used\t\t--cmp, --compiler\nCopyright\t\t--cpy, --copyright, --license\nHidden functions\t--scr, --ssh, --secret\nLibrary used\t\t--lbr, --library\nMemory clean\t\t--mmr_cln, --cln, --clean\nMemory dirty\t\t--mmr_drt, --drt, --dirty\nMPI implementation\t--mpi_implementation\nNo-clobber files\t--no_clb, --no-clobber\nPseudonym\t\t--pseudonym, -Y (ncra only)\nSpinlock\t\t--spinlock\nStreams\t\t\t--srm\nSysconf\t\t\t--sy [...]
+        (void)fprintf(stdout,"Hidden/unsupported NCO options:\nCompiler used\t\t--cmp, --compiler\nChunk cache size\t\t--cnk_csh_byt\nCopyright\t\t--cpy, --copyright, --license\nHidden functions\t--scr, --ssh, --secret\nLibrary used\t\t--lbr, --library\nMemory clean\t\t--mmr_cln, --cln, --clean\nMemory dirty\t\t--mmr_drt, --drt, --dirty\nMPI implementation\t--mpi_implementation\nNo-clobber files\t--no_clb, --no-clobber\nPseudonym\t\t--pseudonym, -Y (ncra only)\nSpinlock\t\t--spinlock\nSt [...]
         nco_exit(EXIT_SUCCESS);
       } /* endif "shh" */
       if(!strcmp(opt_crr,"srm")) PRN_SRM=True; /* [flg] Print ncStream */
@@ -937,7 +949,7 @@ main(int argc,char **argv)
   in_id=in_id_arr[0];
   
   /* Construct GTT (Group Traversal Table), check -v and -g input names and create extraction list */
-  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,GRP_XTR_VAR_XCL,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,GRP_XTR_VAR_XCL,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
   /* Were all user-specified dimensions found? */ 
   (void)nco_chk_dmn(lmt_nbr,flg_dne);    
@@ -1023,7 +1035,26 @@ main(int argc,char **argv)
     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 [...]
   } /* !gpe */
 
-    /* Terraref */
+  /* 20170107: Unlike all other operators, ncks may benefit from setting chunk cache when input file (not output file is netCDF4, because it has to be printed, and there is anecdotal evidence that ncdump print speed may be improved by cache adjustments */
+  if(fl_out_fmt == NC_FORMAT_NETCDF4 || fl_out_fmt == NC_FORMAT_NETCDF4_CLASSIC || fl_in_fmt == NC_FORMAT_NETCDF4 || fl_in_fmt == NC_FORMAT_NETCDF4_CLASSIC){
+    float pmp_fvr_frc; /* [frc] Pre-emption favor fraction */
+    size_t cnk_csh_byt_crr; /* I [B] Chunk cache size current setting */
+    size_t nelemsp; /* [nbr] Chunk slots in raw data chunk cache hash table */
+    if(cnk_csh_byt > 0ULL){
+      /* Use user-specified chunk cache size if available */
+      //cnk->cnk_csh_byt=cnk_csh_byt;
+      nco_get_chunk_cache(&cnk_csh_byt_crr,&nelemsp,&pmp_fvr_frc);
+      rcd+=nco_set_chunk_cache(cnk_csh_byt,nelemsp,pmp_fvr_frc);
+    } /* !cnk_csh_byt */
+    
+    /* Report current system cache settings */
+    if(nco_dbg_lvl_get() >= nco_dbg_scl){
+      nco_get_chunk_cache(&cnk_csh_byt_crr,&nelemsp,&pmp_fvr_frc);
+      (void)fprintf(stderr,"%s: INFO %s reports cnk_csh_byt = %ld, nelemsp = %ld, pmp_fvr_frc = %g\n",nco_prg_nm_get(),fnc_nm,cnk_csh_byt_crr,nelemsp,pmp_fvr_frc);
+    } /* !dbg */
+  } /* !netCDF4 */
+
+  /* Terraref */
   if(flg_trr){
     char *trr_out;
     trr_sct *trr_nfo;
@@ -1263,10 +1294,11 @@ main(int argc,char **argv)
 	/* Ineptly named nco_grp_prn() emits full CDL and XML formats, and partial JSN 
 	   rcd+=nco_grp_prn(in_id,trv_pth,&prn_flg,trv_tbl); */
 
-        if(prn_flg.jsn) rcd+=nco_grp_prn_jsn(in_id,trv_pth,&prn_flg,trv_tbl);
-        else if(prn_flg.xml) rcd+=nco_grp_prn_xml(in_id,trv_pth,&prn_flg,trv_tbl);
-        else rcd+=nco_grp_prn(in_id,trv_pth,&prn_flg,trv_tbl);
-        /* else if(prn_flg.cdl || prn_flg.trd) rcd+=nco_grp_prn_cdl_trd(in_id,trv_pth,&prn_flg,trv_tbl); */   
+        if(prn_flg.jsn) rcd+=nco_prn_jsn(in_id,trv_pth,&prn_flg,trv_tbl);
+        else if(prn_flg.xml) rcd+=nco_prn_xml(in_id,trv_pth,&prn_flg,trv_tbl);
+        else if(prn_flg.cdl || prn_flg.trd) rcd+=nco_prn_cdl_trd(in_id,trv_pth,&prn_flg,trv_tbl); 
+        /* else rcd+=nco_grp_prn(in_id,trv_pth,&prn_flg,trv_tbl); */
+
  
       }else{
 	/* Place-holder for other options for organization/alphabetization */
diff --git a/src/nco/nco.h b/src/nco/nco.h
index b65e27b..e67049b 100644
--- a/src/nco/nco.h
+++ b/src/nco/nco.h
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF Operator (NCO) definitions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -336,7 +336,7 @@ extern "C" {
 # define NCO_VERSION_MINOR 6
 #endif /* !NCO_VERSION_MINOR */
 #ifndef NCO_VERSION_PATCH
-# define NCO_VERSION_PATCH 3
+# define NCO_VERSION_PATCH 4
 #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 */
@@ -346,7 +346,7 @@ extern "C" {
 # define NCO_LIB_VERSION ( NCO_VERSION_MAJOR * 100 + NCO_VERSION_MINOR * 10 + NCO_VERSION_PATCH )
 #endif /* !NCO_LIB_VERSION */
 #ifndef NCO_VERSION
-# define NCO_VERSION "4.6.3"
+# define NCO_VERSION "4.6.4"
 #endif /* !NCO_VERSION */
 
 /* Compatibility tokens new to netCDF4 netcdf.h: */
@@ -1139,14 +1139,15 @@ extern "C" {
     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_cll_msr; /* [flg] Add cell_measures attribute */
     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_grd_dst; /* [flg] User-specified destination grid */
+    nco_bool flg_grd_src; /* [flg] User-specified input grid */
     nco_bool flg_map; /* [flg] User-specified mapping weights */
+    nco_bool flg_nfr; /* [flg] Infer SCRIP-format grid file */
     nco_bool flg_rnr; /* [flg] Renormalize destination values by valid area */
+    nco_bool flg_usr_rqs; /* [flg] User requested regridding */
   } rgr_sct; /* end Regrid structure */
 
   /* Key-value structure */
diff --git a/src/nco/nco_att_utl.c b/src/nco/nco_att_utl.c
index e7420d1..ea71f20 100644
--- a/src/nco/nco_att_utl.c
+++ b/src/nco/nco_att_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Attribute utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_att_utl.h b/src/nco/nco_att_utl.h
index f524ded..c50b2a4 100644
--- a/src/nco/nco_att_utl.h
+++ b/src/nco/nco_att_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Attribute utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_aux.c b/src/nco/nco_aux.c
index fa4fbcf..01d59d4 100644
--- a/src/nco/nco_aux.c
+++ b/src/nco/nco_aux.c
@@ -1,6 +1,6 @@
 /* $Header$ */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_aux.h b/src/nco/nco_aux.h
index 5791e0e..e448ce3 100644
--- a/src/nco/nco_aux.h
+++ b/src/nco/nco_aux.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Sub-set cell-based grids using auxiliary coordinate variable */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_bnr.c b/src/nco/nco_bnr.c
index 5b6da18..9142646 100644
--- a/src/nco/nco_bnr.c
+++ b/src/nco/nco_bnr.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Binary file utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_bnr.h b/src/nco/nco_bnr.h
index 037db03..7d43608 100644
--- a/src/nco/nco_bnr.h
+++ b/src/nco/nco_bnr.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Binary file utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cln_utl.c b/src/nco/nco_cln_utl.c
index 3e0ad80..14ce35c 100644
--- a/src/nco/nco_cln_utl.c
+++ b/src/nco/nco_cln_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Calendar utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -13,12 +13,16 @@
 /* Format: year, month, day, hour, minute, second, origin, offset */
 double DATA_360[8]={31104000.0,2592000.0,86400.0,3600.0,60.0,1,0.0,0.0};
 double DATA_365[8]={31536000.0,2628000.0,86400.0,3600.0,60.0,1,0.0,0.0};
+double DATA_366[8]={31622400.0,2635200.0,86400.0,3600.0,60.0,1,0.0,0.0};
 
 /* Days in months */
 int DAYS_PER_MONTH_360[12]={30,30,30,30,30,30,30,30,30,30,30,30};
 int DAYS_PER_MONTH_365[12]={31,28,31,30,31,30,31,31,30,31,30,31};
 int DAYS_PER_MONTH_366[12]={31,29,31,30,31,30,31,31,30,31,30,31};
 
+/* Size of temporary buffer used in parsing calendar dates */
+#define NCO_MAX_LEN_TMP_SNG 200
+
 int /* O [nbr] Number of days to end of month */
 nco_nd2endm /* [fnc] Compute number of days to end of month */
 (const int mth, /* I [mth] Month */
@@ -162,7 +166,7 @@ nco_cln_get_tm_typ /* Returns time unit type or tm_void if not found */
 
 nco_cln_typ /* [enm] Calendar type */
 nco_cln_get_cln_typ /* [fnc] Determine calendar type or cln_nil if not found */
-(const char *ud_sng) /* I [ptr] units string  */
+(const char *ud_sng) /* I [ptr] Units string */
 {
   int idx;
   int len; 
@@ -252,6 +256,13 @@ nco_cln_pop_val /* [fnc] Calculate value in cln_sct */
       data[5]*(double)cln_sct->sec;
     break;
   case cln_366:
+    data=DATA_366;    
+    cln_sct->value=data[0]*(cln_sct->year-1)+
+      data[2]*nco_cln_days_in_year_prior_to_given_month(cln_366,cln_sct->month)+
+      data[2]*(cln_sct->day-1)+
+      data[3]*cln_sct->hour+
+      data[4]*cln_sct->min+
+      data[5]*(double)cln_sct->sec;
     break;
   case cln_std:
   case cln_grg:
@@ -279,6 +290,7 @@ nco_cln_val_tm_typ
     data=DATA_365;    
     break;
   case cln_366:
+    data=DATA_366;    
     break;
   case cln_std:
   case cln_grg:
@@ -313,7 +325,6 @@ nco_cln_val_tm_typ
   return scl;
 } /* end nco_cln_typ_val() */
 
-
 int /* O [flg] String is calendar date */
 nco_cln_chk_tm /* [fnc] Is string a UDUnits-compatible calendar format, e.g., "PERIOD since REFERENCE_DATE" */
 (const char *unit_sng) /* I [sng] Units string */
@@ -334,11 +345,13 @@ nco_cln_clc_dbl_var_dff( /* [fnc] difference between two co-ordinate units */
 const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
 const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
 nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *dval,           /* I/O [dbl] var values modified */
+double *val_dbl,           /* I/O [dbl] var values modified */
 var_sct *var)           /* I/O [var_sct] var values modified */
 {
+  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to convert values from \"%s\" to \"%s\". See http://nco.sf.net/nco.html#rbs for more information.\n%s: HINT Re-build or re-install NCO enabled with UDUnits.\n", nco_prg_nm_get(),fl_unt_sng,fl_bs_sng);
+
   return NCO_NOERR;
-}
+} /* end nco_cln_clc_dbl_var_dff() */
 
 int /* [flg] NCO_NOERR or NCO_ERR */ 
 nco_cln_clc_dbl_org(   /* [fnc] difference between two co-ordinate units */
@@ -348,8 +361,9 @@ nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */
 double *og_val)         /* O [dbl] output value */
 {
   *og_val=0.0; /* CEWI */
+  (void)fprintf(stderr,"%s: WARNING NCO was built without UDUnits. NCO is therefore unable to interpret the string \"%s\" limit argument. HINT Re-build or re-install NCO enabled with UDUnits.\n", nco_prg_nm_get(),val_unt_sng);
   return NCO_NOERR; 
-}
+} /* !nco_cln_clc_dbl_org() */
 
 int /* [rcd] Return code */
 nco_cln_sng_rbs /* [fnc] Rebase calendar string for legibility */
@@ -374,7 +388,7 @@ nco_cln_cnv_mk  /* [fnc] UDUnits2 create a custom converter  */
 (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
  const char *fl_bs_sng) /* I [ptr] units attribute string from disk */
 {
-  const char fnc_nm[]="nco_cln_cnv_mk"; /* [sng] Function name */
+  const char fnc_nm[]="nco_cln_cnv_mk()"; /* [sng] Function name */
   
   cv_converter *ut_cnv; /* UDUnits converter */
 
@@ -428,159 +442,122 @@ nco_cln_cnv_mk  /* [fnc] UDUnits2 create a custom converter  */
   ut_free_system(ut_sys); /* Free memory taken by UDUnits library */
   // cv_free(ut_cnv);
 
-
   return ut_cnv;
 }  /* end UDUnits2 nco_cln_cnv_mk() */
 
-
-int    /* [flg] NCO_NOERR or NCO_ERR */ 
+int /* [flg] NCO_NOERR or NCO_ERR */ 
 nco_cln_clc_dbl_dff( /* [fnc] difference between two co-ordinate units */
 const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
+const char *fl_bs_sng, /* I [ptr] units attribute string from disk */
 double *og_val)
-{           /* I/O [dbl] var values modified */
-
+{ /* I/O [dbl] var values modified */
   cv_converter *ut_cnv=NULL; 
-  const char fnc_nm[]="nco_cln_clc_var_dff()"; /* [sng] Function name */
-  
-  
-  /* do nothing if units identical */
-  if(strcasecmp(fl_unt_sng,fl_bs_sng)==0)
-    return NCO_NOERR;
+
+  /* Do nothing if units identical */
+  if(strcasecmp(fl_unt_sng,fl_bs_sng)==0) return NCO_NOERR;
 
   /* Convert */
   ut_cnv=nco_cln_cnv_mk(fl_unt_sng, fl_bs_sng);
 
-  if(ut_cnv != NULL)
-     og_val[0]=cv_convert_double(ut_cnv,og_val[0]);                      
-  else
-     return NCO_ERR;     
+  if(ut_cnv != NULL) og_val[0]=cv_convert_double(ut_cnv,og_val[0]); else return NCO_ERR;     
 
- cv_free(ut_cnv);  
+  cv_free(ut_cnv);  
 
- return NCO_NOERR;          
-}  
+  return NCO_NOERR;          
+} /* end UDUnits2 nco_cln_clc_dbl_dff() */
 
+int /* [flg] NCO_NOERR or NCO_ERR */ 
+nco_cln_clc_var_dff /* [fnc] difference between two co-ordinate units */
+(const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+ const char *fl_bs_sng, /* I [ptr] units attribute string from disk */
+ var_sct *var) /* I/O [dbl] var values modified */
+{
+  cv_converter *ut_cnv=NULL; 
 
-int    /* [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_var_dff( /* [fnc] difference between two co-ordinate units */
-const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
-var_sct *var)
-{           /* I/O [dbl] var values modified */
+  ptr_unn op1;    
 
-  size_t sz;
   size_t idx;    
-  double *dp;  
-  ptr_unn op1;    
 
-  cv_converter *ut_cnv=NULL; 
-  const char fnc_nm[]="nco_cln_clc_var_dff()"; /* [sng] Function name */
-  
+  size_t sz;
   
-  /* do nothing if units identical */
-  if(strcasecmp(fl_unt_sng,fl_bs_sng)==0)
-    return NCO_NOERR;
+  /* Do nothing if units identical */
+  if(!strcasecmp(fl_unt_sng,fl_bs_sng)) return NCO_NOERR;
 
   /* Convert */
-  ut_cnv=nco_cln_cnv_mk(fl_unt_sng, fl_bs_sng);
+  ut_cnv=nco_cln_cnv_mk(fl_unt_sng,fl_bs_sng);
 
-  if(ut_cnv == NULL)
-      return NCO_ERR;     
+  if(ut_cnv == NULL) return NCO_ERR;     
 
   sz=var->sz;  
 
   (void)cast_void_nctype(var->type,&op1);                
   op1=var->val;
  
-  if(var->type==NC_DOUBLE)
-  {
-
+  if(var->type == NC_DOUBLE){
     double *dp;
     dp=op1.dp;     
 
-  if(var->has_mss_val)
-  {
+    if(var->has_mss_val){
       double mss_dbl=var->mss_val.dp[0]; 
       for(idx=0; idx<sz; idx++)
-	if( dp[idx] != mss_dbl)   
+	if(dp[idx] != mss_dbl)
 	  dp[idx]=cv_convert_double(ut_cnv,dp[idx]);                      
-  }else
+    }else{
      (void)cv_convert_doubles(ut_cnv,dp,sz,dp);                      
-  
-
-  }
-
-  else if(var->type==NC_FLOAT)
-  {
-
+    } /* !has_mss_val */
+  }else if(var->type==NC_FLOAT){
     float*fp;
     fp=op1.fp;     
-
-  if(var->has_mss_val)
-  {
+    if(var->has_mss_val){
       float mss_fp=var->mss_val.fp[0]; 
-      for(idx=0; idx<sz; idx++)
-	if( fp[idx] != mss_fp)   
+      for(idx=0;idx<sz;idx++)
+	if(fp[idx] != mss_fp)   
 	  fp[idx]=cv_convert_float(ut_cnv,fp[idx]);                      
-  }
-  else
-    (void)cv_convert_floats(ut_cnv,fp,sz,fp);                      
-  
-
-  }
-
+    }else{
+      (void)cv_convert_floats(ut_cnv,fp,sz,fp);                      
+    } /* !has_mss_val */
+  } /* !var->type */
 
  cv_free(ut_cnv);  
  (void)cast_nctype_void(var->type,&op1);
 
  return NCO_NOERR;
-                
-}  
-
+} /* !nco_cln_clc_var_dff() */
 
-int    /* [flg] NCO_NOERR or NCO_ERR */ 
+int /* [flg] NCO_NOERR or NCO_ERR */ 
 nco_cln_clc_dbl_var_dff( /* [fnc] difference between two co-ordinate units */
 const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
 const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
 nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
 double *og_val,           /* I/O [dbl] var values modified -can be NULL */
-var_sct *var)           /* I/O [var_sct] var values modified - can be NULL  */
-{
-  int rcd;
-  int is_date;
-  const char fnc_nm[]="nco_cln_clc_dv_dff()"; /* [sng] Function name */
-
-  if(nco_dbg_lvl_get() >= nco_dbg_scl) 
-     (void)fprintf(stderr,"%s: nco_cln_clc_dbl_var_dff() reports unt_sng=%s bs_sng=%s calendar=%d\n",nco_prg_nm_get(),fl_unt_sng,fl_bs_sng,lmt_cln);
-
-
+var_sct *var) /* I/O [var_sct] var values modified - can be NULL  */
+{ /* Purpose: */
   
-  /* do nothing if units identical */
-  if(!strcasecmp(fl_unt_sng,fl_bs_sng))
-    return NCO_NOERR;
-
+  const char fnc_nm[]="nco_cln_clc_dbl_var_dff()"; /* [sng] Function name */
 
-  /* see if target units is of the form  "units since date-string" */
-  is_date = nco_cln_chk_tm(fl_bs_sng);
-
-  /* use custom time functions if irregular calendar */
-  if(is_date && (lmt_cln==cln_360 || lmt_cln==cln_365) )
-    rcd=nco_cln_clc_tm( fl_unt_sng, fl_bs_sng,lmt_cln, og_val, var);  
+  int is_date;
+  int rcd;
 
-  else if(og_val != (double*)NULL) 
-     rcd=nco_cln_clc_dbl_dff(fl_unt_sng, fl_bs_sng,og_val);  
+  if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stderr,"%s: %s reports unt_sng=%s bs_sng=%s calendar=%d\n",nco_prg_nm_get(),fnc_nm,fl_unt_sng,fl_bs_sng,lmt_cln);
 
-  else if(var != (var_sct*)NULL)
-    rcd=nco_cln_clc_var_dff(fl_unt_sng, fl_bs_sng,var);
+  /* Do nothing if units identical */
+  if(!strcasecmp(fl_unt_sng,fl_bs_sng)) return NCO_NOERR;
 
-  
+  /* Are target units of the form  "units since date-string" */
+  is_date=nco_cln_chk_tm(fl_bs_sng);
 
+  /* Use custom time functions if irregular calendar */
+  if(is_date && (lmt_cln == cln_360 || lmt_cln == cln_365))
+    rcd=nco_cln_clc_tm(fl_unt_sng,fl_bs_sng,lmt_cln,og_val,var);  
+  else if(og_val != (double *)NULL) 
+    rcd=nco_cln_clc_dbl_dff(fl_unt_sng,fl_bs_sng,og_val);
+  else if(var != (var_sct *)NULL)
+    rcd=nco_cln_clc_var_dff(fl_unt_sng,fl_bs_sng,var);
+  else
+    rcd=NCO_NOERR;
+    
   return rcd;
-
-}  /* end UDUnits2 nco_cln_clc_dff() */
-
-
+} /* end UDUnits2 nco_cln_clc_dbl_var_dff() */
 
 int   /* [flg] NCO_NOERR or NCO_ERR */ 
 nco_cln_clc_dbl_org(   /* [fnc] difference between two co-ordinate units */
@@ -589,83 +566,70 @@ const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
 nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
 double *og_val)         /* O [dbl] output value */
 {
-  int is_date;  /* set to true if date/time unit */
-  int rcd;
-  int month;
-  int year;
+  const char fnc_nm[]="nco_cln_clc_dbl_org"; /* [sng] Function name */
 
-  char lcl_unt_sng[200];
-  const char fnc_nm[]="nco_cln_dbl_org"; /* [sng] Function name */
-  
-  double dval;
+  int is_date=0;  /* set to true if date/time unit */
+  int rcd=0;
+  int month=0;
+  int year=0;
+  char lcl_unt_sng[200]={0};
+  double val_dbl=0.0;
 
   rcd=0;  
 
-  dval=0.0;
+  val_dbl=0.0;
 
-  is_date = nco_cln_chk_tm(fl_bs_sng);
+  is_date=nco_cln_chk_tm(fl_bs_sng);
 
   lcl_unt_sng[0]='\0';
   
-  if(nco_dbg_lvl_get() >= nco_dbg_vrb) 
-       (void)fprintf(stderr,"%s: INFO %s: reports unt_sng=%s bs_sng=%s calendar=%d\n",nco_prg_nm_get(),fnc_nm,val_unt_sng,fl_bs_sng,lmt_cln);
+  if(nco_dbg_lvl_get() >= nco_dbg_vrb) (void)fprintf(stderr,"%s: INFO %s: reports unt_sng=%s bs_sng=%s calendar=%d\n",nco_prg_nm_get(),fnc_nm,val_unt_sng,fl_bs_sng,lmt_cln);
 
-  
-    /* Does fl_unt_sng look like a regular timestamp? */ 
-  if(is_date && sscanf(val_unt_sng,"%d-%d",&year,&month) == 2)
-  {
-    /* udunits requires  this prefix that it can recognize a raw-datetime string */  
+  /* Does fl_unt_sng look like a regular timestamp? */ 
+  if(is_date && sscanf(val_unt_sng,"%d-%d",&year,&month) == 2){
+    /* UDUnits requires this prefix to recognize a raw-datetime string */  
     strcpy(lcl_unt_sng,"s@");
     strcat(lcl_unt_sng,val_unt_sng);
-  }
-  else
-  {
+    val_dbl=0.0;
+  }else{
     /* Regular conversion of fl_unt_sng of form <double_value units>, e.g., '10 inches', '100 ft'  '10 days since 1970-01-01' */
-    char *ptr=(char*)NULL;
+    char *ptr=NULL;
         
-    dval=strtod(val_unt_sng, &ptr);  
-        
-    if(ptr==val_unt_sng || strlen(++ptr)<1)
-    {
+    val_dbl=strtod(val_unt_sng,&ptr);  
+    if(ptr == val_unt_sng || strlen(++ptr) < 1L){
       (void)fprintf(stderr, "%s: INFO %s() reports input string must be of the form \"value unit\" got the string \"%s\"\n",nco_prg_nm_get(),fnc_nm,val_unt_sng);
       nco_exit(EXIT_FAILURE);           
-    }
+    } /* !ptr */
     strcpy(lcl_unt_sng,ptr); 
-  }
+  } /* !is_date */
 
-  /* use custom time functions if irregular calendar */
-  if(is_date && (lmt_cln==cln_360 || lmt_cln==cln_365) )
-    rcd=nco_cln_clc_tm( lcl_unt_sng, fl_bs_sng,lmt_cln,&dval, (var_sct*)NULL);  
-  else
-    rcd=nco_cln_clc_dbl_dff(lcl_unt_sng, fl_bs_sng,&dval);     
-	       	     
+  /* Use custom time functions if irregular calendar */
+  if(is_date && (lmt_cln == cln_360 || lmt_cln == cln_365 || lmt_cln == cln_366)){
+    rcd=nco_cln_clc_tm(lcl_unt_sng,fl_bs_sng,lmt_cln,&val_dbl,(var_sct *)NULL);
+  }else rcd=nco_cln_clc_dbl_dff(lcl_unt_sng,fl_bs_sng,&val_dbl);
 
-  /* only copy over if successfull */ 
-  if(rcd==NCO_NOERR)
-     *og_val=dval;
-    
+  /* Copy over iff successful */ 
+  if(rcd==NCO_NOERR) *og_val=val_dbl; else (void)fprintf(stderr,"%s: ERROR %s: report unt_sng=%s bs_sng=%s calendar=%d og_val=%f\n",nco_prg_nm_get(),fnc_nm,val_unt_sng,fl_bs_sng,lmt_cln, val_dbl);  
+ 
   return rcd;        
-}
+} /* !nco_cln_clc_dbl_org() */
 
-/* This function is only called if the target units in fl_bs_sng of the form "value unit since date-stamp" 
-   and the calendar type is cln_360 or cln_365.
-   either "var" is NULL and there is a single value to process *og_val 
-   or var is initialized and  og_val is NULL  */
 int /* [rcd] Successful conversion returns NCO_NOERR */
 nco_cln_clc_tm /* [fnc] Difference between two coordinate units */
 (const char *fl_unt_sng, /* I [ptr] Units attribute string from disk */
  const char *fl_bs_sng, /* I [ptr] Units attribute string from disk */
  nco_cln_typ lmt_cln, /* [enum] Calendar type of coordinate variable */ 
  double *og_val, /* I/O [ptr] */
- var_sct *var){  /* I/O [ptr] */  
-  int rcd;
-  int year;
-  int month;
-  char *lcl_unt_sng;
-  /* 20141230 figure out better length */
-  char tmp_sng[100];
-  double crr_val;
-  double scl_val;
+ var_sct *var) /* I/O [ptr] */  
+{
+  /* Called for target units in fl_bs_sng of form "value unit since date-stamp" for cln_360 or cln_365
+     Either "var" is NULL and there is a single value to process *og_val or var is initialized and og_val is NULL */
+  const char fnc_nm[]="nco_cln_clc_tm()"; /* [sng] Function name */
+
+  char *tmp_sng;
+
+  double crr_val=0.0;
+  double scl_val=1.0;
 
   tm_typ unt_tm_typ; /* enum for units type in fl_unt_sng */  
   tm_typ bs_tm_typ; /* enum for units type in fl_bs_sng */
@@ -673,25 +637,25 @@ nco_cln_clc_tm /* [fnc] Difference between two coordinate units */
   tm_cln_sct unt_cln_sct;
   tm_cln_sct bs_cln_sct;
   
-  if(nco_dbg_lvl_get() >= nco_dbg_scl) 
-     (void)fprintf(stderr,"%s: nco_cln_clc_tm() reports unt_sng=%s bs_sng=%s\n",nco_prg_nm_get(),fl_unt_sng,fl_bs_sng);
-
-  /* blow out if bad cln type */
-  if(lmt_cln != cln_360 &&  lmt_cln != cln_365)
-  {
-    (void)fprintf(stderr,"%s: nco_cln_clc_tm() has been called with wrong calander types - only cln_365 and cln_360 allowed\n",nco_prg_nm_get());
-    nco_exit(EXIT_FAILURE); 
-  }       
-  
+  /* Die if unsupported calendar type */
+  if(lmt_cln != cln_360 && lmt_cln != cln_365 && lmt_cln != cln_366){
+    (void)fprintf(stderr,"%s: %s reports invalid calendar type lmt_cln=%d. Only cln_365,cln_360 cln_366 allowed.\n",nco_prg_nm_get(),fnc_nm,lmt_cln);
+    nco_exit(EXIT_FAILURE);
+  } /* !lmt_cln */
 
   /* Obtain units type from fl_bs_sng */
+  tmp_sng=(char *)nco_calloc(NCO_MAX_LEN_TMP_SNG,sizeof(char));
   if(sscanf(fl_bs_sng,"%s",tmp_sng) != 1) return NCO_ERR;
-    bs_tm_typ=nco_cln_get_tm_typ(tmp_sng);  
-
-  /* Obtain units type from fl_bs_sng */
-  if(sscanf(fl_unt_sng,"%s",tmp_sng) != 1) return NCO_ERR;
-    unt_tm_typ=nco_cln_get_tm_typ(tmp_sng);  
+  bs_tm_typ=nco_cln_get_tm_typ(tmp_sng);  
+  if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stderr,"%s: %s reports unt_sng=\"%s\", bs_sng=\"%s\", tmp_sng=\"%s\"\n",nco_prg_nm_get(),fnc_nm,fl_unt_sng,fl_bs_sng,tmp_sng);
+  if(tmp_sng) tmp_sng=(char *)nco_free(tmp_sng);
 
+  /* Is unit string a bare date string? */ 
+  tmp_sng=(char *)nco_calloc(NCO_MAX_LEN_TMP_SNG,sizeof(char));
+  if(!strncmp("s@",fl_unt_sng,2)) unt_tm_typ=bs_tm_typ;
+  else if(sscanf(fl_unt_sng,"%s",tmp_sng) == 1) unt_tm_typ=nco_cln_get_tm_typ(tmp_sng);  
+  else return NCO_ERR;
+  if(tmp_sng) tmp_sng=(char *)nco_free(tmp_sng);
   
   /* Assume non-standard calendar */ 
   if(nco_cln_prs_tm(fl_unt_sng,&unt_cln_sct) == NCO_ERR) return NCO_ERR;
@@ -705,69 +669,57 @@ nco_cln_clc_tm /* [fnc] Difference between two coordinate units */
   (void)nco_cln_pop_val(&unt_cln_sct);
   (void)nco_cln_pop_val(&bs_cln_sct);
   
-  /* get offset */
-  crr_val= (unt_cln_sct.value-bs_cln_sct.value) /  nco_cln_val_tm_typ(lmt_cln,bs_tm_typ);                 
+  /* Get offset */
+  crr_val=(unt_cln_sct.value-bs_cln_sct.value)/nco_cln_val_tm_typ(lmt_cln,bs_tm_typ);                 
 
-  /* scale factor */
-  if( unt_tm_typ== bs_tm_typ)
-    scl_val=1.0;
-  else
-    scl_val=nco_cln_val_tm_typ(lmt_cln,unt_tm_typ) / nco_cln_val_tm_typ(lmt_cln,bs_tm_typ);                   ;                    
+  /* Scale factor */
+  if(unt_tm_typ == bs_tm_typ) scl_val=1.0; else scl_val=nco_cln_val_tm_typ(lmt_cln,unt_tm_typ)/nco_cln_val_tm_typ(lmt_cln,bs_tm_typ);
   
-  if(og_val)
-  {   
-    *og_val=*og_val*scl_val+crr_val;     
+  if(nco_dbg_lvl_get() >= nco_dbg_crr){
+    (void)fprintf(stderr,"%s: %s reports offset=%g, scale factor=%g",nco_prg_nm_get(),fnc_nm,crr_val,scl_val);
+    if(og_val) (void)fprintf(stderr,", *og_val=%g",*og_val);
+    (void)fprintf(stderr,"\n");
+  } /* !dbg */
 
-  }
-  else if(var)
-  {
+  if(og_val){
+    *og_val=(*og_val)*scl_val+crr_val;
+  }else if(var){
     size_t sz;
     size_t idx;
-    ptr_unn op1;    
+    ptr_unn op1;
     
     sz=var->sz;  
     op1=var->val;
     (void)cast_void_nctype(var->type,&op1);
 
-    if(var->type == NC_DOUBLE)
-    {
+    if(var->type == NC_DOUBLE){
       double *dp;
       dp=op1.dp;   
-
-      if(var->has_mss_val)
-      {  
+      if(var->has_mss_val){  
 	double mss_dbl=var->mss_val.dp[0]; 
-	for(idx=0; idx<sz; idx++)
-	  if( dp[idx] != mss_dbl) 
-	    dp[idx]= dp[idx]*scl_val+crr_val; 
-      } 
-      else
-	for(idx=0; idx<sz; idx++) 
-          dp[idx]= dp[idx]*scl_val+crr_val; 
-    }
-
-    if(var->type == NC_FLOAT)
-    {
+	for(idx=0;idx<sz;idx++)
+	  if(dp[idx] != mss_dbl) dp[idx]=dp[idx]*scl_val+crr_val; 
+      }else{
+	for(idx=0;idx<sz;idx++) dp[idx]=dp[idx]*scl_val+crr_val; 
+      } /* !var->has_mss_val */
+    } /* !NC_DOUBLE */
+
+    if(var->type == NC_FLOAT){
       float *fp;
       fp=op1.fp;   
-
-      if(var->has_mss_val)
-      {  
-	float mss_ft=var->mss_val.fp[0]; 
-	for(idx=0; idx<sz; idx++)
-	   if( fp[idx] != mss_ft) fp[idx]=fp[idx]*scl_val+crr_val;                      
-      } 
-      else
-	for(idx=0; idx<sz; idx++)
-	  fp[idx]=fp[idx]*scl_val+crr_val;                      
-    }
-
+      if(var->has_mss_val){  
+	float mss_flt=var->mss_val.fp[0]; 
+	for(idx=0;idx<sz;idx++)
+	   if(fp[idx] != mss_flt) fp[idx]=fp[idx]*scl_val+crr_val;                      
+      }else{
+	for(idx=0;idx<sz;idx++) fp[idx]=fp[idx]*scl_val+crr_val;                      
+      } /* !has_mss_val */
+    } /* !NC_FLOAT */
    (void)cast_nctype_void(var->type,&op1);
-
-  }
-  lcl_unt_sng=(char *)nco_free(lcl_unt_sng);
+  } /* !var */
   
   return NCO_NOERR;
+
 } /* end nco_cln_clc_tm() */
 
 int /* [rcd] Successful conversion returns NCO_NOERR */
@@ -777,16 +729,17 @@ nco_cln_prs_tm /* UDUnits2 Extract time stamp from parsed UDUnits string */
 {
   const char fnc_nm[]="nco_cln_prs_tm()"; /* [sng] Function name */
 
-  /* 20141230: fxm figure out a better length */
-  char bfr[200];
+  char *bfr;
 
   char *dt_sng;
-
+  int cnv_nbr;
   int ut_rcd; /* [enm] UDUnits2 status */
 
   ut_system *ut_sys;
   ut_unit *ut_sct_in; /* UDUnits structure, input units */
 
+  bfr=(char *)nco_calloc(NCO_MAX_LEN_TMP_SNG,sizeof(char));
+
   /* When empty, ut_read_xml() uses environment variable UDUNITS2_XML_PATH, if any
      Otherwise it uses default initial location hardcoded when library was built */
   if(nco_dbg_lvl_get() >= nco_dbg_vrb) ut_set_error_message_handler(ut_write_to_stderr); else ut_set_error_message_handler(ut_ignore);
@@ -800,23 +753,38 @@ nco_cln_prs_tm /* UDUnits2 Extract time stamp from parsed UDUnits string */
   ut_sct_in=ut_parse(ut_sys,unt_sng,UT_ASCII); 
   if(ut_sct_in == NULL){ /* Problem with 'units' attribute */
     ut_rcd=ut_get_status(); /* [enm] UDUnits2 status */
-    if(ut_rcd == UT_BAD_ARG) (void)fprintf(stderr,"ERROR: empty units attribute string\n");
-    if(ut_rcd == UT_SYNTAX)  (void)fprintf(stderr,"ERROR: units attribute \"%s\" has a syntax error\n",unt_sng);
-    if(ut_rcd == UT_UNKNOWN) (void)fprintf(stderr,"ERROR: units attribute \"%s\" is not listed in UDUnits2 SI system database\n",unt_sng);
+    if(ut_rcd == UT_BAD_ARG) (void)fprintf(stderr,"%s: ERROR %s reports empty units attribute string\n",nco_prg_nm_get(),fnc_nm);
+    else if(ut_rcd == UT_SYNTAX)  (void)fprintf(stderr,"%s: ERROR %s reports units attribute \"%s\" has a syntax error\n",nco_prg_nm_get(),fnc_nm,unt_sng);
+    else if(ut_rcd == UT_UNKNOWN) (void)fprintf(stderr,"%s: ERROR %s reports units attribute \"%s\" is not listed in UDUnits2 SI system database\n",nco_prg_nm_get(),fnc_nm,unt_sng);
+    else (void)fprintf(stderr,"%s: ERROR %s reports ut_rcd = %d\n",nco_prg_nm_get(),fnc_nm,ut_rcd);
 
     return NCO_ERR; /* Failure */
   } /* endif coordinate on disk has no units attribute */
 
   /* Print timestamp to buffer in standard, dependable format */
-  ut_format(ut_sct_in,bfr,sizeof(bfr),UT_ASCII|UT_NAMES);
+  ut_format(ut_sct_in,bfr,NCO_MAX_LEN_TMP_SNG,UT_ASCII|UT_NAMES);
 
-  /* Extract parsed time units from print string (kludgy)
-     20141230 change to using ut_decode_time() instead? */
-  dt_sng=strstr(bfr,"since");  
-  sscanf(dt_sng,"%*s %d-%d-%d %d:%d:%f",&tm_in->year,&tm_in->month,&tm_in->day,&tm_in->hour,&tm_in->min,&tm_in->sec);
+  /* ut_format string normally ends in the string UTC we wish to terminate the string before this so that sscanf doesnt get confused */
+  dt_sng=strstr(bfr,"UTC");
+  if(dt_sng) *dt_sng='\0';
 
-  ut_free_system(ut_sys); /* Free memory taken by UDUnits library */
+  dt_sng=strstr(bfr,"since");
+  dt_sng+=(size_t)6;
+  cnv_nbr=sscanf(dt_sng,"%d-%d-%d %d:%d:%f",&tm_in->year,&tm_in->month,&tm_in->day,&tm_in->hour,&tm_in->min,&tm_in->sec);
+  
+  /* Set defaults */ 
+  if(cnv_nbr < 6) tm_in->sec=0.0;
+  if(cnv_nbr < 5) tm_in->min=0;   
+  if(cnv_nbr < 4) tm_in->hour=0;   
+
+  if(nco_dbg_lvl_get() >= nco_dbg_crr) (void)fprintf(stderr,"%s: INFO %s reports sscanf() converted %d values and it should have converted 6 values, format string=\"%s\"\n",nco_prg_nm_get(),fnc_nm,cnv_nbr,bfr);
+
+  bfr=(char *)nco_free(bfr);  
   ut_free(ut_sct_in);
+  ut_free_system(ut_sys); /* Free memory taken by UDUnits library */
+
+  /* Return if sscanf() messed up */
+  if(cnv_nbr < 3) return NCO_ERR;
 
   return NCO_NOERR;
 } /* end UDUnits2 nco_cln_prs_tm() */
diff --git a/src/nco/nco_cln_utl.h b/src/nco/nco_cln_utl.h
index c0d97fa..700f0f8 100644
--- a/src/nco/nco_cln_utl.h
+++ b/src/nco/nco_cln_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Calendar utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -50,141 +50,132 @@
 extern "C" {
 #endif /* __cplusplus */
 
-/* Calendar types */
-typedef enum {
-  tm_year=1,    
-  tm_month,
-  tm_day,
-  tm_hour,
-  tm_min,
-  tm_sec,
-  tm_void  /* No time units matched */  
-} tm_typ;
-
-typedef struct {
-  tm_typ sc_typ;
-  nco_cln_typ sc_cln;
-  int year;
-  int month;
-  int day;
-  int hour;
-  int min;
-  float sec;
-  double value;
-} tm_cln_sct;
-
-int /* O [nbr] Number of days to end of month */
-nco_nd2endm /* [fnc] Compute number of days to end of month */
-(const int mth, /* I [mth] Month */
- const int day); /* I [day] Current day */
-
-nco_int /* O [YYMMDD] Date a specified number of days from input date */
-nco_newdate /* [fnc] Compute date a specified number of days from input date */
-(const nco_int date, /* I [YYMMDD] Date */
- const nco_int day_srt); /* I [day] Days ahead of input date */
-
-tm_typ /* [enum] Units type */
-nco_cln_get_tm_typ( /* returns time unit type or tm_void if not found */
-const char *ud_sng); /* I [ptr] units string */
-
-
-nco_cln_typ /* [enum] Calendar type */    
-nco_cln_get_cln_typ( /* [fnc] Calendar type or cln_nil if not found */
-const char *ud_sng); /* I [ptr] units string */
-
-int /* O [int] number of days */
-nco_cln_days_in_year_prior_to_given_month( /* [fnc] Number of days in year prior to month */
-nco_cln_typ lmt_cln, /* [enum] calendar type */
-int mth_idx); /* I [idx] Month (1-based counting, December == 12) */
-
-void
-nco_cln_pop_val( /* [fnc] Calculate value in cln_sct */ 
-tm_cln_sct *cln_sct);/* I/O [ptr] Calendar structure */
-
-double /* O [dbl] time in (base) seconds of tm_typ */
-nco_cln_val_tm_typ( /* [fnc] */
-nco_cln_typ lmt_cln, /* I [enum] Calendar type */
-tm_typ bs_tm_typ); /* I [enum] Time units */
-
-
-int /* O [flg] String is calendar date */
-nco_cln_chk_tm /* [fnc] Is string a UDUnits-compatible calendar format, e.g., "PERIOD since REFERENCE_DATE" */
-(const char *unit_sng); /* I [sng] Units string */
-
-#ifndef ENABLE_UDUNITS
-
-int    /* [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_dbl_var_dff( /* [fnc] difference between two co-ordinate units */
-const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
-nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *dval,           /* I/O [dbl] var values modified */
-var_sct *var);           /* I/O [var_sct] var values modified */
-
-int   /* [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_dbl_org(   /* [fnc] difference between two co-ordinate units */
-const char *val_unt_sng, /* I [ptr] input value and  units in the same string */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
-nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *og_val);         /* O [dbl] output value */
-
-#endif
-
-
+  /* Calendar types */
+  typedef enum {
+    tm_year=1,    
+    tm_month,
+    tm_day,
+    tm_hour,
+    tm_min,
+    tm_sec,
+    tm_void  /* No time units matched */  
+  } tm_typ;
+  
+  typedef struct {
+    tm_typ sc_typ;
+    nco_cln_typ sc_cln;
+    int year;
+    int month;
+    int day;
+    int hour;
+    int min;
+    float sec;
+    double value;
+  } tm_cln_sct;
+  
+  int /* O [nbr] Number of days to end of month */
+  nco_nd2endm /* [fnc] Compute number of days to end of month */
+  (const int mth, /* I [mth] Month */
+   const int day); /* I [day] Current day */
+  
+  nco_int /* O [YYMMDD] Date a specified number of days from input date */
+  nco_newdate /* [fnc] Compute date a specified number of days from input date */
+  (const nco_int date, /* I [YYMMDD] Date */
+   const nco_int day_srt); /* I [day] Days ahead of input date */
+  
+  tm_typ /* [enum] Units type */
+  nco_cln_get_tm_typ /* returns time unit type or tm_void if not found */
+  (const char *ud_sng); /* I [ptr] units string */
+  
+  nco_cln_typ /* [enum] Calendar type */    
+  nco_cln_get_cln_typ /* [fnc] Calendar type or cln_nil if not found */
+  (const char *ud_sng); /* I [ptr] units string */
+  
+  int /* O [int] number of days */
+  nco_cln_days_in_year_prior_to_given_month /* [fnc] Number of days in year prior to month */
+  (nco_cln_typ lmt_cln, /* [enum] calendar type */
+   int mth_idx); /* I [idx] Month (1-based counting, December == 12) */
+  
+  void
+  nco_cln_pop_val /* [fnc] Calculate value in cln_sct */ 
+  (tm_cln_sct *cln_sct);/* I/O [ptr] Calendar structure */
+  
+  double /* O [dbl] time in (base) seconds of tm_typ */
+  nco_cln_val_tm_typ /* [fnc] */
+  (nco_cln_typ lmt_cln, /* I [enum] Calendar type */
+   tm_typ bs_tm_typ); /* I [enum] Time units */
+  
+  int /* O [flg] String is calendar date */
+  nco_cln_chk_tm /* [fnc] Is string a UDUnits-compatible calendar format, e.g., "PERIOD since REFERENCE_DATE" */
+  (const char *unit_sng); /* I [sng] Units string */
+
+  int /* [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_var_dff /* [fnc] difference between two co-ordinate units */
+  (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+   const char *fl_bs_sng, /* I [ptr] units attribute string from disk */
+   var_sct *var); /* I/O [dbl] var values modified */
+  
+  int /* [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_dbl_var_dff /* [fnc] difference between two co-ordinate units */
+  (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+   const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
+   nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
+   double *val_dbl,           /* I/O [dbl] var values modified */
+   var_sct *var);           /* I/O [var_sct] var values modified */
+  
 #ifdef ENABLE_UDUNITS
-#ifdef HAVE_UDUNITS2_H
-
-cv_converter*   /* UDUnits converter */
-nco_cln_cnv_mk  /* [fnc] UDUnits2 create a custom converter  */
-(const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
- const char *fl_bs_sng);/* I [ptr] units attribute string from disk */
-
-
-int    /* [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_dbl_var_dff( /* [fnc] difference between two co-ordinate units */
-const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
-nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *dval,           /* I/O [dbl] var values modified */
-var_sct *var);           /* I/O [var_sct] var values modified */
-
-int   /* [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_dbl_org(   /* [fnc] difference between two co-ordinate units */
-const char *val_unt_sng, /* I [ptr] input value and  units in the same string */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
-nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
-double *og_val);         /* O [dbl] output value */
-
-
-int /* O [flg] NCO_NOERR or NCO_ERR */ 
-nco_cln_clc_tm( /* [fnc] Difference between two time coordinate units */
-const char *fl_unt_sng, /* I [ptr] user units attribute string */
-const char *fl_bs_sng,  /* I [ptr] units attribute string from disk  */     
-nco_cln_typ lmt_cln,  /* [enm] Calendar type of coordinate var */ 
-double *rgn_val, /* I/O [ptr] time diff in units based on fl_bs_sng */ 
-var_sct *var);   /* I/O [ptr]  */ 
-
-
-int /* [flg] NCO_NOERR or NCO_ERR */
-nco_cln_prs_tm( /* Extract time stamp from a parsed udunits string */
-const char *unt_sng, /* I [ptr] units attribute string */  
-tm_cln_sct *tm_in); /*  O [sct] struct to be populated */
-
-
-int /* [rcd] Return code */
-nco_cln_sng_rbs /* [fnc] Rebase calendar string for legibility */
-(const ptr_unn val, /* I [sct] Value to rebase */
- const long val_idx, /* I [idx] Index into 1-D array of values */
- const nc_type val_typ, /* I [enm] Value type */
- const char *unit_sng, /* I [sng] Units string */
- char *lgb_sng); /* O [sng] Legible version of input string */
-
+# ifdef HAVE_UDUNITS2_H
 
+  cv_converter * /* UDUnits converter */
+  nco_cln_cnv_mk /* [fnc] UDUnits2 create a custom converter  */
+  (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+   const char *fl_bs_sng);/* I [ptr] units attribute string from disk */
+
+  int /* [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_dbl_var_dff /* [fnc] difference between two co-ordinate units */
+  (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+   const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
+   nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
+   double *val_dbl,           /* I/O [dbl] var values modified */
+   var_sct *var);           /* I/O [var_sct] var values modified */
+
+  int /* [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_dbl_dff /* [fnc] difference between two co-ordinate units */
+  (const char *fl_unt_sng, /* I [ptr] units attribute string from disk */
+   const char *fl_bs_sng, /* I [ptr] units attribute string from disk */
+   double *og_val);
+
+  int /* [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_dbl_org   /* [fnc] difference between two co-ordinate units */
+  (const char *val_unt_sng, /* I [ptr] input value and  units in the same string */
+   const char *fl_bs_sng,  /* I [ptr] units attribute string from disk */
+   nco_cln_typ lmt_cln,    /* I [enum] Calendar type of coordinate var */ 
+   double *og_val);         /* O [dbl] output value */
+  
+  int /* O [flg] NCO_NOERR or NCO_ERR */ 
+  nco_cln_clc_tm /* [fnc] Difference between two time coordinate units */
+  (const char *fl_unt_sng, /* I [ptr] user units attribute string */
+   const char *fl_bs_sng,  /* I [ptr] units attribute string from disk  */     
+   nco_cln_typ lmt_cln,  /* [enm] Calendar type of coordinate var */ 
+   double *rgn_val, /* I/O [ptr] time diff in units based on fl_bs_sng */ 
+   var_sct *var);   /* I/O [ptr]  */ 
+  
+  int /* [flg] NCO_NOERR or NCO_ERR */
+  nco_cln_prs_tm /* Extract time stamp from a parsed udunits string */
+  (const char *unt_sng, /* I [ptr] units attribute string */  
+   tm_cln_sct *tm_in); /*  O [sct] struct to be populated */
+
+  int /* [rcd] Return code */
+  nco_cln_sng_rbs /* [fnc] Rebase calendar string for legibility */
+  (const ptr_unn val, /* I [sct] Value to rebase */
+   const long val_idx, /* I [idx] Index into 1-D array of values */
+   const nc_type val_typ, /* I [enm] Value type */
+   const char *unit_sng, /* I [sng] Units string */
+   char *lgb_sng); /* O [sng] Legible version of input string */
 
-#endif /* !HAVE_UDUNITS2_H */
+# endif /* !HAVE_UDUNITS2_H */
 #endif /* !ENABLE_UDUNITS */
 
-
 #ifdef __cplusplus
 } /* end extern "C" */
 #endif /* __cplusplus */
diff --git a/src/nco/nco_cnf_dmn.c b/src/nco/nco_cnf_dmn.c
index f1b2494..63bc8bd 100644
--- a/src/nco/nco_cnf_dmn.c
+++ b/src/nco/nco_cnf_dmn.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Conform dimensions between variables */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnf_dmn.h b/src/nco/nco_cnf_dmn.h
index ac68c90..82cbd1c 100644
--- a/src/nco/nco_cnf_dmn.h
+++ b/src/nco/nco_cnf_dmn.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Conform dimensions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnf_typ.c b/src/nco/nco_cnf_typ.c
index 4691a2e..6c54888 100644
--- a/src/nco/nco_cnf_typ.c
+++ b/src/nco/nco_cnf_typ.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Conform variable types */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnf_typ.h b/src/nco/nco_cnf_typ.h
index 9f09a17..afd699a 100644
--- a/src/nco/nco_cnf_typ.h
+++ b/src/nco/nco_cnf_typ.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Conform variable types */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnk.c b/src/nco/nco_cnk.c
index 929cb39..a960d18 100644
--- a/src/nco/nco_cnk.c
+++ b/src/nco/nco_cnk.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO utilities for chunking */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -191,22 +191,6 @@ nco_cnk_ini /* [fnc] Initialize chunking from user-specified inputs */
     cnk->cnk_sz_byt= (fl_sys_blk_sz > 0ULL) ? fl_sys_blk_sz : NCO_CNK_SZ_BYT_DFL;
   } /* end else */
     
-  if(cnk_csh_byt > 0ULL){
-    /* Use user-specified chunk cache size if available */
-    cnk->cnk_csh_byt=cnk_csh_byt;
-    // 20161128: Placeholder for Jerome 
-    // if(nco_dbg_lvl_get() == nco_dbg_jm){
-    //  nco_set_chunk_cache(cnk_csh_byt);
-    // } 
-  }else{
-    /* Otherwise use filesystem blocksize if valid, otherwise use Linux default */
-    size_t cnk_csh_byt_lbr; /* [B] Chunk cache size in library */
-    size_t nelemsp; /* [nbr] Chunk slots in raw data chunk cache hash table */
-    float pmp_fvr_frc; /* [frc] Preemption favor fraction */
-    nco_get_chunk_cache(&cnk_csh_byt_lbr,&nelemsp,&pmp_fvr_frc);
-    if(nco_dbg_lvl_get() >= nco_dbg_scl) (void)fprintf(stderr,"%s: INFO %s reports cnk_csh_byt_lbr = %ld, nelemsp = %ld, pmp_fvr_frc = %g\n",nco_prg_nm_get(),fnc_nm,cnk_csh_byt_lbr,nelemsp,pmp_fvr_frc);
-  } /* end else */
-
   /* Java chunking defaults:
      http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/reference/netcdf4Clibrary.html */
   if(cnk_min_byt == 0ULL) cnk->cnk_min_byt= (fl_sys_blk_sz > 0ULL) ? 2*fl_sys_blk_sz : NCO_CNK_SZ_MIN_BYT_DFL;
@@ -234,7 +218,7 @@ nco_cnk_ini /* [fnc] Initialize chunking from user-specified inputs */
       cnk->cnk_plc=nco_cnk_plc_xst;
     }else{
       /* Input is netCDF3 so choose chunking judiciously unless otherwise specified */
-      if(nco_dbg_lvl_get() > nco_dbg_scl) (void)fprintf(stderr,"%s: INFO Input file format %s does not support chunking and no chunking policy or map specified so output chunking format will use NCO (not netCDF) defaults\n",nco_prg_nm_get(),nco_fmt_sng(fl_in_fmt));
+      if(nco_dbg_lvl_get() > nco_dbg_scl) (void)fprintf(stderr,"%s: INFO %s reports input file format %s does not support chunking and no chunking policy or map specified so output chunking format will use NCO (not netCDF) defaults\n",nco_prg_nm_get(),fnc_nm,nco_fmt_sng(fl_in_fmt));
       cnk->cnk_map=nco_cnk_map_nco;
       cnk->cnk_plc=nco_cnk_plc_nco;
     } /* endif dbg */
diff --git a/src/nco/nco_cnk.h b/src/nco/nco_cnk.h
index 3a435c1..773c8f0 100644
--- a/src/nco/nco_cnk.h
+++ b/src/nco/nco_cnk.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of chunking functions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnv_arm.c b/src/nco/nco_cnv_arm.c
index 4b6157e..01941b3 100644
--- a/src/nco/nco_cnv_arm.c
+++ b/src/nco/nco_cnv_arm.c
@@ -2,7 +2,7 @@
 
 /* Purpose: ARM conventions, e.g., http://www.arm.gov/data/time.stm */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnv_arm.h b/src/nco/nco_cnv_arm.h
index 1f23738..00dea4b 100644
--- a/src/nco/nco_cnv_arm.h
+++ b/src/nco/nco_cnv_arm.h
@@ -2,7 +2,7 @@
 
 /* Purpose: ARM conventions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnv_csm.c b/src/nco/nco_cnv_csm.c
index a37d378..b9e3929 100644
--- a/src/nco/nco_cnv_csm.c
+++ b/src/nco/nco_cnv_csm.c
@@ -2,7 +2,7 @@
 
 /* Purpose: CCM/CCSM/CF conventions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_cnv_csm.h b/src/nco/nco_cnv_csm.h
index 81118b1..f16192d 100644
--- a/src/nco/nco_cnv_csm.h
+++ b/src/nco/nco_cnv_csm.h
@@ -2,7 +2,7 @@
 
 /* Purpose: CCM/CCSM/CF conventions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_ctl.c b/src/nco/nco_ctl.c
index 90a12b3..341f80d 100644
--- a/src/nco/nco_ctl.c
+++ b/src/nco/nco_ctl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Program flow control functions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -502,7 +502,7 @@ nco_exit /* [fnc] Wrapper for exit() */
   if(rcd == EXIT_SUCCESS){
     exit(rcd);
   }else{
-    if(nco_dbg_lvl_get() >= nco_dbg_scl) (void)fprintf(stdout,"%s: ERROR exiting through %s which will now call %s\n",nco_prg_nm_get(),fnc_nm,exit_nm);
+    if(nco_dbg_lvl_get() >= nco_dbg_std) (void)fprintf(stdout,"%s: ERROR Exiting through %s which will now call %s\n",nco_prg_nm_get(),fnc_nm,exit_nm);
 #ifdef NCO_ABORT_ON_ERROR
     abort();
 #else /* !NCO_ABORT_ON_ERROR */
@@ -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 "Hip\n";
+  return "JAWS\n";
 } /* end nco_nmn_get() */
 
 char * /* O [sng] nm_in stripped of any path (i.e., program name stub) */ 
@@ -960,35 +960,35 @@ nco_usg_prn(void)
     opt_sng=(char *)strdup("[-a ...] [--bfr byt] [-D nco_dbg_lvl] [--glb ...] [-h] [--hdr_pad nbr] [-l path] [-O] [-o out.nc] [-p path] [-R] [-r] [-t] in.nc [[out.nc]]\n");
     break;
   case ncbo:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--msa] [-n ...] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [-R] [-r] [--ram_all] [-t thr_nbr] [--unn] [-v ...] [-X box] [-x] [-y op_typ] in_1.nc in_2.nc [out.nc]\n");
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--msa] [-n ...] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [-R] [-r] [--ram_all] [-t thr_nbr] [--unn] [-v ...] [-X box] [-x] [-y op_typ] in_1.nc in_2.nc [out.nc]\n");
     break;
   case ncflint:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_crd] [--fl_fmt fmt] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-i var,val] [-L lvl] [-l path] [--msa] [--no_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");
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_crd] [--fl_fmt fmt] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-i var,val] [-L lvl] [-l path] [--msa] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-v ...] [-X box] [-x] [-w wgt_1[,wgt_2]] in_1.nc in_2.nc  [...]
     break;
   case ncks:
-    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr byt] [-C] [-c] [--cdl] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [--jsn] [--jsn_fmt lvl] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim] [--msa] [--no_blank] [-- [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-5] [-6] [-7] [-A] [-a] [-b fl_bnr] [--bfr byt] [-C] [-c] [--cdl] [--cnk_byt byt] [--cnk_csh byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fix_rec_dmn dim] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [--grp_xtr_var_xcl] [-H] [-h] [--hdn] [--hdr_pad nbr] [--jsn] [--jsn_fmt lvl] [-L lvl] [-l path] [-M] [-m] [--map map.nc] [--md5_dgs] [--md5_wrt] [--mk_rec_dmn dim] [--msa]  [...]
     break;
   case ncpdq:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [-a ...] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [-M pck_map] [--mrd] [--msa] [--no_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");
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [-a ...] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [-M pck_map] [--mrd] [--msa] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-P pck_plc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [--unn] [-U] [-v ...]  [...]
     break;
   case ncra:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cb] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...]  [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--mro] [--msa] [-N] [-n ...] [--no_cll_mth] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn] [-t thr_nbr] [--unn] [-w wgt] [-v  [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cb] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...]  [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--mro] [--msa] [-N] [-n ...] [--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn] [-t  [...]
     break;
   case ncfe:
   case ncge:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...]  [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--msa] [-n ...] [--no_tmp_fl] [--nsm_fl] [--nsm_grp] [--nsm_sfx] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [--unn] [-v ...] [-X box] [-x] [- [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...]  [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdf] [--hdr_pad nbr] [-L lvl] [-l path] [--msa] [-n ...] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [--nsm_fl] [--nsm_grp] [--nsm_sfx] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-- [...]
     break;
   case ncrcat:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdr_pad nbr] [-L lvl] [-l path] [--md5_digest] [--msa] [-n ...] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn] [-t thr_nbr] [--unn] [-v ...] [-X box] [-x] in.nc [...] [out.nc]\n");
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-H] [-h] [--hdr_pad nbr] [-L lvl] [-l path] [--md5_digest] [--msa] [-n ...] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [--rec_apn] [-t thr_nbr] [--unn] [-v ...] [-X box] [-x] i [...]
     break;
   case ncecat:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--gag] [--glb ...] [-H] [-h] [--hdr_pad nbr] [-L lvl] [-l path] [-M] [--md5_digest] [--mrd] [--msa] [-n ...] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-u ulm_nm] [--unn] [-v ...] [-X box] [-x] in.nc [... [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--gag] [--glb ...] [-H] [-h] [--hdr_pad nbr] [-L lvl] [-l path] [-M] [--md5_digest] [--mrd] [--msa] [-n ...] [--no_cll_msr] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-t thr_nbr] [-u ulm_nm] [--unn] [-v [...]
     break;
   case ncrename:
     opt_sng=(char *)strdup("[-a ...] [--bfr byt] [-D nco_dbg_lvl] [-d ...] [-g ...] [--glb ...] [-h] [--hdr_pad nbr] [-l path] [-O] [-o out.nc] [-p path] [-R] [-r] [-v ...] in.nc [[out.nc]]\n");
     break;
   case ncwa:
-    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [-a ...] [-B mask_cond] [-b] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-I] [-L lvl] [-l path] [-m mask] [-M mask_val] [-N] [--no_cll_mth] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_all] [-T mask_comp] [-t thr_nbr [...]
+    opt_sng=(char *)strdup("[-3] [-4] [-6] [-7] [-A] [-a ...] [-B mask_cond] [-b] [--bfr byt] [-C] [-c] [--cnk_byt byt] [--cnk_dmn nm,lmn] [--cnk_map map] [--cnk_min byt] [--cnk_plc plc] [--cnk_scl sz] [-D nco_dbg_lvl] [-d ...] [--dbl|flt] [-F] [--fl_fmt fmt] [-G grp:lvl] [-g ...] [--glb ...] [-h] [--hdf] [--hdr_pad nbr] [-I] [-L lvl] [-l path] [-m mask] [-M mask_val] [-N] [--no_cll_msr] [--no_cll_mth] [--no_frm_trm] [--no_tmp_fl] [-O] [-o out.nc] [-p path] [--ppc ...] [-R] [-r] [--ram_a [...]
     break;
   default: nco_dfl_case_prg_id_err(); break;
   } /* end switch */
@@ -1028,9 +1028,10 @@ nco_usg_prn(void)
   if(strstr(opt_sng,"--cb")) (void)fprintf(stdout,"    --cb, --clm_bnd\tCF Climatology bounds will be processed (see also --c2b)\n");
   if(strstr(opt_sng,"--cdl")) (void)fprintf(stdout,"    --cdl\t\tPrint CDL (netCDF lingua franca used by ncdump/ncgen)\n");
   if(strstr(opt_sng,"--cnk_byt")) (void)fprintf(stdout,"    --cnk_byt, --chunk_byte sz_byt\tChunksize in bytes\n");
+  if(strstr(opt_sng,"--cnk_csh")) (void)fprintf(stdout,"    --cnk_csh, --chunk_cache sz_byt\tChunk cache size in bytes\n");
   if(strstr(opt_sng,"--cnk_dmn")) (void)fprintf(stdout,"    --cnk_dmn, --chunk_dimension nm,sz_lmn\tChunksize of dimension nm (in elements not bytes)\n");
   if(strstr(opt_sng,"--cnk_map")) (void)fprintf(stdout,"    --cnk_map, --chunk_map map\t\tChunking map [dmn,lfp,nc4,nco,prd,rd1,rew,scl,xpl,xst]\n");
-  if(strstr(opt_sng,"--cnk_min")) (void)fprintf(stdout,"    --cnk_min, --chunk_min sz_byt\t\tMinimum size [B] of variable to chunk\n");
+  if(strstr(opt_sng,"--cnk_min")) (void)fprintf(stdout,"    --cnk_min, --chunk_min sz_byt\tMinimum size [B] of variable to chunk\n");
   if(strstr(opt_sng,"--cnk_plc")) (void)fprintf(stdout,"    --cnk_plc, --chunk_policy plc\tChunking policy [all,g2d,g3d,xpl,xst,uck]\n");
   if(strstr(opt_sng,"--cnk_scl")) (void)fprintf(stdout,"    --cnk_scl, --chunk_scalar sz_lmn\tChunksize scalar (in elements not bytes) (for all dimensions)\n");
   if(strstr(opt_sng,"[-D")) (void)fprintf(stdout,"-D, --dbg_lvl, --debug-level lvl\tDebug-level is lvl\n");
@@ -1100,7 +1101,9 @@ nco_usg_prn(void)
     if(prg_lcl != ncwa) (void)fprintf(stdout,"-n, --nintap nbr_files,[nbr_numeric_chars[,increment]] NINTAP-style abbreviation of file list\n");
   } /* !-n */
   if(strstr(opt_sng,"--no_blank")) (void)fprintf(stdout,"    --no_blank\t\tPrint numeric missing values instead of blanks (underscores)\n");
+  if(strstr(opt_sng,"--no_cll_msr")) (void)fprintf(stdout,"    --no_cll_msr\tDo not extract cell_measures variables\n");
   if(strstr(opt_sng,"--no_cll_mth")) (void)fprintf(stdout,"    --no_cll_mth\tDo not add/modify cell_methods attributes\n");
+  if(strstr(opt_sng,"--no_frm_trm")) (void)fprintf(stdout,"    --no_frm_trm\tDo not extract formula_terms variables\n");
   if(strstr(opt_sng,"--no_tmp_fl")) (void)fprintf(stdout,"    --no_tmp_fl\t\tDo not write output to temporary file\n");
   if(strstr(opt_sng,"--nsm_fl")) (void)fprintf(stdout,"    --nsm_fl, --ensemble_file\tEnsembles comprise equally weighted files\n");
   if(strstr(opt_sng,"--nsm_grp")) (void)fprintf(stdout,"    --nsm_grp, --ensemble_group\tEnsembles comprise equally weighted groups\n");
diff --git a/src/nco/nco_ctl.h b/src/nco/nco_ctl.h
index 4fc2aeb..7d87acf 100644
--- a/src/nco/nco_ctl.h
+++ b/src/nco/nco_ctl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Program flow control functions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_dbg.c b/src/nco/nco_dbg.c
index fe2e5fa..266cb66 100644
--- a/src/nco/nco_dbg.c
+++ b/src/nco/nco_dbg.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Debugging */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_dbg.h b/src/nco/nco_dbg.h
index c72759c..433698c 100644
--- a/src/nco/nco_dbg.h
+++ b/src/nco/nco_dbg.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Debugging */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_dmn_utl.c b/src/nco/nco_dmn_utl.c
index 7d2ff9f..83d4690 100644
--- a/src/nco/nco_dmn_utl.c
+++ b/src/nco/nco_dmn_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Dimension utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_dmn_utl.h b/src/nco/nco_dmn_utl.h
index c27bf74..bb77fd9 100644
--- a/src/nco/nco_dmn_utl.h
+++ b/src/nco/nco_dmn_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Dimension utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_fl_utl.c b/src/nco/nco_fl_utl.c
index 2b6d39d..cfb697f 100644
--- a/src/nco/nco_fl_utl.c
+++ b/src/nco/nco_fl_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: File manipulation */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -108,7 +108,7 @@ nco_fl_fmt_vet /* [fnc] Verify output file format supports requested actions */
 {
   /* Purpose: Verify output file format supports requested actions */
   if(cnk_nbr > 0 && !(fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC)) (void)fprintf(stdout,"%s: WARNING Attempt to chunk variables in output file which has netCDF format %s. Chunking is only supported by netCDF filetypes NC_FORMAT_NETCDF4 and NC_FORMAT_NETCDF4_CLASSIC. Command will attempt to complete but without chunking. HINT: re-run command and change output type to netCDF4 using \"-4\", \"--fl_fmt=netcdf4\", or \"--fl_fmt=netcdf4_classic\" option.\n",nco_prg_nm_g [...]
-  if(dfl_lvl >= 0 && !(fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC)) (void)fprintf(stdout,"%s: WARNING Attempt to deflate (compress) variables in output file which has netCDF format %s. Deflation is only supported by netCDF filetypes NC_FORMAT_NETCDF4 and NC_FORMAT_NETCDF4_CLASSIC. Command will attempt to complete but without deflation. HINT: re-run command and change output type to netCDF4 using \"-4\", (same as \"--fl_fmt=netcdf4\"), or \"-7\" (same as \"--fl_fmt [...]
+  if(dfl_lvl > 0 && !(fl_fmt == NC_FORMAT_NETCDF4 || fl_fmt == NC_FORMAT_NETCDF4_CLASSIC)) (void)fprintf(stdout,"%s: WARNING Attempt to deflate (compress) variables in output file which has netCDF format %s. Deflation is only supported by netCDF filetypes NC_FORMAT_NETCDF4 and NC_FORMAT_NETCDF4_CLASSIC. Command will attempt to complete but without deflation. HINT: re-run command and change output type to netCDF4 using \"-4\", (same as \"--fl_fmt=netcdf4\"), or \"-7\" (same as \"--fl_fmt= [...]
 } /* end nco_nco_fl_fmt_vet() */
 
 void
diff --git a/src/nco/nco_fl_utl.h b/src/nco/nco_fl_utl.h
index 120d654..a375b18 100644
--- a/src/nco/nco_fl_utl.h
+++ b/src/nco/nco_fl_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: File manipulation */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_grp_trv.c b/src/nco/nco_grp_trv.c
index 0abf20d..d544942 100644
--- a/src/nco/nco_grp_trv.c
+++ b/src/nco/nco_grp_trv.c
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF4 traversal storage */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_grp_trv.h b/src/nco/nco_grp_trv.h
index 8787049..a0fbc34 100644
--- a/src/nco/nco_grp_trv.h
+++ b/src/nco/nco_grp_trv.h
@@ -2,7 +2,7 @@
 
 /* Purpose: netCDF4 traversal storage */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_grp_utl.c b/src/nco/nco_grp_utl.c
index 40978c9..c174f31 100644
--- a/src/nco/nco_grp_utl.c
+++ b/src/nco/nco_grp_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Group utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -1041,7 +1041,7 @@ nco_xtr_crd_add                       /* [fnc] Add all coordinates to extraction
 void
 nco_xtr_cf_add /* [fnc] Add to extraction list variables associated with CF convention */
 (const int nc_id, /* I [ID] netCDF file ID */
- const char * const cf_nm, /* I [sng] CF convention ("ancillary_variables", "bounds", "climatology", or "coordinates") */
+ const char * const cf_nm, /* I [sng] CF convention ("ancillary_variables", "bounds", "climatology", "coordinates", or "grid_mapping") */
  trv_tbl_sct * const trv_tbl) /* I/O [sct] GTT (Group Traversal Table) */
 {
   /* Add to extraction list all variables associated with specified CF convention
@@ -1066,15 +1066,15 @@ void
 nco_xtr_cf_var_add /* [fnc] Add variables associated (via CF) with specified variable to extraction list */
 (const int nc_id, /* I [ID] netCDF file ID */
  const trv_sct * const var_trv, /* I [sct] Variable (object) */
- const char * const cf_nm, /* I [sng] CF convention ("ancillary_variables", "bounds", "climatology", "coordinates", and "grid_mapping") */
+ const char * const cf_nm, /* I [sng] CF convention ("ancillary_variables", "bounds", "climatology", "coordinates", or "grid_mapping") */
  trv_tbl_sct * const trv_tbl) /* I/O [sct] GTT (Group Traversal Table) */
 {
-  /* Detect associated variables specified by CF "ancillary_variables", "bounds", "climatology", "coordinates", and "grid_mapping" convention
+  /* Detect associated variables specified by CF "ancillary_variables", "bounds", "climatology", "coordinates", and "grid_mapping" conventions
      Private routine called by nco_xtr_cf_add()
      http://cfconventions.org/1.6.html#ancillary-data
      http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.1/cf-conventions.html#coordinate-system */ 
 
-  char **cf_lst; /* [sng] 1D array of list elements */
+  char **cf_lst=NULL_CEWI; /* [sng] 1D array of list elements */
   char att_nm[NC_MAX_NAME+1L]; /* [sng] Attribute name */
 
   const char dlm_sng[]=" "; /* [sng] Delimiter string */
@@ -1115,7 +1115,34 @@ nco_xtr_cf_var_add /* [fnc] Add variables associated (via CF) with specified var
 
       /* Split list into separate coordinate names
 	 Use nco_lst_prs_sgl_2D() not nco_lst_prs_2D() to avert TODO nco944 */
-      cf_lst=nco_lst_prs_sgl_2D(att_val,dlm_sng,&nbr_cf);
+      if(!strcmp("cell_measures",cf_nm) || !strcmp("formula_terms",cf_nm)){
+	/* cell_measures and formula_terms use this syntax to list variables required to know grid or evaluate formula:
+	   orog:cell_measures = "area: areacella"
+	   lev:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate"
+	   lev:formula_terms = "a: hyam b: hybm p0: P0 ps: PS" */
+	/* static short FIRST_WARNING=True;
+        if(FIRST_WARNING) (void)fprintf(stderr,"%s: WARNING %s reports that variables necessary to evaluate \"%s\" formula for variable %s are not yet extracted. This WARNING is printed only once per invocation.\n",nco_prg_nm_get(),fnc_nm,att_nm,var_trv->nm_fll);
+	FIRST_WARNING=False; */
+	nbr_cf=0;
+	char *cln_ptr=att_val;
+	char *spc_ptr=NULL;
+	long var_lng;
+	while((cln_ptr=strstr(cln_ptr,": "))){
+	  spc_ptr=strchr(cln_ptr+2L,' ');
+	  if(spc_ptr) var_lng=spc_ptr-cln_ptr-2L; else var_lng=strlen(cln_ptr+2L);
+	  cf_lst=(char **)nco_realloc(cf_lst,(nbr_cf+1)*sizeof(char *));
+	  cf_lst[nbr_cf]=(char *)nco_malloc(var_lng*sizeof(char)+1L);
+          *(cf_lst[nbr_cf]+var_lng)='\0';
+          strncpy(cf_lst[nbr_cf],cln_ptr+2L,var_lng);
+	  cln_ptr+=var_lng;
+	  if(nco_dbg_lvl_get() >= nco_dbg_var) (void)fprintf(stderr,"%s: DEBUG %s reports variable %s %s variable #%d is %s\n",nco_prg_nm_get(),fnc_nm,var_trv->nm_fll,att_nm,nbr_cf,cf_lst[nbr_cf]);
+	  nbr_cf++;
+	} /* !att_val */
+      }else{
+	/* All CF attributes that NCO handles besides "cell_measures" and "formula_terms" are space-separated lists */
+	cf_lst=nco_lst_prs_sgl_2D(att_val,dlm_sng,&nbr_cf);
+      } /* !formula_terms */
+      
       /* ...for each variable in CF convention attribute, i.e., for each variable listed in "ancillary_variables", or in "bounds", or in "coordinates", or in "grid_mapping", ... */
       for(int idx_cf=0;idx_cf<nbr_cf;idx_cf++){
         char *cf_lst_var=cf_lst[idx_cf];
@@ -1363,7 +1390,7 @@ nco_xtr_crd_ass_add                   /* [fnc] Add to extraction list all coordi
   } /* Loop table */
 
   return;
-} /* end nco_xtr_crd_ass_cdf_add */
+} /* end nco_xtr_crd_ass_add() */
 
 void 
 nco_xtr_lst_prn /* [fnc] Print name-ID structure list */
@@ -6411,6 +6438,8 @@ nco_bld_trv_tbl                       /* [fnc] Construct GTT, Group Traversal Ta
  const nco_bool GRP_XTR_VAR_XCL,      /* I [flg] Extract matching groups, exclude matching variables */
  const nco_bool EXCLUDE_INPUT_LIST,   /* I [flg] Exclude rather than extract groups and variables specified with -v */ 
  const nco_bool EXTRACT_ASSOCIATED_COORDINATES, /* I [flg] Extract all coordinates associated with extracted variables? */
+ const nco_bool EXTRACT_CLL_MSR, /* I [flg] Extract cell_measures variables */
+ const nco_bool EXTRACT_FRM_TRM, /* I [flg] Extract formula_terms variables */
  const int nco_pck_plc,               /* I [enm] Packing policy */
  nco_dmn_dne_t **flg_dne,             /* I/O [lst] Flag to check if input dimension -d "does not exist" */
  trv_tbl_sct * const trv_tbl)         /* I/O [sct] Traversal table */
@@ -6497,12 +6526,16 @@ nco_bld_trv_tbl                       /* [fnc] Construct GTT, Group Traversal Ta
   } /* endif */
   if(CNV_CCM_CCSM_CF && EXTRACT_ASSOCIATED_COORDINATES){
     /* Implement CF "ancillary_variables", "bounds", "climatology", "coordinates", and "grid_mapping" */
+    if(EXTRACT_CLL_MSR) (void)nco_xtr_cf_add(nc_id,"cell_measures",trv_tbl);
+    if(EXTRACT_FRM_TRM) (void)nco_xtr_cf_add(nc_id,"formula_terms",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"ancillary_variables",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"bounds",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"climatology",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"coordinates",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"grid_mapping",trv_tbl);
     /* Do all twice, so that, e.g., auxiliary coordinates retrieved because of "coordinates" come with their "bounds" variables */
+    if(EXTRACT_CLL_MSR) (void)nco_xtr_cf_add(nc_id,"cell_measures",trv_tbl);
+    if(EXTRACT_FRM_TRM) (void)nco_xtr_cf_add(nc_id,"formula_terms",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"ancillary_variables",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"climatology",trv_tbl);
     (void)nco_xtr_cf_add(nc_id,"coordinates",trv_tbl);
@@ -6590,30 +6623,28 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
  trv_tbl_sct * const trv_tbl)         /* I/O [sct] Traversal table */
 {
   /* Purpose: Assign user-specified dimension limits to traversal table  
-  At this point "lmt" was parsed from nco_lmt_prs(); only the relative names and  min, max, stride are known 
-  Steps:
-
-  Find the total numbers of matches for a dimension
-  ncks -d lon,0,0,1  ~/nco/data/in_grp.nc
-  Here "lmt_nbr" is 1 and there is 1 match at most
-  ncks -d lon,0,0,1 -d lon,0,0,1 -d lat,0,0,1  ~/nco/data/in_grp.nc
-  Here "lmt_nbr" is 3 and there are 2 matches at most for "lon" and 1 match at most for "lat"
-  The limits have to be separated to 
-  a) case of coordinate variables
-  b) case of dimension only (there is no coordinate variable for that dimension)
-
-  Deep copy matches to table, match at the current index, increment current index
-
-  Apply MSA for each Dimension in a new cycle (that now has all its limits in place :-) ) 
-  At this point lmt_sct is no longer needed;  
-
-  Tests:
-  ncks -D 11 -d lon,0,0,1 -d lon,1,1,1 -d lat,0,0,1 -d time,1,2,1 -d time,6,7,1 -v lon,lat,time -H ~/nco/data/in_grp.nc
-  ncks -D 11 -d time,8,9 -d time,0,2  -v time -H ~/nco/data/in_grp.nc
-  ncks -D 11 -d time,8,2 -v time -H ~/nco/data/in_grp.nc # wrapped limit
-  */
+     At this point "lmt" was parsed from nco_lmt_prs(); only the relative names and  min, max, stride are known 
+     Steps:
+
+     Find total numbers of matches for a dimension
+     ncks -d lon,0,0,1 ~/nco/data/in_grp.nc
+     Here "lmt_nbr" is 1 and there is 1 match at most
+     ncks -d lon,0,0,1 -d lon,0,0,1 -d lat,0,0,1  ~/nco/data/in_grp.nc
+     Here "lmt_nbr" is 3 and there are 2 matches at most for "lon" and 1 match at most for "lat"
+     The limits have to be separated to 
+     a) case of coordinate variables
+     b) case of dimension only (there is no coordinate variable for that dimension)
+     
+     Deep copy matches to table, match at the current index, increment current index
+     
+     Apply MSA for each Dimension in a new cycle (that now has all its limits in place :-) ) 
+     At this point lmt_sct is no longer needed;  
+     
+     Tests:
+     ncks -D 11 -d lon,0,0,1 -d lon,1,1,1 -d lat,0,0,1 -d time,1,2,1 -d time,6,7,1 -v lon,lat,time -H ~/nco/data/in_grp.nc
+     ncks -D 11 -d time,8,9 -d time,0,2  -v time -H ~/nco/data/in_grp.nc
+     ncks -D 11 -d time,8,2 -v time -H ~/nco/data/in_grp.nc # wrapped limit */
 
-  /* Loop table */
   for(unsigned int idx_tbl=0;idx_tbl<trv_tbl->nbr;idx_tbl++){
 
     trv_sct var_trv=trv_tbl->lst[idx_tbl];
@@ -6639,8 +6670,7 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
               trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn_nbr++;
 
               int nbr_lmt=trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn_nbr;
-              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn=(lmt_sct **)nco_realloc(
-                trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn,nbr_lmt*sizeof(lmt_sct *));
+              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn=(lmt_sct **)nco_realloc(trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn,nbr_lmt*sizeof(lmt_sct *));
 
               /* b) case of dimension only (there is no coordinate variable for this dimension */
             }else{
@@ -6649,8 +6679,7 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
               trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn_nbr++;
 
               int nbr_lmt=trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn_nbr;
-              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn=(lmt_sct **)nco_realloc(
-                trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn,nbr_lmt*sizeof(lmt_sct *));
+              trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn=(lmt_sct **)nco_realloc(trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].ncd->lmt_msa.lmt_dmn,nbr_lmt*sizeof(lmt_sct *));
 
             } /* b) case of dimension only (there is no coordinate variable for this dimension */
 
@@ -6698,7 +6727,7 @@ nco_bld_lmt                           /* [fnc] Assign user specified dimension l
               /* Increment current index being initialized  */
               trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_crr++;
 
-              /* Alloc this limit */
+              /* Allocate this limit */
               trv_tbl->lst[idx_tbl].var_dmn[idx_var_dmn].crd->lmt_msa.lmt_dmn[lmt_crr]=(lmt_sct *)nco_malloc(sizeof(lmt_sct));
 
               /* Initialize this entry */
diff --git a/src/nco/nco_grp_utl.h b/src/nco/nco_grp_utl.h
index 7736e62..3333178 100644
--- a/src/nco/nco_grp_utl.h
+++ b/src/nco/nco_grp_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Group utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -537,6 +537,8 @@ nco_bld_trv_tbl                       /* [fnc] Construct GTT, Group Traversal Ta
  const nco_bool GRP_XTR_VAR_XCL,      /* I [flg] Extract matching groups, exclude matching variables */
  const nco_bool EXCLUDE_INPUT_LIST,   /* I [flg] Exclude rather than extract groups and variables specified with -v */ 
  const nco_bool EXTRACT_ASSOCIATED_COORDINATES,  /* I [flg] Extract all coordinates associated with extracted variables? */ 
+ const nco_bool EXTRACT_CLL_MSR, /* I [flg] Extract cell_measures variables */
+ const nco_bool EXTRACT_FRM_TRM, /* I [flg] Extract formula_terms variables */
  const int nco_pck_plc,               /* I [enm] Packing policy */
  nco_dmn_dne_t **flg_dne,             /* I/O [lst] Flag to check if input dimension -d "does not exist" */
  trv_tbl_sct * const trv_tbl);        /* I/O [sct] Traversal table */
diff --git a/src/nco/nco_lmt.c b/src/nco/nco_lmt.c
index f043c3b..28fe960 100644
--- a/src/nco/nco_lmt.c
+++ b/src/nco/nco_lmt.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Hyperslab limits */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -526,7 +526,7 @@ nco_prn_lmt                    /* [fnc] Print limit information */
 
   (void)fprintf(stderr,"Dimension hyperslabber nco_lmt_evl() diagnostics:\n");
   (void)fprintf(stderr,"Dimension name = %s\n",lmt.nm);
-  (void)fprintf(stderr,"Limit type is %s\n",(min_lmt_typ == lmt_crd_val) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
+  (void)fprintf(stderr,"Limit type is %s\n",((min_lmt_typ == lmt_crd_val) || (min_lmt_typ == lmt_udu_sng)) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
   (void)fprintf(stderr,"Limit %s user-specified\n",(lmt.is_usr_spc_lmt) ? "is" : "is not");
   (void)fprintf(stderr,"Limit %s record dimension\n",(lmt.is_rec_dmn) ? "is" : "is not");
   (void)fprintf(stderr,"Current file %s specified hyperslab, data %s be read\n",(flg_no_data_ok) ? "is superfluous to" : "is required by",(flg_no_data_ok) ? "will not" : "will");
@@ -570,6 +570,8 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
      maxima strings and find appropriate indices into dimensions 
      for formulation of dimension start and count vectors, or fail trying. */
 
+  const char fnc_nm[]="nco_lmt_evl()";
+
   char *fl_udu_sng=NULL_CEWI;   /* Store units attribute of coordinate dimension */
   char *msg_sng=NULL_CEWI; /* [sng] Error message */
   char *sng_cnv_rcd=NULL_CEWI; /* [sng] strtol()/strtoul() return code */
@@ -599,10 +601,6 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
   long cnt_rmn_ttl=-1L; /* Total records to be read from this and all remaining files */
   long rec_skp_vld_prv_dgn=-1L; /* Records skipped at end of previous valid file, if any (diagnostic only) */
 
-#ifdef ENABLE_UDUNITS
-  cv_converter *ut_cnv=NULL;
-#endif /* !ENABLE_UDUNITS */
-
   lmt=*lmt_ptr;
 
   nco_prg_id=nco_prg_id_get(); /* Program ID */
@@ -731,8 +729,8 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
   if(min_lmt_typ != max_lmt_typ){
     (void)fprintf(stdout,"%s: ERROR -d %s,%s,%s\n",nco_prg_nm_get(),lmt.nm,lmt.min_sng,lmt.max_sng);
     (void)fprintf(stdout,"Limits on dimension \"%s\" must be of same numeric type:\n",lmt.nm);
-    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.min_sng,(min_lmt_typ == lmt_crd_val) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
-    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.max_sng,(max_lmt_typ == lmt_crd_val) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
+    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.min_sng,((min_lmt_typ == lmt_crd_val) || (min_lmt_typ == lmt_udu_sng)) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
+    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.max_sng,((max_lmt_typ == lmt_crd_val) || (max_lmt_typ == lmt_udu_sng)) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
     (void)fprintf(stdout,"(Limit arguments containing a decimal point (or in exponential format) are interpreted as coordinate values; arguments without a decimal point are interpreted as zero-based or one-based (depending on -F switch) dimensional indices.)\n");
     nco_exit(EXIT_FAILURE);
   } /* end if */
@@ -835,11 +833,11 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
       } /* end if */
 
       if(lmt.min_sng)
- 	if( nco_cln_clc_dbl_org(lmt.min_sng,fl_udu_sng, lmt.lmt_cln, &lmt.min_val) !=NCO_NOERR )
+ 	if(nco_cln_clc_dbl_org(lmt.min_sng,fl_udu_sng,lmt.lmt_cln,&lmt.min_val) != NCO_NOERR)
            nco_exit(EXIT_FAILURE);
 
       if(lmt.max_sng)
- 	if( nco_cln_clc_dbl_org(lmt.max_sng,fl_udu_sng, lmt.lmt_cln, &lmt.max_val) !=NCO_NOERR )
+ 	if(nco_cln_clc_dbl_org(lmt.max_sng,fl_udu_sng,lmt.lmt_cln,&lmt.max_val) != NCO_NOERR)
            nco_exit(EXIT_FAILURE);
 
     }else{ /* end UDUnits conversion */
@@ -854,21 +852,20 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
       } /* !lmt.max_sng */
 
       /* Re-base coordinates as necessary in multi-file operatators (MFOs)
-      lmt.origin was calculated earlier in routine */
-      if(rec_dmn_and_mfo && fl_udu_sng && lmt.rbs_sng && strcmp(fl_udu_sng, lmt.rbs_sng) ){ 
+	 lmt.origin was calculated earlier in routine */
+      if(rec_dmn_and_mfo && fl_udu_sng && lmt.rbs_sng && strcmp(fl_udu_sng,lmt.rbs_sng)){ 
 
         if(lmt.min_sng) 
-	  if( nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng, lmt.lmt_cln, &lmt.min_val, (var_sct*)NULL) !=NCO_NOERR )
-             nco_exit(EXIT_FAILURE);
+	  if(nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng,lmt.lmt_cln,&lmt.min_val,(var_sct *)NULL) != NCO_NOERR)
+	    nco_exit(EXIT_FAILURE);
 
         if(lmt.max_sng) 
-	  if( nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng, lmt.lmt_cln, &lmt.max_val, (var_sct*)NULL) !=NCO_NOERR)
-             nco_exit(EXIT_FAILURE);   
+	  if(nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng,lmt.lmt_cln,&lmt.max_val,(var_sct *)NULL) != NCO_NOERR)
+	    nco_exit(EXIT_FAILURE);   
 
-        if(nco_dbg_lvl_get() > nco_dbg_std)
-             fprintf(stdout,"%s: INFO nco_lmt rebasing min_val=%f max_val=%f\n",nco_prg_nm_get(), lmt.min_val, lmt.max_val);  
+        if(nco_dbg_lvl_get() > nco_dbg_std) fprintf(stdout,"%s: INFO nco_lmt rebasing min_val=%f max_val=%f\n",nco_prg_nm_get(),lmt.min_val,lmt.max_val);  
 
-      }  /* endif MFO */
+      } /* endif MFO */
     } /* end UDUnits conversion */
 
     /* Warn when min_val > max_val (i.e., wrapped coordinate) */
@@ -1255,13 +1252,16 @@ nco_lmt_evl /* [fnc] Parse user-specified limits into hyperslab specifications *
      Out-of-domain errors will soon exit with error, while WRP conditions will proceed */
   if(flg_no_data_err) lmt.cnt=0L;
 
-  /* Exit when valid bracketed range contains no coordinates and that is not legal,
-     i.e., this is not a superfluous file in an MFO */
+  /* Exit when valid bracketed range contains no coordinates and this is not a superfluous file in an MFO */
   if(lmt.cnt == 0){
-    if(lmt.lmt_typ == lmt_crd_val) (void)fprintf(stdout,"%s: ERROR Domain %g <= %s <= %g brackets no coordinate values.\n",nco_prg_nm_get(),lmt.min_val,lmt.nm,lmt.max_val); 
-    if(lmt.lmt_typ == lmt_dmn_idx) (void)fprintf(stdout,"%s: ERROR Empty domain for %s\n",nco_prg_nm_get(),lmt.nm); 
+    if(lmt.lmt_typ == lmt_crd_val || lmt.lmt_typ == lmt_udu_sng){
+       (void)fprintf(stdout,"%s: ERROR %s reports domain %15.9e <= %s <= %15.9e brackets no coordinate values\n",nco_prg_nm_get(),fnc_nm,lmt.min_val,lmt.nm,lmt.max_val);
+       if(lmt.min_sng) (void)fprintf(stdout,"%s: INFO user-specified coordinate minimum: \"%s\"\n",nco_prg_nm_get(),lmt.min_sng);
+       if(lmt.max_sng) (void)fprintf(stdout,"%s: INFO user-specified coordinate maximum: \"%s\"\n",nco_prg_nm_get(),lmt.max_sng);
+    } /* !lmt_typ */
+    if(lmt.lmt_typ == lmt_dmn_idx) (void)fprintf(stdout,"%s: ERROR Indices bracket empty domain for %s\n",nco_prg_nm_get(),lmt.nm); 
     nco_exit(EXIT_FAILURE);
-  } /* end if */
+  } /* !lmt.cnt */
 
   /* Coordinate-valued limits that bracket no values in current file jump here with goto
      Index-valued limits with no values in current file flow here naturally */
@@ -1499,8 +1499,8 @@ nco_lmt_evl_dmn_crd            /* [fnc] Parse user-specified limits into hypersl
   if(min_lmt_typ != max_lmt_typ){
     (void)fprintf(stdout,"%s: ERROR -d %s,%s,%s\n",nco_prg_nm_get(),lmt.nm,lmt.min_sng,lmt.max_sng);
     (void)fprintf(stdout,"Limits on dimension \"%s\" must be of same numeric type:\n",lmt.nm);
-    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.min_sng,(min_lmt_typ == lmt_crd_val) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
-    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.max_sng,(max_lmt_typ == lmt_crd_val) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
+    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.min_sng,((min_lmt_typ == lmt_crd_val) || (min_lmt_typ == lmt_udu_sng)) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
+    (void)fprintf(stdout,"\"%s\" was interpreted as a %s.\n",lmt.max_sng,((max_lmt_typ == lmt_crd_val) || (max_lmt_typ == lmt_udu_sng)) ? "coordinate value" : (FORTRAN_IDX_CNV) ? "one-based dimension index" : "zero-based dimension index");
     (void)fprintf(stdout,"(Limit arguments containing a decimal point (or in exponential format) are interpreted as coordinate values; arguments without a decimal point are interpreted as zero-based or one-based (depending on -F switch) dimensional indices.)\n");
     nco_exit(EXIT_FAILURE);
   } /* end if */
@@ -1605,13 +1605,12 @@ nco_lmt_evl_dmn_crd            /* [fnc] Parse user-specified limits into hypersl
       } /* end if */
 
       if(lmt.min_sng)
- 	if( nco_cln_clc_dbl_org(lmt.min_sng,fl_udu_sng, lmt.lmt_cln, &lmt.min_val) !=NCO_NOERR )
-           nco_exit(EXIT_FAILURE);
-
+ 	if(nco_cln_clc_dbl_org(lmt.min_sng,fl_udu_sng,lmt.lmt_cln,&lmt.min_val) != NCO_NOERR)
+	  nco_exit(EXIT_FAILURE);
 
       if(lmt.max_sng)
- 	if( nco_cln_clc_dbl_org(lmt.max_sng,fl_udu_sng, lmt.lmt_cln, &lmt.max_val) !=NCO_NOERR )
-           nco_exit(EXIT_FAILURE);
+ 	if(nco_cln_clc_dbl_org(lmt.max_sng,fl_udu_sng,lmt.lmt_cln,&lmt.max_val) != NCO_NOERR)
+	  nco_exit(EXIT_FAILURE);
 
     }else{ /* end UDUnits conversion */
       /* Convert user-specified limits into double precision numeric values, or supply defaults */
@@ -1635,20 +1634,18 @@ nco_lmt_evl_dmn_crd            /* [fnc] Parse user-specified limits into hypersl
       if(rec_dmn_and_mfo && fl_udu_sng && lmt.rbs_sng && strcmp(fl_udu_sng, lmt.rbs_sng) ){ 
 
         if(lmt.min_sng) 
-	  if( nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng, lmt.lmt_cln, &lmt.min_val, (var_sct*)NULL) !=NCO_NOERR )
+	  if(nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng,lmt.lmt_cln,&lmt.min_val,(var_sct*)NULL) != NCO_NOERR)
              nco_exit(EXIT_FAILURE);
 
         if(lmt.max_sng) 
-	  if( nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng, lmt.lmt_cln, &lmt.max_val, (var_sct*)NULL) !=NCO_NOERR)
+	  if(nco_cln_clc_dbl_var_dff(lmt.rbs_sng,fl_udu_sng,lmt.lmt_cln,&lmt.max_val,(var_sct*)NULL) != NCO_NOERR)
              nco_exit(EXIT_FAILURE);   
 
-        if(nco_dbg_lvl_get() > nco_dbg_std)
-             fprintf(stdout,"%s: INFO nco_lmt rebasing min_val=%f max_val=%f\n",nco_prg_nm_get(), lmt.min_val, lmt.max_val);  
+        if(nco_dbg_lvl_get() > nco_dbg_std) fprintf(stdout,"%s: INFO nco_lmt rebasing min_val=%f max_val=%f\n",nco_prg_nm_get(),lmt.min_val,lmt.max_val);
 
       }  /* endif MFO */
     } /* end UDUnits conversion */
 
-
     /* Warn when min_val > max_val (i.e., wrapped coordinate) */
     if(nco_dbg_lvl_get() > nco_dbg_std && lmt.min_val > lmt.max_val) (void)fprintf(stderr,"%s: INFO Interpreting hyperslab specifications as wrapped coordinates [%s <= %g] and [%s >= %g]\n",nco_prg_nm_get(),lmt.nm,lmt.max_val,lmt.nm,lmt.min_val);
 
@@ -2032,13 +2029,16 @@ nco_lmt_evl_dmn_crd            /* [fnc] Parse user-specified limits into hypersl
      Out-of-domain errors will soon exit with error, while WRP conditions will proceed */
   if(flg_no_data_err) lmt.cnt=0L;
 
-  /* Exit when valid bracketed range contains no coordinates and that is not legal,
-     i.e., this is not a superfluous file in an MFO */
+  /* Exit when valid bracketed range contains no coordinates and this is not a superfluous file in an MFO */
   if(lmt.cnt == 0){
-    if(lmt.lmt_typ == lmt_crd_val) (void)fprintf(stdout,"%s: ERROR Domain %g <= %s <= %g brackets no coordinate values.\n",nco_prg_nm_get(),lmt.min_val,lmt.nm,lmt.max_val); 
-    if(lmt.lmt_typ == lmt_dmn_idx) (void)fprintf(stdout,"%s: ERROR Empty domain for %s\n",nco_prg_nm_get(),lmt.nm); 
+    if(lmt.lmt_typ == lmt_crd_val || lmt.lmt_typ == lmt_udu_sng){
+       (void)fprintf(stdout,"%s: ERROR %s reports domain %15.9e <= %s <= %15.9e brackets no coordinate values\n",nco_prg_nm_get(),fnc_nm,lmt.min_val,lmt.nm,lmt.max_val);
+       if(lmt.min_sng) (void)fprintf(stdout,"%s: INFO user-specified coordinate minimum: \"%s\"\n",nco_prg_nm_get(),lmt.min_sng);
+       if(lmt.max_sng) (void)fprintf(stdout,"%s: INFO user-specified coordinate maximum: \"%s\"\n",nco_prg_nm_get(),lmt.max_sng);
+    } /* !lmt_typ */
+    if(lmt.lmt_typ == lmt_dmn_idx) (void)fprintf(stdout,"%s: ERROR Indices bracket empty domain for %s\n",nco_prg_nm_get(),lmt.nm); 
     nco_exit(EXIT_FAILURE);
-  } /* end if */
+  } /* !lmt.cnt */
 
   /* Coordinate-valued limits that bracket no values in current file jump here with goto
      Index-valued limits with no values in current file flow here naturally */
diff --git a/src/nco/nco_lmt.h b/src/nco/nco_lmt.h
index 9a89ee4..36a09b2 100644
--- a/src/nco/nco_lmt.h
+++ b/src/nco/nco_lmt.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Hyperslab limits */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_lst_utl.c b/src/nco/nco_lst_utl.c
index c559dd4..8450943 100644
--- a/src/nco/nco_lst_utl.c
+++ b/src/nco/nco_lst_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: List utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_lst_utl.h b/src/nco/nco_lst_utl.h
index 9dbd4d9..495e31f 100644
--- a/src/nco/nco_lst_utl.h
+++ b/src/nco/nco_lst_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: List utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_md5.c b/src/nco/nco_md5.c
index 7e30b51..2b97e63 100644
--- a/src/nco/nco_md5.c
+++ b/src/nco/nco_md5.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO utilities for MD5 digests */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_md5.h b/src/nco/nco_md5.h
index a73913c..acd59ed 100644
--- a/src/nco/nco_md5.h
+++ b/src/nco/nco_md5.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of MD5 digest functions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mmr.c b/src/nco/nco_mmr.c
index 3f0c23a..16f715e 100644
--- a/src/nco/nco_mmr.c
+++ b/src/nco/nco_mmr.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Memory management */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mmr.h b/src/nco/nco_mmr.h
index b1fee3f..ae64cc8 100644
--- a/src/nco/nco_mmr.h
+++ b/src/nco/nco_mmr.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Memory management */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mpi.h b/src/nco/nco_mpi.h
index 833d557..e7b6ef3 100644
--- a/src/nco/nco_mpi.h
+++ b/src/nco/nco_mpi.h
@@ -13,7 +13,7 @@
    Should _any_ MPI dependencies be in libnco.a?
    Cross-platform link weirdness (e.g., AIX) makes MPI dependencies in libnco.a fragile */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_msa.c b/src/nco/nco_msa.c
index 769b87f..32c2d5e 100644
--- a/src/nco/nco_msa.c
+++ b/src/nco/nco_msa.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Multi-slabbing algorithm */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -171,13 +171,17 @@ read_lbl:
 
 	  (void)nco_inq_format(vara->nc_id,&fl_in_fmt);
 
+	  /* 20170207: Turn-off USE_NC4_SRD_WORKAROUND in all situations due to TODO nco1135
+	     ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in.nc # works
+	     ncks -v zg -H -C -d time,0,1 -d lev,0,2,2 ~/nco/data/in_4c.nc # borken */
 	  if((fl_in_fmt == NC_FORMAT_NETCDF4 || fl_in_fmt == NC_FORMAT_NETCDF4_CLASSIC) && (dmn_srd_nbr == 1))
-	    USE_NC4_SRD_WORKAROUND=True;
+	    USE_NC4_SRD_WORKAROUND=False;
 
 	  if(!USE_NC4_SRD_WORKAROUND){
 	    if(nco_dbg_lvl_get() >= nco_dbg_var && srd_prd > 1L) (void)fprintf(stderr,"%s: INFO %s reports calling nco_get_vars() for strided hyperslab access. In case of slow response, please ask NCO developers to extend USE_NC4_SRD_WORKAROUND to handle your use-case.\n",nco_prg_nm_get(),fnc_nm);
 	    (void)nco_get_vars(vara->nc_id,vara->id,dmn_srt,dmn_cnt,dmn_srd,vp,vara->type);
 	  }else{
+	    /* 20170207: This USE_NC4_SRD_WORKAROUND code is broken */
 	    int srd_nbr; /* [nbr] Number of strides requested in the single strided dimension (not number of strided dimensions) */
 	    int srd_idx; /* [idx] Counter for how many times to call nco_get_var() */
 	    int idx_srd; /* [idx] Index of strided dimension */
diff --git a/src/nco/nco_msa.h b/src/nco/nco_msa.h
index f89665d..5c843ad 100644
--- a/src/nco/nco_msa.h
+++ b/src/nco/nco_msa.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Multi-slabbing algorithm */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mss_val.c b/src/nco/nco_mss_val.c
index 40ae739..54c5ab1 100644
--- a/src/nco/nco_mss_val.c
+++ b/src/nco/nco_mss_val.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Missing value utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mss_val.h b/src/nco/nco_mss_val.h
index 8cb933c..9895298 100644
--- a/src/nco/nco_mss_val.h
+++ b/src/nco/nco_mss_val.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Missing value utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_mta.c b/src/nco/nco_mta.c
index 7dd8f5a..1d1ba66 100644
--- a/src/nco/nco_mta.c
+++ b/src/nco/nco_mta.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Multi-argument utilities */
 
-/* Copyright (C) 2016--2016 Charlie Zender
+/* Copyright (C) 2016--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file
@@ -155,15 +155,15 @@ nco_input_check /* [fnc] Check whether input has valid syntax */
   const char fnc_nm[]="nco_input_check()"; /* [sng] Function name */
 
   if(!strstr(args,"=")){ // If no equal sign in arguments
-    (void)fprintf(stderr,"%s: ERROR %s did not detect equal sign between key and value. HINT: This can occur when the designated or default key-value delimiter \"%s\" is mixed into the literal text of the value. Try changing the delimiter to a string guaranteed not to appear in the value string with, e.g., --dlm=\"##\".\n",nco_prg_nm_get(),fnc_nm,nco_mta_dlm_get());
+    (void)fprintf(stderr,"%s: ERROR %s did not detect equal sign between key and value for argument \"%s\".\n%s HINT This can occur when the designated or default key-value delimiter \"%s\" is mixed into the literal text of the value. Try changing the delimiter to a string guaranteed not to appear in the value string with, e.g., --dlm=\"##\".\n",nco_prg_nm_get(),fnc_nm,args,nco_prg_nm_get(),nco_mta_dlm_get());
     return NCO_ERR;
   }
   if(strstr(args,"=") == args){ // Equal sign is at argument start (no key)
-    (void)fprintf(stderr,"%s: ERROR %s reports no key in key-value pair.\n",nco_prg_nm_get(),fnc_nm); 
+    (void)fprintf(stderr,"%s: ERROR %s reports no key in key-value pair for argument \"%s\".\n%s HINT It appears that an equal sign is the first character of the argument, meaning that a value was specified with a corresponding key.\n",nco_prg_nm_get(),fnc_nm,args,nco_prg_nm_get()); 
     return NCO_ERR;
   }
   if(strstr(args,"=") == args+strlen(args)-1L){ // Equal sign is at argument end
-    (void)fprintf(stderr,"%s: ERROR %s reports no value in key-value pair. HINT: This usually occurs when the value of a key is unintentionally omitted, e.g., --gaa foo= , --ppc foo= , --rgr foo= , or --trr foo= . Each equal sign must be followed by a value.\n",nco_prg_nm_get(),fnc_nm); 
+    (void)fprintf(stderr,"%s: ERROR %s reports no value in key-value pair for argument \"%s\".\n%s HINT This usually occurs when the value of a key is unintentionally omitted, e.g., --gaa foo= , --ppc foo= , --rgr foo= , or --trr foo= . Each equal sign must immediatte precede a value for the specified key(s).\n",nco_prg_nm_get(),fnc_nm,args,nco_prg_nm_get());
     return NCO_ERR;
   }
   return NCO_NOERR;
diff --git a/src/nco/nco_mta.h b/src/nco/nco_mta.h
index b6cbeea..485d234 100644
--- a/src/nco/nco_mta.h
+++ b/src/nco/nco_mta.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Multi-argument parsing */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_netcdf.c b/src/nco/nco_netcdf.c
index ebce6ed..22f9d0f 100644
--- a/src/nco/nco_netcdf.c
+++ b/src/nco/nco_netcdf.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO wrappers for netCDF C library */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_netcdf.h b/src/nco/nco_netcdf.h
index 5c19190..36dce79 100644
--- a/src/nco/nco_netcdf.h
+++ b/src/nco/nco_netcdf.h
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO wrappers for netCDF C library */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_omp.c b/src/nco/nco_omp.c
index a2588d2..122f6ad 100644
--- a/src/nco/nco_omp.c
+++ b/src/nco/nco_omp.c
@@ -2,7 +2,7 @@
 
 /* Purpose: OpenMP utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_omp.h b/src/nco/nco_omp.h
index 55050d2..f05af12 100644
--- a/src/nco/nco_omp.h
+++ b/src/nco/nco_omp.h
@@ -2,7 +2,7 @@
 
 /* Purpose: OpenMP utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_pck.c b/src/nco/nco_pck.c
index 01982b7..f271485 100644
--- a/src/nco/nco_pck.c
+++ b/src/nco/nco_pck.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO utilities for packing and unpacking variables */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_pck.h b/src/nco/nco_pck.h
index 0b4bb7f..032a16f 100644
--- a/src/nco/nco_pck.h
+++ b/src/nco/nco_pck.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of packing/unpacking functions */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_ppc.c b/src/nco/nco_ppc.c
index 94416b7..cb07a3d 100644
--- a/src/nco/nco_ppc.c
+++ b/src/nco/nco_ppc.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO utilities for Precision-Preserving Compression (PPC) */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_ppc.h b/src/nco/nco_ppc.h
index 403cd36..0021dad 100644
--- a/src/nco/nco_ppc.h
+++ b/src/nco/nco_ppc.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of Precision-Preserving Compression (PPC) functions */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_prn.c b/src/nco/nco_prn.c
index cde09cc..672aa23 100644
--- a/src/nco/nco_prn.c
+++ b/src/nco/nco_prn.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Print variables, attributes, metadata */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -1524,15 +1524,12 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
   long var_dsk; /* [nbr] Variable index relative to disk */
   long var_szm1;
 
+
   const nco_bool CDL=prn_flg->cdl; /* [flg] CDL output */
   const nco_bool XML=prn_flg->xml; /* [flg] XML output */
   const nco_bool TRD=prn_flg->trd; /* [flg] Traditional output */
   const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
 
-  const nco_bool CDL_OR_JSN=prn_flg->cdl || prn_flg->jsn; /* [flg] CDL or JSON output */
-  const nco_bool CDL_OR_TRD=prn_flg->cdl || prn_flg->trd; /* [flg] CDL or Traditional output */
-  const nco_bool CDL_OR_JSN_OR_XML=prn_flg->cdl || prn_flg->jsn || prn_flg->xml; /* [flg] CDL or JSON or XML output */
-
   nco_bool JSN_BRK=False;    /* [flg] JSON output - data bracketed */
   nco_bool is_mss_val=False; /* [flg] Current value is missing value */
   nco_bool flg_malloc_unit_crd=False; /* [flg] Allocated memory for coordinate units string */
@@ -1687,7 +1684,7 @@ nco_prn_var_val_trv /* [fnc] Print variable data (GTT version) */
   } /* end if dlm_sng */
 
   spr_sng=cma_sng; /* [sng] Output separator string */
-  if(CDL_OR_JSN_OR_XML){
+  if(CDL || JSN || XML){
     char fmt_sng[NCO_MAX_LEN_FMT_SNG];
     dmn_trv_sct *dmn_trv; /* [sct] Unique dimension object */
     int cpd_rec_dmn_idx[NC_MAX_DIMS]; /* [idx] Indices of non-leading record dimensions */
@@ -2365,11 +2362,7 @@ nco_grp_prn /* [fnc] Recursively print group contents */
   const nco_bool TRD=prn_flg->trd; /* [flg] Traditional output */
   const nco_bool SRM=prn_flg->srm; /* [flg] Stream output */
   const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
-  const nco_bool CDL_OR_XML=prn_flg->cdl || prn_flg->xml; /* [flg] CDL or XML output */
   const nco_bool CDL_OR_TRD=prn_flg->cdl || prn_flg->trd; /* [flg] CDL or Traditional output */
-  const nco_bool CDL_OR_JSN_OR_TRD=prn_flg->cdl || prn_flg->jsn || prn_flg->trd; /* [flg] CDL or JSON or Traditional output */
-  const nco_bool CDL_OR_TRD_OR_XML=prn_flg->cdl || prn_flg->trd || prn_flg->xml; /* [flg] CDL or Traditional or XML output */
-  
 
   nm_id_sct *dmn_lst; /* [sct] Dimension list */
   nm_id_sct *var_lst; /* [sct] Variable list */
@@ -2377,7 +2370,6 @@ nco_grp_prn /* [fnc] Recursively print group contents */
   unsigned int dmn_idx; /* [idx] Index over dimensions */
   unsigned int dmn_nbr; /* [nbr] Number of dimensions defined in group */
   unsigned int obj_idx; /* [idx] Index over traversal table */
-  unsigned int obj_idx_crr; /* [idx] Object index for this group */
 
   /* Initialize */
   dmn_nbr=0; /* [nbr] Number of dimensions defined in group */
@@ -2393,7 +2385,6 @@ nco_grp_prn /* [fnc] Recursively print group contents */
   (void)nco_inq_grp_full_ncid(nc_id,grp_nm_fll,&grp_id);
 
   /* Obtain group information */
-  obj_idx_crr=obj_idx;
   grp_dpt=trv_tbl->lst[obj_idx].grp_dpt;
   nbr_att=trv_tbl->lst[obj_idx].nbr_att;
   nbr_var=trv_tbl->lst[obj_idx].nbr_var;
@@ -2784,7 +2775,7 @@ nco_grp_prn /* [fnc] Recursively print group contents */
 
 
 int /* [rcd] Return code */
-nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
+nco_prn_cdl_trd /* [fnc] Recursively print group contents */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
@@ -2807,7 +2798,6 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
   char var_nm[NC_MAX_NAME+1L];      /* [sng] Variable name */ 
 
   char *nm_cdl;
-  char *nm_jsn;
   char *var_nm_fll;                /* [sng] Full path for variable */
 
   int *grp_ids;                    /* [ID] Sub-group IDs array */  
@@ -2825,14 +2815,8 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
   int var_idx;                     /* [idx] Variable index */
   int var_nbr_xtr;                 /* [nbr] Number of extracted variables */
   
-  nco_bool JSN_BLOCK=False;         /* turns true is we have output a jsnblock -need so we add commas where needed */ 
   const nco_bool CDL=prn_flg->cdl; /* [flg] CDL output */
-  const nco_bool XML=prn_flg->xml; /* [flg] XML output */
-  const nco_bool TRD=prn_flg->trd; /* [flg] Traditional output */
-  const nco_bool SRM=prn_flg->srm; /* [flg] Stream output */
-  const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
-  const nco_bool CDL_OR_TRD=prn_flg->cdl || prn_flg->trd; /* [flg] CDL or Traditional output */
-  
+  const nco_bool TRD=prn_flg->trd; /* [flg] CDL output */
 
   nm_id_sct *dmn_lst; /* [sct] Dimension list */
   nm_id_sct *var_lst; /* [sct] Variable list */
@@ -2840,7 +2824,6 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
   unsigned int dmn_idx; /* [idx] Index over dimensions */
   unsigned int dmn_nbr; /* [nbr] Number of dimensions defined in group */
   unsigned int obj_idx; /* [idx] Index over traversal table */
-  unsigned int obj_idx_crr; /* [idx] Object index for this group */
 
   /* Initialize */
   dmn_nbr=0; /* [nbr] Number of dimensions defined in group */
@@ -2856,7 +2839,6 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
   (void)nco_inq_grp_full_ncid(nc_id,grp_nm_fll,&grp_id);
 
   /* Obtain group information */
-  obj_idx_crr=obj_idx;
   grp_dpt=trv_tbl->lst[obj_idx].grp_dpt;
   nbr_att=trv_tbl->lst[obj_idx].nbr_att;
   nbr_var=trv_tbl->lst[obj_idx].nbr_var;
@@ -2899,7 +2881,7 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
   
   /* Print dimension information for group */
   prn_ndn=prn_flg->ndn=prn_flg->sxn_fst+grp_dpt*prn_flg->spc_per_lvl;
-  if(dmn_nbr > 0 && CDL_OR_TRD) (void)fprintf(stdout,"%*sdimensions:\n",prn_flg->ndn,spc_sng); 
+  if(dmn_nbr > 0 ) (void)fprintf(stdout,"%*sdimensions:\n",prn_flg->ndn,spc_sng); 
   if(CDL) prn_ndn+=prn_flg->var_fst;
 
   for(dmn_idx=0;dmn_idx<dmn_nbr;dmn_idx++){
@@ -3034,7 +3016,7 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
 	  break;
     
     /* Is sub-group to be extracted? If so, recurse */
-    if(trv_tbl->lst[obj_idx].flg_xtr) rcd+=nco_grp_prn_cdl_trd(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);
+    if(trv_tbl->lst[obj_idx].flg_xtr) rcd+=nco_prn_cdl_trd(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);
 
     /* Free constructed name */
     sub_grp_nm_fll=(char *)nco_free(sub_grp_nm_fll);
@@ -3049,7 +3031,7 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents */
 
 
 int /* [rcd] Return code */
-nco_grp_prn_xml /* [fnc] Recursively print group contents */
+nco_prn_xml /* [fnc] Recursively print group contents */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
@@ -3071,10 +3053,7 @@ nco_grp_prn_xml /* [fnc] Recursively print group contents */
   char grp_nm[NC_MAX_NAME+1L];      /* [sng] Group name */
   char var_nm[NC_MAX_NAME+1L];      /* [sng] Variable name */ 
 
-  char *nm_cdl;
-  char *nm_jsn;
   char *var_nm_fll;                /* [sng] Full path for variable */
-
   int *grp_ids;                    /* [ID] Sub-group IDs array */  
 
   int dmn_idx_grp[NC_MAX_DIMS];    /* [ID] Dimension indices array for group */ 
@@ -3090,20 +3069,12 @@ nco_grp_prn_xml /* [fnc] Recursively print group contents */
   int var_idx;                     /* [idx] Variable index */
   int var_nbr_xtr;                 /* [nbr] Number of extracted variables */
   
-  nco_bool JSN_BLOCK=False;         /* turns true is we have output a jsnblock -need so we add commas where needed */ 
-  const nco_bool CDL=prn_flg->cdl; /* [flg] CDL output */
-  const nco_bool XML=prn_flg->xml; /* [flg] XML output */
-  const nco_bool TRD=prn_flg->trd; /* [flg] Traditional output */
-  const nco_bool SRM=prn_flg->srm; /* [flg] Stream output */
-  const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
-  
   nm_id_sct *dmn_lst; /* [sct] Dimension list */
   nm_id_sct *var_lst; /* [sct] Variable list */
 
   unsigned int dmn_idx; /* [idx] Index over dimensions */
   unsigned int dmn_nbr; /* [nbr] Number of dimensions defined in group */
   unsigned int obj_idx; /* [idx] Index over traversal table */
-  unsigned int obj_idx_crr; /* [idx] Object index for this group */
 
 
 
@@ -3121,7 +3092,6 @@ nco_grp_prn_xml /* [fnc] Recursively print group contents */
   (void)nco_inq_grp_full_ncid(nc_id,grp_nm_fll,&grp_id);
 
   /* Obtain group information */
-  obj_idx_crr=obj_idx;
   grp_dpt=trv_tbl->lst[obj_idx].grp_dpt;
   nbr_att=trv_tbl->lst[obj_idx].nbr_att;
   nbr_var=trv_tbl->lst[obj_idx].nbr_var;
@@ -3283,7 +3253,7 @@ nco_grp_prn_xml /* [fnc] Recursively print group contents */
 	  break;
     
     /* Is sub-group to be extracted? If so, recurse */
-    if(trv_tbl->lst[obj_idx].flg_xtr) rcd+=nco_grp_prn_xml(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);
+    if(trv_tbl->lst[obj_idx].flg_xtr) rcd+=nco_prn_xml(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);
 
     /* Free constructed name */
     sub_grp_nm_fll=(char *)nco_free(sub_grp_nm_fll);
@@ -3301,7 +3271,7 @@ nco_grp_prn_xml /* [fnc] Recursively print group contents */
 
 
 int /* [rcd] Return code */
-nco_grp_prn_jsn /* [fnc] Recursively print group contents */
+nco_prn_jsn /* [fnc] Recursively print group contents */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
@@ -3323,7 +3293,6 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
   char grp_nm[NC_MAX_NAME+1L];      /* [sng] Group name */
   char var_nm[NC_MAX_NAME+1L];      /* [sng] Variable name */ 
 
-  char *nm_cdl;
   char *nm_jsn;
   char *var_nm_fll;                /* [sng] Full path for variable */
 
@@ -3343,7 +3312,6 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
   int var_nbr_xtr;                 /* [nbr] Number of extracted variables */
   int nbr_grp_xtr=0;               /* number of groups currently extracted */  
   nco_bool JSN_BLOCK=False;         /* turns true is we have output a jsnblock -need so we add commas where needed */ 
-  const nco_bool JSN=prn_flg->jsn; /* [flg] JSON output */
   
   nm_id_sct *dmn_lst; /* [sct] Dimension list */
   nm_id_sct *var_lst; /* [sct] Variable list */
@@ -3351,7 +3319,6 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
   unsigned int dmn_idx; /* [idx] Index over dimensions */
   unsigned int dmn_nbr; /* [nbr] Number of dimensions defined in group */
   unsigned int obj_idx; /* [idx] Index over traversal table */
-  unsigned int obj_idx_crr; /* [idx] Object index for this group */
 
   /* Initialize */
   dmn_nbr=0; /* [nbr] Number of dimensions defined in group */
@@ -3367,7 +3334,6 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
   (void)nco_inq_grp_full_ncid(nc_id,grp_nm_fll,&grp_id);
 
   /* Obtain group information */
-  obj_idx_crr=obj_idx;
   grp_dpt=trv_tbl->lst[obj_idx].grp_dpt;
   nbr_att=trv_tbl->lst[obj_idx].nbr_att;
   nbr_var=trv_tbl->lst[obj_idx].nbr_var;
@@ -3597,7 +3563,7 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
       else   
          (void)fprintf(stdout,",\n"); 
 
-      rcd+=nco_grp_prn_jsn(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);        
+      rcd+=nco_prn_jsn(nc_id,sub_grp_nm_fll,prn_flg,trv_tbl);        
     }  
 
     /* Free constructed name */
@@ -3615,7 +3581,7 @@ nco_grp_prn_jsn /* [fnc] Recursively print group contents */
 
   
   return rcd;
-  } /* end nco_grp_prn_jsn() */
+  } /* end nco_prn_jsn() */
 
 
 nco_bool                            /* O [flg] Variable is compound */
diff --git a/src/nco/nco_prn.h b/src/nco/nco_prn.h
index 1479aa8..96e9e70 100644
--- a/src/nco/nco_prn.h
+++ b/src/nco/nco_prn.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Print variables, attributes, metadata */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -48,6 +48,11 @@
 extern "C" {
 #endif /* __cplusplus */
 
+int 
+nco_att_nbr        /* [fnc] return number of atts in var or global atts in group */ 
+(const int grp_id, /* I [id] netCDF group ID */
+ const int var_id); /* I [id] netCDF input variable ID */
+
 void 
 nco_prn_att /* [fnc] Print all attributes of single variable or group */
 (const int grp_id, /* I [id] netCDF group ID */
@@ -102,7 +107,7 @@ nco_grp_prn /* [fnc] Recursively print group contents */
  const trv_tbl_sct * const trv_tbl); /* I [sct] Traversal table */
 
 int /* [rcd] Return code */
-nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents in JSON format */
+nco_prn_cdl_trd /* [fnc] Recursively print group contents in cdl or trd format */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
@@ -110,14 +115,14 @@ nco_grp_prn_cdl_trd /* [fnc] Recursively print group contents in JSON format */
 
 
 int /* [rcd] Return code */
-nco_grp_prn_jsn /* [fnc] Recursively print group contents in JSON format */
+nco_prn_jsn /* [fnc] Recursively print group contents in JSON format */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
  const trv_tbl_sct * const trv_tbl); /* I [sct] Traversal table */
 
 int /* [rcd] Return code */
-nco_grp_prn_xml /* [fnc] Recursively print group contents in XML format */
+nco_prn_xml /* [fnc] Recursively print group contents in XML format */
 (const int nc_id, /* I [id] netCDF file ID */
  const char * const grp_nm_fll, /* I [sng] Absolute group name (path) */
  prn_fmt_sct * const prn_flg, /* I/O [sct] Print-format information */
diff --git a/src/nco/nco_rec_var.c b/src/nco/nco_rec_var.c
index 7358a92..6b65cf4 100644
--- a/src/nco/nco_rec_var.c
+++ b/src/nco/nco_rec_var.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Record variable utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rec_var.h b/src/nco/nco_rec_var.h
index 50c8b61..255a58b 100644
--- a/src/nco/nco_rec_var.h
+++ b/src/nco/nco_rec_var.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Record variable utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rgr.c b/src/nco/nco_rgr.c
index 931c952..72c7fe3 100644
--- a/src/nco/nco_rgr.c
+++ b/src/nco/nco_rgr.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO regridding utilities */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -247,6 +247,7 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
   /* 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_cll_msr=True; /* [flg] Add cell_measures attribute */
   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 */
@@ -278,6 +279,14 @@ nco_rgr_ini /* [fnc] Initialize regridding structure */
       rgr->flg_grd=True;
       continue;
     } /* !skl */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"cell_measures") || !strcasecmp(rgr_lst[rgr_var_idx].key,"cll_msr")){
+      rgr->flg_cll_msr=True;
+      continue;
+    } /* !cell_measures */
+    if(!strcasecmp(rgr_lst[rgr_var_idx].key,"no_cell_measures") || !strcasecmp(rgr_lst[rgr_var_idx].key,"no_cll_msr")){
+      rgr->flg_cll_msr=False;
+      continue;
+    } /* !cell_measures */
     if(!strcasecmp(rgr_lst[rgr_var_idx].key,"curvilinear") || !strcasecmp(rgr_lst[rgr_var_idx].key,"crv")){
       rgr->flg_crv=True;
       continue;
@@ -909,6 +918,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   double *lon_ctr_out=NULL_CEWI; /* [dgr] Longitude centers of rectangular destination grid */
   double *lon_ntf_out=NULL; /* [dgr] Longitude interfaces of rectangular destination grid */
   double *slat_ctr_out=NULL_CEWI; /* [dgr] Latitude  centers of staggered FV destination grid */
+  double *slat_wgt_out=NULL_CEWI; /* [frc] Latitude  weights of staggered FV destination grid */
   double *slon_ctr_out=NULL_CEWI; /* [dgr] Longitude centers of staggered FV destination grid */
   double *wgt_raw; /* [frc] Remapping weights */
   int *col_src_adr; /* [idx] Source address (col) */
@@ -1290,9 +1300,11 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     
     if(nco_grd_lat_typ == nco_grd_lat_fv){
       slat_ctr_out=(double *)nco_malloc(slat_nbr_out*nco_typ_lng(crd_typ_out));
+      slat_wgt_out=(double *)nco_malloc(slat_nbr_out*nco_typ_lng(crd_typ_out));
       slon_ctr_out=(double *)nco_malloc(slon_nbr_out*nco_typ_lng(crd_typ_out));
       for(idx=0;idx<slat_nbr_out;idx++){
 	slat_ctr_out[idx]=lat_ntf_out[idx+1];
+	slat_wgt_out[idx]=sin(dgr2rdn*lat_ctr_out[idx+1])-sin(dgr2rdn*lat_ctr_out[idx]);
       } /* !lat_nbr_out */
       for(idx=0;idx<slon_nbr_out;idx++){
 	slon_ctr_out[idx]=lon_ntf_out[idx];
@@ -1763,7 +1775,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
      AMSR: Latitude, Longitude
      CAM, CERES, CMIP5: lat, lon
      CAM, CMIP5: gw, lat_bnds, lon_bnds
-     CAM-FV: slon, slat, w_stag
+     CAM-FV: slon, slat, w_stag (w_stag is weights for slat grid, analagous to gw for lat grid)
      CAM-SE: area
      CICE: latt_bounds, lont_bounds, latu_bounds, lonu_bounds, TLAT, TLON, ULAT, ULON (NB: CICE uses ?LON and POP uses ?LONG)
      ESMF: gridcell_area
@@ -1904,6 +1916,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   char *lon_bnd_nm_out;
   char *lon_nm_out;
   char *slat_nm_out=NULL;
+  char *slat_wgt_nm_out=NULL;
   char *slon_nm_out=NULL;
   int dmn_id_bnd; /* [id] Dimension ID */
   int dmn_id_bnd_tm; /* [id] Dimension ID */
@@ -1917,6 +1930,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   int lon_bnd_id; /* [id] Variable ID for lon_bnds/lon_vertices */
   int lat_bnd_id; /* [id] Variable ID for lat_bnds/lat_vertices */
   int slat_out_id; /* [id] Variable ID for staggered latitude */
+  int slat_wgt_id; /* [id] Variable ID for staggered latitude weight */
   int slon_out_id; /* [id] Variable ID for staggered longitude */
   int dmn_ids_out[dmn_nbr_grd_max]; /* [id] Dimension IDs array for output variable */
   long dmn_srt_out[dmn_nbr_grd_max];
@@ -1950,6 +1964,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* !flg_grd_out_2D */
   if(nco_grd_lat_typ == nco_grd_lat_fv){
     slat_nm_out=strdup("slat");
+    slat_wgt_nm_out=strdup("w_stag");
     slon_nm_out=strdup("slon");
   } /* !nco_grd_lat_fv */
   /* Ensure temporal bounds dimension name is distinct from spatial bounds when their sizes differ */
@@ -1968,10 +1983,25 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(flg_grd_out_1D) aed_mtd_crd.mode=aed_overwrite; else aed_mtd_crd.mode=aed_delete;
   aed_mtd_crd.type=NC_CHAR;
   aed_mtd_crd.sz=strlen(lat_nm_out)+strlen(lon_nm_out)+1L;
-  att_val_crd=(char *)nco_malloc(aed_mtd_crd.sz*nco_typ_lng(aed_mtd_crd.type)+1L);
+  att_val_crd=(char *)nco_malloc((aed_mtd_crd.sz+1L)*nco_typ_lng(aed_mtd_crd.type));
   (void)sprintf(att_val_crd,"%s %s",lat_nm_out,lon_nm_out);
   aed_mtd_crd.val.cp=att_val_crd;
 
+  nco_bool flg_cll_msr=rgr->flg_cll_msr; /* [flg] Add cell_measures attribute */
+  aed_sct aed_mtd_cll_msr;
+  char *att_nm_cll_msr=NULL;
+  char *att_val_cll_msr=NULL;
+  if(flg_cll_msr){
+    att_nm_cll_msr=strdup("cell_measures");
+    aed_mtd_cll_msr.att_nm=att_nm_cll_msr;
+    aed_mtd_cll_msr.mode=aed_overwrite;
+    aed_mtd_cll_msr.type=NC_CHAR;
+    att_val_cll_msr=(char *)nco_malloc((strlen(area_nm_out)+6L+1L)*nco_typ_lng(aed_mtd_cll_msr.type));
+    (void)sprintf(att_val_cll_msr,"area: %s",area_nm_out);
+    aed_mtd_cll_msr.sz=strlen(att_val_cll_msr);
+    aed_mtd_cll_msr.val.cp=att_val_cll_msr;
+  } /* !flg_cll_msr */
+  
   /* Define new horizontal dimensions before all else */
   if(flg_grd_out_1D){
     rcd+=nco_def_dim(out_id,col_nm_out,col_nbr_out,&dmn_id_col);
@@ -2073,6 +2103,9 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       rcd+=nco_def_var(out_id,slat_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_slat,&slat_out_id);
       if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,slat_out_id,shuffle,deflate,dfl_lvl);
       var_crt_nbr++;
+      rcd+=nco_def_var(out_id,slat_wgt_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_slat,&slat_wgt_id);
+      if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,slat_wgt_id,shuffle,deflate,dfl_lvl);
+      var_crt_nbr++;
       rcd+=nco_def_var(out_id,slon_nm_out,crd_typ_out,dmn_nbr_1D,&dmn_id_slon,&slon_out_id);
       if(dfl_lvl > 0) (void)nco_def_var_deflate(out_id,slon_out_id,shuffle,deflate,dfl_lvl);
       var_crt_nbr++;
@@ -2264,6 +2297,11 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 	  aed_mtd_crd.var_nm=var_nm;
 	  aed_mtd_crd.id=var_id_out;
 	  (void)nco_aed_prc(out_id,var_id_out,aed_mtd_crd);
+	  if(flg_cll_msr){
+	    aed_mtd_cll_msr.var_nm=var_nm;
+	    aed_mtd_cll_msr.id=var_id_out;
+	    (void)nco_aed_prc(out_id,var_id_out,aed_mtd_cll_msr);
+	  } /* !flg_cll_msr */
 	} /* !flg_rgr */
       } /* !rcd */
     } /* !var */
@@ -2280,7 +2318,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 gridcell");
+  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;
@@ -2293,7 +2331,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_val) att_val=(char *)nco_free(att_val);
 
   att_nm=strdup("standard_name");
-  att_val=strdup("cell_area");
+  att_val=strdup("area");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=area_nm_out;
   aed_mtd.id=area_out_id;
@@ -2334,7 +2372,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   if(flg_frc_out_wrt){
     att_nm=strdup("long_name");
-    att_val=strdup("fraction of gridcell valid on destination grid");
+    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;
@@ -2362,7 +2400,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   } /* !flg_frc_out_wrt */
   
   att_nm=strdup("long_name");
-  att_val=strdup("latitude");
+  att_val=strdup("Latitude");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=lat_nm_out;
   aed_mtd.id=lat_out_id;
@@ -2426,7 +2464,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_nm) att_nm=(char *)nco_free(att_nm);
 
   att_nm=strdup("long_name");
-  if(flg_grd_out_rct) att_val=strdup("gridcell latitude interfaces"); else att_val=strdup("gridcell latitude vertices");
+  if(flg_grd_out_rct) att_val=strdup("Gridcell latitude interfaces"); else att_val=strdup("Gridcell latitude vertices");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=lat_bnd_nm_out;
   aed_mtd.id=lat_bnd_id;
@@ -2439,7 +2477,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_val) att_val=(char *)nco_free(att_val);
 
   att_nm=strdup("long_name");
-  att_val=strdup("longitude");
+  att_val=strdup("Longitude");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=lon_nm_out;
   aed_mtd.id=lon_out_id;
@@ -2534,7 +2572,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   if(att_nm) att_nm=(char *)nco_free(att_nm);
 
   att_nm=strdup("long_name");
-  if(flg_grd_out_rct) att_val=strdup("gridcell longitude interfaces"); else att_val=strdup("gridcell longitude vertices");
+  if(flg_grd_out_rct) att_val=strdup("Gridcell longitude interfaces"); else att_val=strdup("Gridcell longitude vertices");
   aed_mtd.att_nm=att_nm;
   aed_mtd.var_nm=lon_bnd_nm_out;
   aed_mtd.id=lon_bnd_id;
@@ -2548,7 +2586,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   if(nco_grd_lat_typ == nco_grd_lat_fv){
     att_nm=strdup("long_name");
-    att_val=strdup("latitude for staggered FV grid");
+    att_val=strdup("Latitude for staggered FV grid");
     aed_mtd.att_nm=att_nm;
     aed_mtd.var_nm=slat_nm_out;
     aed_mtd.id=slat_out_id;
@@ -2574,7 +2612,20 @@ nco_rgr_map /* [fnc] Regrid with external weights */
     if(att_val) att_val=(char *)nco_free(att_val);
 
     att_nm=strdup("long_name");
-    att_val=strdup("longitude for staggered FV grid");
+    att_val=strdup("Latitude weights for staggered FV grid");
+    aed_mtd.att_nm=att_nm;
+    aed_mtd.var_nm=slat_wgt_nm_out;
+    aed_mtd.id=slat_wgt_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,slat_wgt_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("long_name");
+    att_val=strdup("Longitude for staggered FV grid");
     aed_mtd.att_nm=att_nm;
     aed_mtd.var_nm=slon_nm_out;
     aed_mtd.id=slon_out_id;
@@ -2602,7 +2653,7 @@ nco_rgr_map /* [fnc] Regrid with external weights */
 
   if(flg_grd_out_rct){
     att_nm=strdup("long_name");
-    att_val=strdup("latitude quadrature weights (normalized to sum to 2.0 on global grids)");
+    att_val=strdup("Latitude quadrature weights (normalized to sum to 2.0 on global grids)");
     aed_mtd.att_nm=att_nm;
     aed_mtd.var_nm=lat_wgt_nm;
     aed_mtd.id=lat_wgt_id;
@@ -2665,9 +2716,14 @@ nco_rgr_map /* [fnc] Regrid with external weights */
   /* Persistent metadata */
   if(att_nm_crd) att_nm_crd=(char *)nco_free(att_nm_crd);
   if(att_val_crd) att_val_crd=(char *)nco_free(att_val_crd);
+  if(flg_cll_msr){
+    if(att_nm_cll_msr) att_nm_cll_msr=(char *)nco_free(att_nm_cll_msr);
+    if(att_val_cll_msr) att_val_cll_msr=(char *)nco_free(att_val_cll_msr);
+  } /* !flg_cll_msr */
 
   if(nco_grd_lat_typ == nco_grd_lat_fv){
     if(slat_nm_out) slat_nm_out=(char *)nco_free(slat_nm_out);
+    if(slat_wgt_nm_out) slat_wgt_nm_out=(char *)nco_free(slat_wgt_nm_out);
     if(slon_nm_out) slon_nm_out=(char *)nco_free(slon_nm_out);
   } /* !nco_grd_lat_fv */
   
@@ -2726,10 +2782,12 @@ nco_rgr_map /* [fnc] Regrid with external weights */
       dmn_srt_out[0]=0L;
       dmn_cnt_tuo[0]=slat_nbr_out;
       (void)nco_put_vara(out_id,slat_out_id,dmn_srt_out,dmn_cnt_tuo,slat_ctr_out,crd_typ_out);
+      (void)nco_put_vara(out_id,slat_wgt_id,dmn_srt_out,dmn_cnt_tuo,slat_wgt_out,crd_typ_out);
       dmn_srt_out[0]=0L;
       dmn_cnt_tuo[0]=slon_nbr_out;
       (void)nco_put_vara(out_id,slon_out_id,dmn_srt_out,dmn_cnt_tuo,slon_ctr_out,crd_typ_out);
       if(slat_ctr_out) slat_ctr_out=(double *)nco_free(slat_ctr_out);
+      if(slat_wgt_out) slat_wgt_out=(double *)nco_free(slat_wgt_out);
       if(slon_ctr_out) slon_ctr_out=(double *)nco_free(slon_ctr_out);
     } /* !nco_grd_lat_fv */
     dmn_srt_out[0]=0L;
diff --git a/src/nco/nco_rgr.h b/src/nco/nco_rgr.h
index b8f5f99..7de4283 100644
--- a/src/nco/nco_rgr.h
+++ b/src/nco/nco_rgr.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of regridding functions */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rth_flt.c b/src/nco/nco_rth_flt.c
index 80c5ef8..06cf14f 100644
--- a/src/nco/nco_rth_flt.c
+++ b/src/nco/nco_rth_flt.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Float-precision arithmetic, MSVC macros */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rth_flt.h b/src/nco/nco_rth_flt.h
index b8e9d1d..04aad0e 100644
--- a/src/nco/nco_rth_flt.h
+++ b/src/nco/nco_rth_flt.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Float-precision arithmetic, MSVC macros */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rth_utl.c b/src/nco/nco_rth_utl.c
index 93a486c..767605e 100644
--- a/src/nco/nco_rth_utl.c
+++ b/src/nco/nco_rth_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Arithmetic controls and utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_rth_utl.h b/src/nco/nco_rth_utl.h
index d38745e..6f4fe96 100644
--- a/src/nco/nco_rth_utl.h
+++ b/src/nco/nco_rth_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Arithmetic controls and utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_scl_utl.c b/src/nco/nco_scl_utl.c
index 5aa2d94..86c6515 100644
--- a/src/nco/nco_scl_utl.c
+++ b/src/nco/nco_scl_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Scalar utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_scl_utl.h b/src/nco/nco_scl_utl.h
index 4cd44c9..94b8069 100644
--- a/src/nco/nco_scl_utl.h
+++ b/src/nco/nco_scl_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Scalar utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_scm.c b/src/nco/nco_scm.c
index 6386425..c087020 100644
--- a/src/nco/nco_scm.c
+++ b/src/nco/nco_scm.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Software configuration management */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -148,7 +148,7 @@ void
 nco_cpy_prn(void) /* [fnc] Print copyright notice */
 {
   /* Purpose: Print copyright notice */
-  (void)fprintf(stderr,"Copyright (C) 1995--2016 Charlie Zender\n");
+  (void)fprintf(stderr,"Copyright (C) 1995--2017 Charlie Zender\n");
   (void)fprintf(stdout,"This program is part of NCO, the netCDF Operators.\nNCO is free software and comes with a BIG FAT KISS and ABOLUTELY NO WARRANTY\nYou may redistribute and/or modify NCO under the terms of the\nGNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file\nGPL: http://www.gnu.org/copyleft/gpl.html\nLICENSE: https://github.com/nco/nco/tree/master/LICENSE\n");
 } /* end copyright_prn() */
 
diff --git a/src/nco/nco_scm.h b/src/nco/nco_scm.h
index 5498296..fe64b2c 100644
--- a/src/nco/nco_scm.h
+++ b/src/nco/nco_scm.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Software configuration management */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_sld.c b/src/nco/nco_sld.c
index 06a2a93..b0ca24c 100644
--- a/src/nco/nco_sld.c
+++ b/src/nco/nco_sld.c
@@ -2,7 +2,7 @@
 
 /* Purpose: NCO utilities for Swath-Like Data (SLD) */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -94,6 +94,7 @@ nco_trr_ini /* [fnc] Initialize Terraref structure */
   if(trr_wxy){
     cnv_nbr=sscanf(trr_wxy,"%ld,%ld,%ld",&trr->wvl_nbr,&trr->xdm_nbr,&trr->ydm_nbr);
     assert(cnv_nbr == 3);
+    if(cnv_nbr == 3) cnv_nbr=3; /* CEWI */
   } /* !trr_wxy */
 
   /* Parse key-value properties */
diff --git a/src/nco/nco_sld.h b/src/nco/nco_sld.h
index 4d07ffc..0517b36 100644
--- a/src/nco/nco_sld.h
+++ b/src/nco/nco_sld.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Description (definition) of Swath-Like Data (SLD) functions */
 
-/* Copyright (C) 2015--2016 Charlie Zender
+/* Copyright (C) 2015--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_sng_utl.c b/src/nco/nco_sng_utl.c
index 126c289..1465138 100644
--- a/src/nco/nco_sng_utl.c
+++ b/src/nco/nco_sng_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: String utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_sng_utl.h b/src/nco/nco_sng_utl.h
index 2336c8d..a9fdae5 100644
--- a/src/nco/nco_sng_utl.h
+++ b/src/nco/nco_sng_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: String utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
@@ -77,12 +77,12 @@ extern "C" {
   
   /* 20130827 GNU g++ always provides strcasestr(), MSVC never does */
 #ifndef __GNUG__
-# ifdef NEED_STRCASESTR
+  //# ifdef NEED_STRCASESTR
   char * /* O [sng] Pointer to sng_2 in sng_1 */
   strcasestr /* [fnc] Lexicographical case-insensitive string search */
   (const char * const sng_1, /* I [sng] First string */
    const char * const sng_2); /* I [sng] Second string */
-# endif /* !NEED_STRCASESTR */
+  //# endif /* !NEED_STRCASESTR */
 #endif /* __GNUG__ */
   
 #ifdef NEED_STRDUP
diff --git a/src/nco/nco_srm.c b/src/nco/nco_srm.c
index d4a709b..8bc937e 100644
--- a/src/nco/nco_srm.c
+++ b/src/nco/nco_srm.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Streams */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_srm.h b/src/nco/nco_srm.h
index 0233fc9..9fc974c 100644
--- a/src/nco/nco_srm.h
+++ b/src/nco/nco_srm.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Streams */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_typ.h b/src/nco/nco_typ.h
index 450760c..c7aed0d 100644
--- a/src/nco/nco_typ.h
+++ b/src/nco/nco_typ.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Type definitions, opaque types */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_avg.c b/src/nco/nco_var_avg.c
index 064f289..e76747b 100644
--- a/src/nco/nco_var_avg.c
+++ b/src/nco/nco_var_avg.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Average variables */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_avg.h b/src/nco/nco_var_avg.h
index a0cfccc..c323140 100644
--- a/src/nco/nco_var_avg.h
+++ b/src/nco/nco_var_avg.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Average variables */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_lst.c b/src/nco/nco_var_lst.c
index 60e899a..20c9d16 100644
--- a/src/nco/nco_var_lst.c
+++ b/src/nco/nco_var_lst.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable list utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_lst.h b/src/nco/nco_var_lst.h
index aec7540..22d86ea 100644
--- a/src/nco/nco_var_lst.h
+++ b/src/nco/nco_var_lst.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable list utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_rth.c b/src/nco/nco_var_rth.c
index 1ef8626..9be0db3 100644
--- a/src/nco/nco_var_rth.c
+++ b/src/nco/nco_var_rth.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable arithmetic */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_rth.h b/src/nco/nco_var_rth.h
index 0e83228..79b0f7d 100644
--- a/src/nco/nco_var_rth.h
+++ b/src/nco/nco_var_rth.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable arithmetic */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_scv.c b/src/nco/nco_var_scv.c
index 7ff8f6c..e996253 100644
--- a/src/nco/nco_var_scv.c
+++ b/src/nco/nco_var_scv.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Arithmetic between variables and scalar values */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_scv.h b/src/nco/nco_var_scv.h
index fef5238..e4c8e52 100644
--- a/src/nco/nco_var_scv.h
+++ b/src/nco/nco_var_scv.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Arithmetic between variables and scalar values */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_utl.c b/src/nco/nco_var_utl.c
index 984e859..7c6bcc0 100644
--- a/src/nco/nco_var_utl.c
+++ b/src/nco/nco_var_utl.c
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/nco_var_utl.h b/src/nco/nco_var_utl.h
index 659cb91..ff366fb 100644
--- a/src/nco/nco_var_utl.h
+++ b/src/nco/nco_var_utl.h
@@ -2,7 +2,7 @@
 
 /* Purpose: Variable utilities */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco/ncpdq.c b/src/nco/ncpdq.c
index 7a92c6b..f1d5848 100644
--- a/src/nco/ncpdq.c
+++ b/src/nco/ncpdq.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Pack, re-dimension, query single netCDF file and output to a single file */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -187,6 +187,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FL_RTR_RMT_LCN;
   nco_bool FL_LST_IN_FROM_STDIN=False; /* [flg] fl_lst_in comes from stdin */
   nco_bool FORCE_APPEND=False; /* Option A */
@@ -230,6 +232,14 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -398,6 +408,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"drt") || !strcmp(opt_crr,"mmr_drt") || !strcmp(opt_crr,"dirty")) flg_cln=False; /* [flg] Clean memory prior to exit */
       if(!strcmp(opt_crr,"fl_fmt") || !strcmp(opt_crr,"file_format")) rcd=nco_create_mode_prs(optarg,&fl_out_fmt);
@@ -597,7 +611,7 @@ main(int argc,char **argv)
   (void)nco_inq_format(in_id,&fl_in_fmt);
 
   /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
   /* Were all user-specified dimensions found? */ 
   (void)nco_chk_dmn(lmt_nbr,flg_dne);     
diff --git a/src/nco/ncra.c b/src/nco/ncra.c
index 369a3b5..102861e 100644
--- a/src/nco/ncra.c
+++ b/src/nco/ncra.c
@@ -9,7 +9,7 @@
    specfied variables of multiple input netCDF files and output them 
    to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -241,6 +241,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FLG_BFR_NRM=False; /* [flg] Current output buffers need normalization */
   nco_bool FLG_MRO=False; /* [flg] Multi-Record Output */
   nco_bool FL_LST_IN_APPEND=True; /* Option H */
@@ -313,9 +315,18 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cll_mth",no_argument,0,0}, /* [flg] Add/modify cell_methods attributes */
     {"cell_methods",no_argument,0,0}, /* [flg] Add/modify cell_methods attributes */
     {"no_cll_mth",no_argument,0,0}, /* [flg] Do not add/modify cell_methods attributes */
+    {"no_cell_methods",no_argument,0,0}, /* [flg] Do not add/modify cell_methods attributes */
     {"clm_bnd",no_argument,0,0}, /* [sct] Climatology bounds */
     {"cb",no_argument,0,0}, /* [sct] Climatology bounds */
     {"clm2bnd",no_argument,0,0}, /* [sct] Climatology bounds-to-time bounds */
@@ -504,6 +515,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cll_mth") || !strcmp(opt_crr,"cell_methods")) flg_cll_mth=True; /* [flg] Add/modify cell_methods attributes */
       if(!strcmp(opt_crr,"no_cll_mth") || !strcmp(opt_crr,"no_cell_methods")) flg_cll_mth=False; /* [flg] Add/modify cell_methods attributes */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
@@ -739,8 +754,8 @@ main(int argc,char **argv)
   trv_tbl_init(&trv_tbl); 
 
   /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
-
+  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  
   /* Were all user-specified dimensions found? */ 
   (void)nco_chk_dmn(lmt_nbr,flg_dne);     
 
@@ -1558,7 +1573,7 @@ main(int argc,char **argv)
       trv_tbl_init(&trv_tbl1); 
 
       /* Construct GTT using current file ID */
-      (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl1);
+      (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,var_lst_in_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl1);
 
       /* Were all user-specified dimensions found? */ 
       (void)nco_chk_dmn(lmt_nbr,flg_dne);  
diff --git a/src/nco/ncrename.c b/src/nco/ncrename.c
index 1ea2faa..05ed2c4 100644
--- a/src/nco/ncrename.c
+++ b/src/nco/ncrename.c
@@ -4,7 +4,7 @@
 
 /* Purpose: Rename dimensions, variables, and attributes of a netCDF file */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -383,7 +383,7 @@ main(int argc,char **argv)
   trv_tbl_init(&trv_tbl); 
 
   /* Construct GTT (Group Traversal Table), check -v and -g input names and create extraction list */
-  (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,NULL,(int)0,False,False,False,False,True,nco_pck_plc_nil,NULL,trv_tbl);
+  (void)nco_bld_trv_tbl(nc_id,trv_pth,(int)0,NULL,(int)0,NULL,False,False,NULL,(int)0,NULL,(int)0,False,False,False,False,True,False,False,nco_pck_plc_nil,NULL,trv_tbl);
 
   /* Rename variables */
   for(int idx_var=0;idx_var<nbr_var_rnm;idx_var++){
diff --git a/src/nco/ncwa.c b/src/nco/ncwa.c
index ee9789d..67ca775 100644
--- a/src/nco/ncwa.c
+++ b/src/nco/ncwa.c
@@ -5,7 +5,7 @@
 /* Purpose: Compute averages of specified hyperslabs of specfied variables
    in a single input netCDF file and output them to a single file. */
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3.
@@ -195,6 +195,8 @@ main(int argc,char **argv)
   nco_bool EXCLUDE_INPUT_LIST=False; /* Option c */
   nco_bool EXTRACT_ALL_COORDINATES=False; /* Option c */
   nco_bool EXTRACT_ASSOCIATED_COORDINATES=True; /* Option C */
+  nco_bool EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+  nco_bool EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
   nco_bool FL_RTR_RMT_LCN;
   nco_bool FL_LST_IN_FROM_STDIN=False; /* [flg] fl_lst_in comes from stdin */
   nco_bool FORCE_APPEND=False; /* Option A */
@@ -253,9 +255,18 @@ main(int argc,char **argv)
   
   static struct option opt_lng[]={ /* Structure ordered by short option key if possible */
     /* Long options with no argument, no short option counterpart */
+    {"cll_msr",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"cell_measures",no_argument,0,0}, /* [flg] Extract cell_measures variables */
+    {"no_cll_msr",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"no_cell_measures",no_argument,0,0}, /* [flg] Do not extract cell_measures variables */
+    {"frm_trm",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"formula_terms",no_argument,0,0}, /* [flg] Extract formula_terms variables */
+    {"no_frm_trm",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
+    {"no_formula_terms",no_argument,0,0}, /* [flg] Do not extract formula_terms variables */
     {"cll_mth",no_argument,0,0}, /* [flg] Add/modify cell_methods attributes */
     {"cell_methods",no_argument,0,0}, /* [flg] Add/modify cell_methods attributes */
     {"no_cll_mth",no_argument,0,0}, /* [flg] Do not add/modify cell_methods attributes */
+    {"no_cell_methods",no_argument,0,0}, /* [flg] Do not add/modify cell_methods attributes */
     {"cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"clean",no_argument,0,0}, /* [flg] Clean memory prior to exit */
     {"mmr_cln",no_argument,0,0}, /* [flg] Clean memory prior to exit */
@@ -434,6 +445,10 @@ main(int argc,char **argv)
         cnk_plc_sng=(char *)strdup(optarg);
         cnk_plc=nco_cnk_plc_get(cnk_plc_sng);
       } /* endif cnk */
+      if(!strcmp(opt_crr,"cll_msr") || !strcmp(opt_crr,"cell_measures")) EXTRACT_CLL_MSR=True; /* [flg] Extract cell_measures variables */
+      if(!strcmp(opt_crr,"no_cll_msr") || !strcmp(opt_crr,"no_cell_measures")) EXTRACT_CLL_MSR=False; /* [flg] Do not extract cell_measures variables */
+      if(!strcmp(opt_crr,"frm_trm") || !strcmp(opt_crr,"formula_terms")) EXTRACT_FRM_TRM=True; /* [flg] Extract formula_terms variables */
+      if(!strcmp(opt_crr,"no_frm_trm") || !strcmp(opt_crr,"no_formula_terms")) EXTRACT_FRM_TRM=False; /* [flg] Do not extract formula_terms variables */
       if(!strcmp(opt_crr,"cll_mth") || !strcmp(opt_crr,"cell_methods")) flg_cll_mth=True; /* [flg] Add/modify cell_methods attributes */
       if(!strcmp(opt_crr,"no_cll_mth") || !strcmp(opt_crr,"no_cell_methods")) flg_cll_mth=False; /* [flg] Add/modify cell_methods attributes */
       if(!strcmp(opt_crr,"cln") || !strcmp(opt_crr,"mmr_cln") || !strcmp(opt_crr,"clean")) flg_cln=True; /* [flg] Clean memory prior to exit */
@@ -683,7 +698,7 @@ main(int argc,char **argv)
   (void)nco_inq_format(in_id,&fl_in_fmt);
 
   /* Construct GTT, Group Traversal Table (groups,variables,dimensions, limits) */
-  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,nco_pck_plc_nil,&flg_dne,trv_tbl);
+  (void)nco_bld_trv_tbl(in_id,trv_pth,lmt_nbr,lmt_arg,aux_nbr,aux_arg,MSA_USR_RDR,FORTRAN_IDX_CNV,grp_lst_in,grp_lst_in_nbr,var_lst_in,xtr_nbr,EXTRACT_ALL_COORDINATES,GRP_VAR_UNN,False,EXCLUDE_INPUT_LIST,EXTRACT_ASSOCIATED_COORDINATES,EXTRACT_CLL_MSR,EXTRACT_FRM_TRM,nco_pck_plc_nil,&flg_dne,trv_tbl);
 
   /* 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);
diff --git a/src/nco_c++/Makefile.old b/src/nco_c++/Makefile.old
index b87d24c..1d51ba6 100644
--- a/src/nco_c++/Makefile.old
+++ b/src/nco_c++/Makefile.old
@@ -3,7 +3,7 @@
 # Purpose: Makefile for libnco_c++ module nco_c++
 # Requires GNU Make---AT&T Make chokes on GNU syntax
 
-# Copyright (C) 1994--2016 Charlie Zender
+# Copyright (C) 1994--2017 Charlie Zender
 # License: GNU General Public License (GPL) Version 3
 # See http://www.gnu.org/copyleft/gpl.html for full license text
 
diff --git a/src/nco_c++/libnco_c++.hh b/src/nco_c++/libnco_c++.hh
index c48d7fe..cb96838 100644
--- a/src/nco_c++/libnco_c++.hh
+++ b/src/nco_c++/libnco_c++.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Prototypes, typedefs, and global variables for libnco_c++
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_att.cc b/src/nco_c++/nco_att.cc
index 14303ff..733fa8e 100644
--- a/src/nco_c++/nco_att.cc
+++ b/src/nco_c++/nco_att.cc
@@ -2,7 +2,7 @@
 
 // Implementation (declaration) of C++ interface to netCDF attribute routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_att.hh b/src/nco_c++/nco_att.hh
index 5369d69..c081523 100644
--- a/src/nco_c++/nco_att.hh
+++ b/src/nco_c++/nco_att.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of C++ interface to netCDF attribute routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_dmn.cc b/src/nco_c++/nco_dmn.cc
index c022116..a885c91 100644
--- a/src/nco_c++/nco_dmn.cc
+++ b/src/nco_c++/nco_dmn.cc
@@ -2,7 +2,7 @@
 
 // Implementation (declaration) of C++ interface to netCDF dimension routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_dmn.hh b/src/nco_c++/nco_dmn.hh
index 216bd2d..e64c42a 100644
--- a/src/nco_c++/nco_dmn.hh
+++ b/src/nco_c++/nco_dmn.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of C++ interface to netCDF dimension routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_fl.cc b/src/nco_c++/nco_fl.cc
index f391c7a..fa6ca45 100644
--- a/src/nco_c++/nco_fl.cc
+++ b/src/nco_c++/nco_fl.cc
@@ -2,7 +2,7 @@
 
 // Purpose: Implementation (declaration) of C++ interface to netCDF file-level routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_fl.hh b/src/nco_c++/nco_fl.hh
index e5a3bfa..eff6733 100644
--- a/src/nco_c++/nco_fl.hh
+++ b/src/nco_c++/nco_fl.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of C++ interface to netCDF file-level routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_hgh.cc b/src/nco_c++/nco_hgh.cc
index 5f69fef..879706d 100644
--- a/src/nco_c++/nco_hgh.cc
+++ b/src/nco_c++/nco_hgh.cc
@@ -2,7 +2,7 @@
 
 // Implementation (declaration) of C++ interface to high-level NCO utilities
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_hgh.hh b/src/nco_c++/nco_hgh.hh
index 5a9ed5c..fdfe7d2 100644
--- a/src/nco_c++/nco_hgh.hh
+++ b/src/nco_c++/nco_hgh.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of high-level NCO routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_utl.cc b/src/nco_c++/nco_utl.cc
index 6a64c7a..92c7ab6 100644
--- a/src/nco_c++/nco_utl.cc
+++ b/src/nco_c++/nco_utl.cc
@@ -2,7 +2,7 @@
 
 // Implementation (declaration) of C++ interface utilities for netCDF routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_utl.hh b/src/nco_c++/nco_utl.hh
index a05c1b1..3d8d5d3 100644
--- a/src/nco_c++/nco_utl.hh
+++ b/src/nco_c++/nco_utl.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of C++ interface utilities for netCDF routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_var.cc b/src/nco_c++/nco_var.cc
index 515a274..e6d12e4 100644
--- a/src/nco_c++/nco_var.cc
+++ b/src/nco_c++/nco_var.cc
@@ -2,7 +2,7 @@
 
 // Purpose: Implementation (declaration) of C++ interface to netCDF variable routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */
diff --git a/src/nco_c++/nco_var.hh b/src/nco_c++/nco_var.hh
index aab41d0..37d63bd 100644
--- a/src/nco_c++/nco_var.hh
+++ b/src/nco_c++/nco_var.hh
@@ -2,7 +2,7 @@
 
 // Purpose: Description (definition) of C++ interface to netCDF variable routines
 
-/* Copyright (C) 1995--2016 Charlie Zender
+/* Copyright (C) 1995--2017 Charlie Zender
    This file is part of NCO, the netCDF Operators. NCO is free software.
    You may redistribute and/or modify NCO under the terms of the 
    GNU General Public License (GPL) Version 3 with exceptions described in the LICENSE file */

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